aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEli Zaretskii2001-04-13 09:50:37 +0000
committerEli Zaretskii2001-04-13 09:50:37 +0000
commit961e23946226713cbd5d4f4f2f9c8d5898db7a1c (patch)
tree6c5b2a1dcc0570a3e96acca768c1af8918b43190
parentf9f999d98447e02c462d72d2015cddc4eb7adb4e (diff)
downloademacs-961e23946226713cbd5d4f4f2f9c8d5898db7a1c.tar.gz
emacs-961e23946226713cbd5d4f4f2f9c8d5898db7a1c.zip
Document problems with MS debugger working on optimized code.
From Jason Rumney <jasonr@gnu.org>.
-rw-r--r--etc/DEBUG25
1 files changed, 22 insertions, 3 deletions
diff --git a/etc/DEBUG b/etc/DEBUG
index 280d3759023..a4786082ebe 100644
--- a/etc/DEBUG
+++ b/etc/DEBUG
@@ -401,9 +401,10 @@ with a session that you are debugging.
401 (written by Marc Fleischeuers, Geoff Voelker and Andrew Innes) 401 (written by Marc Fleischeuers, Geoff Voelker and Andrew Innes)
402 402
403To debug Emacs with Microsoft Visual C++, you either start emacs from 403To debug Emacs with Microsoft Visual C++, you either start emacs from
404the debugger or attach the debugger to a running emacs process. To 404the debugger or attach the debugger to a running emacs process.
405start emacs from the debugger, you can use the file bin/debug.bat. The 405
406Microsoft Developer studio will start and under Project, Settings, 406To start emacs from the debugger, you can use the file bin/debug.bat.
407The Microsoft Developer studio will start and under Project, Settings,
407Debug, General you can set the command-line arguments and Emacs's 408Debug, General you can set the command-line arguments and Emacs's
408startup directory. Set breakpoints (Edit, Breakpoints) at Fsignal and 409startup directory. Set breakpoints (Edit, Breakpoints) at Fsignal and
409other functions that you want to examine. Run the program (Build, 410other functions that you want to examine. Run the program (Build,
@@ -461,3 +462,21 @@ It is also possible to keep appropriately masked and typecast Lisp
461symbols in the Watch window, this is more convenient when steeping 462symbols in the Watch window, this is more convenient when steeping
462though the code. For instance, on entering apply_lambda, you can 463though the code. For instance, on entering apply_lambda, you can
463watch (struct Lisp_Symbol *) (0xfffffff & args[0]). 464watch (struct Lisp_Symbol *) (0xfffffff & args[0]).
465
466Optimizations often confuse the MS debugger. For example, the
467debugger will sometimes report wrong line numbers, e.g., when it
468prints the backtrace for a crash. It is usually best to look at the
469disassembly to determine exactly what code is being run--the
470disassembly will probably show several source lines followed by a
471block of assembler for those lines. The actual point where Emacs
472crashes will be one of those source lines, but not neccesarily the one
473that the debugger reports.
474
475Another problematic area with the MS debugger is with variables that
476are stored in registers: it will sometimes display wrong values for
477those variables. Usually you will not be able to see any value for a
478register variable, but if it is only being stored in a register
479temporarily, you will see an old value for it. Again, you need to
480look at the disassembly to determine which registers are being used,
481and look at those registers directly, to see the actual current values
482of these variables.