Changeset 3207 for trunk/etc/DEBUG

Show
Ignore:
Timestamp:
12/28/03 22:47:28 (5 years ago)
Author:
miyoshi
Message:

Sync up with Emacs-21.2.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/etc/DEBUG

    r125 r3207  
    4242On modern POSIX systems, you can override that with this command: 
    4343 
    44    handle int stop nopass 
     44   handle SIGINT stop nopass 
    4545 
    4646After this `handle' command, SIGINT will return control to GDB.  If 
     
    259259code causes the X protocol errors. 
    260260 
     261Some bugs related to the X protocol disappear when Emacs runs in a 
     262synchronous mode.  To track down those bugs, we suggest the following 
     263procedure: 
     264 
     265  - Run Emacs under a debugger and put a breakpoint inside the 
     266    primitive function which, when called from Lisp, triggers the X 
     267    protocol errors.  For example, if the errors happen when you 
     268    delete a frame, put a breakpoint inside `Fdelete_frame'. 
     269 
     270  - When the breakpoint breaks, step through the code, looking for 
     271    calls to X functions (the ones whose names begin with "X" or 
     272    "Xt" or "Xm"). 
     273 
     274  - Insert calls to `XSync' before and after each call to the X 
     275    functions, like this: 
     276 
     277       XSync (f->output_data.x->display_info->display, 0); 
     278 
     279    where `f' is the pointer to the `struct frame' of the selected 
     280    frame, normally available via XFRAME (selected_frame).  (Most 
     281    functions which call X already have some variable that holds the 
     282    pointer to the frame, perhaps called `f' or `sf', so you shouldn't 
     283    need to compute it.) 
     284 
     285    If your debugger can call functions in the program being debugged, 
     286    you should be able to issue the calls to `XSync' without recompiling 
     287    Emacs.  For example, with GDB, just type: 
     288 
     289       call XSync (f->output_data.x->display_info->display, 0) 
     290 
     291    before and immediately after the suspect X calls.  If your 
     292    debugger does not support this, you will need to add these pairs 
     293    of calls in the source and rebuild Emacs. 
     294 
     295    Either way, systematically step through the code and issue these 
     296    calls until you find the first X function called by Emacs after 
     297    which a call to `XSync' winds up in the function 
     298    `x_error_quitter'.  The first X function call for which this 
     299    happens is the one that generated the X protocol error. 
     300 
     301  - You should now look around this offending X call and try to figure 
     302    out what is wrong with it. 
     303 
    261304** If the symptom of the bug is that Emacs fails to respond 
    262305 
     
    437480character positions in buffers and strings; the resulting diagnostics 
    438481might pinpoint the cause of the problem. 
     482 
     483** Debugging the TTY (non-windowed) version 
     484 
     485The most convenient method of debugging the character-terminal display 
     486is to do that on a window system such as X.  Begin by starting an 
     487xterm window, then type these commands inside that window: 
     488 
     489  $ tty 
     490  $ echo $TERM 
     491 
     492Let's say these commands print "/dev/ttyp4" and "xterm", respectively. 
     493 
     494Now start Emacs (the normal, windowed-display session, i.e. without 
     495the `-nw' option), and invoke "M-x gdb RET emacs RET" from there.  Now 
     496type these commands at GDB's prompt: 
     497 
     498  (gdb) set args -nw -t /dev/ttyp4 
     499  (gdb) set environment TERM xterm 
     500  (gdb) run 
     501 
     502The debugged Emacs should now start in no-window mode with its display 
     503directed to the xterm window you opened above. 
     504 
     505Similar arrangement is possible on a character terminal by using the 
     506`screen' package. 
    439507 
    440508** Running Emacs built with malloc debugging packages