Mercurial > emacs
comparison etc/DEBUG @ 37333:54ec1bffae34
Document problems with MS debugger working on optimized code.
From Jason Rumney <jasonr@gnu.org>.
author | Eli Zaretskii <eliz@gnu.org> |
---|---|
date | Fri, 13 Apr 2001 09:50:37 +0000 |
parents | e9d11225e3cd |
children | 7121f840504e |
comparison
equal
deleted
inserted
replaced
37332:446514f572dd | 37333:54ec1bffae34 |
---|---|
399 ** Some suggestions for debugging on MS Windows: | 399 ** Some suggestions for debugging on MS Windows: |
400 | 400 |
401 (written by Marc Fleischeuers, Geoff Voelker and Andrew Innes) | 401 (written by Marc Fleischeuers, Geoff Voelker and Andrew Innes) |
402 | 402 |
403 To debug Emacs with Microsoft Visual C++, you either start emacs from | 403 To debug Emacs with Microsoft Visual C++, you either start emacs from |
404 the debugger or attach the debugger to a running emacs process. To | 404 the debugger or attach the debugger to a running emacs process. |
405 start emacs from the debugger, you can use the file bin/debug.bat. The | 405 |
406 Microsoft Developer studio will start and under Project, Settings, | 406 To start emacs from the debugger, you can use the file bin/debug.bat. |
407 The Microsoft Developer studio will start and under Project, Settings, | |
407 Debug, General you can set the command-line arguments and Emacs's | 408 Debug, General you can set the command-line arguments and Emacs's |
408 startup directory. Set breakpoints (Edit, Breakpoints) at Fsignal and | 409 startup directory. Set breakpoints (Edit, Breakpoints) at Fsignal and |
409 other functions that you want to examine. Run the program (Build, | 410 other functions that you want to examine. Run the program (Build, |
410 Start debug). Emacs will start and the debugger will take control as | 411 Start debug). Emacs will start and the debugger will take control as |
411 soon as a breakpoint is hit. | 412 soon as a breakpoint is hit. |
459 | 460 |
460 It is also possible to keep appropriately masked and typecast Lisp | 461 It is also possible to keep appropriately masked and typecast Lisp |
461 symbols in the Watch window, this is more convenient when steeping | 462 symbols in the Watch window, this is more convenient when steeping |
462 though the code. For instance, on entering apply_lambda, you can | 463 though the code. For instance, on entering apply_lambda, you can |
463 watch (struct Lisp_Symbol *) (0xfffffff & args[0]). | 464 watch (struct Lisp_Symbol *) (0xfffffff & args[0]). |
465 | |
466 Optimizations often confuse the MS debugger. For example, the | |
467 debugger will sometimes report wrong line numbers, e.g., when it | |
468 prints the backtrace for a crash. It is usually best to look at the | |
469 disassembly to determine exactly what code is being run--the | |
470 disassembly will probably show several source lines followed by a | |
471 block of assembler for those lines. The actual point where Emacs | |
472 crashes will be one of those source lines, but not neccesarily the one | |
473 that the debugger reports. | |
474 | |
475 Another problematic area with the MS debugger is with variables that | |
476 are stored in registers: it will sometimes display wrong values for | |
477 those variables. Usually you will not be able to see any value for a | |
478 register variable, but if it is only being stored in a register | |
479 temporarily, you will see an old value for it. Again, you need to | |
480 look at the disassembly to determine which registers are being used, | |
481 and look at those registers directly, to see the actual current values | |
482 of these variables. |