comparison nt/INSTALL @ 67437:dc47c26ee643

Add explanation of how to debug with GDB starting from the Emacs Abort dialog.
author Eli Zaretskii <eliz@gnu.org>
date Fri, 09 Dec 2005 19:17:40 +0000
parents 47fccd30153d
children 067115a6e738 7beb78bc1f8e
comparison
equal deleted inserted replaced
67436:95ba645227f9 67437:dc47c26ee643
241 241
242 * Debugging 242 * Debugging
243 243
244 You should be able to debug Emacs using the debugger that is 244 You should be able to debug Emacs using the debugger that is
245 appropriate for the compiler you used, namely DevStudio or Windbg if 245 appropriate for the compiler you used, namely DevStudio or Windbg if
246 compiled with MSVC, or gdb if compiled with gcc. 246 compiled with MSVC, or GDB if compiled with GCC.
247
248 When Emacs aborts due to a fatal internal error, Emacs on Windows
249 pops up an Emacs Abort Dialog asking you whether you want to debug
250 Emacs or terminate it. If Emacs was built with MSVC, click YES
251 twice, and Windbg or the DevStudio debugger will start up
252 automatically. If Emacs was built with GCC, first start GDB and
253 attach it to the Emacs process with the "gdb -p EMACS-PID" command,
254 where EMACS-PID is the Emacs process ID (which you can see in the
255 Windows Task Manager), type the "continue" command inside GDB, and
256 only then click YES on the abort dialog. This will pass control to
257 the debugger, and you will be able to debug the cause of the fatal
258 error.
247 259
248 Emacs functions implemented in C use a naming convention that reflects 260 Emacs functions implemented in C use a naming convention that reflects
249 their names in lisp. The names of the C routines are the lisp names 261 their names in lisp. The names of the C routines are the lisp names
250 prefixed with 'F', and with dashes converted to underscores. For 262 prefixed with 'F', and with dashes converted to underscores. For
251 example, the function call-process is implemented in C by 263 example, the function call-process is implemented in C by
252 Fcall_process. Similarly, lisp variables are prefixed with 'V', again 264 Fcall_process. Similarly, lisp variables are prefixed with 'V', again
253 with dashes converted to underscores. These conventions enable you to 265 with dashes converted to underscores. These conventions enable you to
254 easily set breakpoints or examine familiar lisp variables by name. 266 easily set breakpoints or examine familiar lisp variables by name.
255 267
256 Since Emacs data is often in the form of a lisp object, and the 268 Since Emacs data is often in the form of a lisp object, and the
257 Lisp_Object type is difficult to examine manually in the MSVC 269 Lisp_Object type is difficult to examine manually in a debugger,
258 debugger, Emacs provides a helper routine called debug_print that 270 Emacs provides a helper routine called debug_print that prints out a
259 prints out a readable representation of a Lisp_Object. (If you are 271 readable representation of a Lisp_Object. If you are using GDB,
260 using gdb, there is a .gdbinit file in the src directory which 272 there is a .gdbinit file in the src directory which provides
261 provides definitions that are useful for examining lisp objects. The 273 definitions that are useful for examining lisp objects. Therefore,
262 following tips are mainly of interest when using MSVC.) The output 274 the following tips are mainly of interest when using MSVC.
263 from debug_print is sent to stderr, and to the debugger via the 275
264 OutputDebugString routine. The output sent to stderr should be 276 The output from debug_print is sent to stderr, and to the debugger
265 displayed in the console window that was opened when the emacs.exe 277 via the OutputDebugString routine. The output sent to stderr should
266 executable was started. The output sent to the debugger should be 278 be displayed in the console window that was opened when the
267 displayed in its "Debug" output window. 279 emacs.exe executable was started. The output sent to the debugger
280 should be displayed in its "Debug" output window.
268 281
269 When you are in the process of debugging Emacs and you would like to 282 When you are in the process of debugging Emacs and you would like to
270 examine the contents of a Lisp_Object variable, popup the QuickWatch 283 examine the contents of a Lisp_Object variable, popup the QuickWatch
271 window (QuickWatch has an eyeglass symbol on its button in the 284 window (QuickWatch has an eyeglass symbol on its button in the
272 toolbar). In the text field at the top of the window, enter 285 toolbar). In the text field at the top of the window, enter