blob: a0fef1b6460483e0c374925ca0529efc353eb505 [file] [log] [blame]
Bram Moolenaare344bea2005-09-01 20:46:49 +00001*debug.txt* For Vim version 7.0aa. Last change: 2005 Sep 01
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.
10
111. Location of a crash, using gcc and gdb |debug-gcc|
122. Windows Bug Reporting |debug-win32|
13
14==============================================================================
15
161. Location of a crash, using gcc and gdb *debug-gcc*
17
18When Vim crashes in one of the test files, and you are using gcc for
19compilation, here is what you can do to find out exactly where Vim crashes.
20This also applies when using the MingW tools.
21
221. Compile Vim with the "-g" option (there is a line in the Makefile for this,
23 which you can uncomment).
24
252. Execute these commands (replace "11" with the test that fails): >
26 cd testdir
27 gdb ../vim
28 run -u unix.vim -U NONE -s dotest.in test11.in
29
303. Check where Vim crashes, gdb should give a message for this.
31
324. Get a stack trace from gdb with this command: >
33 where
34< You can check out different places in the stack trace with: >
35 frame 3
36< Replace "3" with one of the numbers in the stack trace.
37
38==============================================================================
39
402. Windows Bug Reporting *debug-win32*
41
42If the Windows version of Vim crashes in a reproducible manner,
43you can take some steps to provide a useful bug report.
44
45First, you must obtain the debugger symbols (PDB) file for your executable:
46gvim.pdb for gvim.exe, or vim.pdb for vim.exe. It should be available
47from the same place that you obtained the executable. Be sure to use
48the PDB that matches the EXE.
49
50If you built the executable yourself with the Microsoft Visual C++ compiler,
51then the PDB was built with the EXE.
52
53You can download the Microsoft Visual C++ Toolkit from
54 http://msdn.microsoft.com/visualc/vctoolkit2003/
55This contains the command-line tools, but not the Visual Studio IDE.
56
57The Debugging Tools for Windows can be downloaded from
58 http://www.microsoft.com/whdc/devtools/debugging/default.mspx
59This includes the WinDbg debugger.
60
61If you have Visual Studio, use that instead of the VC Toolkit
62and WinDbg.
63
64
65(No idea what to do if your binary was built with the Borland or Cygwin
66compilers. Sorry.)
67
68=========================================================================
69 vim:tw=78:ts=8:ft=help:norl: