From: Marc Fleischeuers > The instructions for Emacs pretesters explain how you can > examine Lisp_Object values. There are some peculiarities about debugging with the Microsoft debugger that make it very different from debugging under gdb. The instructions for pretesters do not adress these differences. From past email exchanges with Geoff and Andrew I have compiled a few tips to help debugging with the Microsoft debugger, appended below. I realize that it may not be appropriate to include material on non-free compilers in emacs, but would there still be a way to distribute these tips, just to save aspirant pretesters for windows some time? -------------------------------------------------- Most of this information is due to Geoff Voelker and Andrew Innes, however any errors are definitely mine. To debug emacs with Microsoft Visual C++, you either start emacs from the debugger or attach the debugger to a running emacs process. To start emacs from the debugger, you can use the file bin/debug.bat. The Microsoft Developer studio will start and under Project, Settings, Debug, General you can set the command-line arguments and emacs' startup directory. Set breakpoints (Edit, Breakpoints) at Fsignal and other functions that you want to examine. Run the program (Build, Start debug). Emacs will start and the debugger will take control as soon as a breakpoint is hit. You can also attach the debugger to an already running emacs process. To do this, start up the Microsoft Developer studio and select Build, Start debug, Attach to process. Choose the emacs process from the list. Send a break to the running process (Debug, Break) and you will find that execution is halted somewhere in user32.dll. Open the stack trace window and go up the stack to w32_msg_pump(). Now you can set breakpoints in emacs (Edit, Breakpoints). Continue the running emacs process (Debug, Step out) and control will return to emacs, until a breakpoint is hit. To examine the contents of a lisp variable, you can use the function 'debug_print()'. Right-click on a variable, select QuickWatch, and place 'debug_print(' and ')' around the expression. Press 'Recalculate' and the output is sent to the 'Debug' pane in the Output window. If emacs was started from the debugger, a console window was opened at emacs' startup; this console window also shows the output of 'debug_print()'. It is also possible to keep appropriately masked and typecast lisp symbols in the Watch window, this is more convenient when steeping though the code. For instance, on entering apply_lambda(), you can watch (struct Lisp_Symbol *) (0xfffffff & args[0]).