1*debug.txt* For Vim version 7.0b. Last change: 2005 Dec 17 2 3 4 VIM REFERENCE MANUAL by Bram Moolenaar 5 6 7Debugging Vim *debug-vim* 8 9This is for debugging Vim itself, when it doesn't work properly. 10For debugging Vim scripts, functions, etc. see |debug-scripts| 11 121. Location of a crash, using gcc and gdb |debug-gcc| 132. Windows Bug Reporting |debug-win32| 14 15============================================================================== 16 171. Location of a crash, using gcc and gdb *debug-gcc* 18 19When Vim crashes in one of the test files, and you are using gcc for 20compilation, here is what you can do to find out exactly where Vim crashes. 21This also applies when using the MingW tools. 22 231. Compile Vim with the "-g" option (there is a line in the Makefile for this, 24 which you can uncomment). 25 262. Execute these commands (replace "11" with the test that fails): > 27 cd testdir 28 gdb ../vim 29 run -u unix.vim -U NONE -s dotest.in test11.in 30 313. Check where Vim crashes, gdb should give a message for this. 32 334. Get a stack trace from gdb with this command: > 34 where 35< You can check out different places in the stack trace with: > 36 frame 3 37< Replace "3" with one of the numbers in the stack trace. 38 39============================================================================== 40 412. Windows Bug Reporting *debug-win32* 42 43If the Windows version of Vim crashes in a reproducible manner, 44you can take some steps to provide a useful bug report. 45 46First, you must obtain the debugger symbols (PDB) file for your executable: 47gvim.pdb for gvim.exe, or vim.pdb for vim.exe. It should be available 48from the same place that you obtained the executable. Be sure to use 49the PDB that matches the EXE. 50 51If you built the executable yourself with the Microsoft Visual C++ compiler, 52then the PDB was built with the EXE. 53 54You can download the Microsoft Visual C++ Toolkit from 55 http://msdn.microsoft.com/visualc/vctoolkit2003/ 56This contains the command-line tools, but not the Visual Studio IDE. 57 58The Debugging Tools for Windows can be downloaded from 59 http://www.microsoft.com/whdc/devtools/debugging/default.mspx 60This includes the WinDbg debugger. 61 62If you have Visual Studio, use that instead of the VC Toolkit 63and WinDbg. 64 65For other compilers, you should always use the corresponding debugger: TD for 66a Vim executable compiled with the Borland compiler; gdb (see above 67|debug-gcc|) for the Cygwin and MinGW compilers. 68 69========================================================================= 70 vim:tw=78:ts=8:ft=help:norl: 71