blob: ebaa946eb2df1510d377c0069085f527a683ea69 [file] [log] [blame]
Bram Moolenaar98056532019-12-12 14:18:35 +01001*debugger.txt* For Vim version 8.2. Last change: 2019 Jul 06
Bram Moolenaar071d4272004-06-13 20:20:40 +00002
3
4 VIM REFERENCE MANUAL by Gordon Prieur
5
6
7Debugger Support Features *debugger-support*
8
Bram Moolenaar396e8292019-07-13 23:04:31 +02009These features are for integration with a debugger or an Integrated
10Programming Environment (IPE) or Integrated Development Environment (IDE).
11For the debugger running in a Vim terminal window see |terminal-debugger|.
12
Bram Moolenaar071d4272004-06-13 20:20:40 +0000131. Debugger Features |debugger-features|
142. Vim Compile Options |debugger-compilation|
153. Integrated Debuggers |debugger-integration|
16
Bram Moolenaar071d4272004-06-13 20:20:40 +000017
18==============================================================================
191. Debugger Features *debugger-features*
20
Bram Moolenaar396e8292019-07-13 23:04:31 +020021The following features are available:
Bram Moolenaar071d4272004-06-13 20:20:40 +000022
23 Alternate Command Input |alt-input|
24 Debug Signs |debug-signs|
25 Debug Source Highlight |debug-highlight|
26 Message Footer |gui-footer|
27 Balloon Evaluation |balloon-eval|
28
29These features were added specifically for use in the Motif version of gvim.
30However, the |alt-input| and |debug-highlight| were written to be usable in
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000031both vim and gvim. Some of the other features could be used in the non-GUI
32vim with slight modifications. However, I did not do this nor did I test the
Bram Moolenaar071d4272004-06-13 20:20:40 +000033reliability of building for vim or non Motif GUI versions.
34
35
361.1 Alternate Command Input *alt-input*
37
38For Vim to work with a debugger there must be at least an input connection
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000039with a debugger or external tool. In many cases there will also be an output
Bram Moolenaar071d4272004-06-13 20:20:40 +000040connection but this isn't absolutely necessary.
41
42The purpose of the input connection is to let the external debugger send
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000043commands to Vim. The commands sent by the debugger should give the debugger
Bram Moolenaar071d4272004-06-13 20:20:40 +000044enough control to display the current debug environment and state.
45
46The current implementation is based on the X Toolkit dispatch loop and the
47XtAddInput() function call.
48
49
501.2 Debug Signs *debug-signs*
51
52Many debuggers mark specific lines by placing a small sign or color highlight
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000053on the line. The |:sign| command lets the debugger set this graphic mark. Some
Bram Moolenaar071d4272004-06-13 20:20:40 +000054examples where this feature would be used would be a debugger showing an arrow
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000055representing the Program Counter (PC) of the program being debugged. Another
56example would be a small stop sign for a line with a breakpoint. These visible
Bram Moolenaar071d4272004-06-13 20:20:40 +000057highlights let the user keep track of certain parts of the state of the
58debugger.
59
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000060This feature can be used with more than debuggers, too. An IPE can use a sign
61to highlight build errors, searched text, or other things. The sign feature
Bram Moolenaar071d4272004-06-13 20:20:40 +000062can also work together with the |debug-highlight| to ensure the mark is
63highly visible.
64
65Debug signs are defined and placed using the |:sign| command.
66
67
681.3 Debug Source Highlight *debug-highlight*
69
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000070This feature allows a line to have a predominant highlight. The highlight is
71intended to make a specific line stand out. The highlight could be made to
Bram Moolenaar071d4272004-06-13 20:20:40 +000072work for both vim and gvim, whereas the debug sign is, in most cases, limited
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000073to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm
Bram Moolenaar071d4272004-06-13 20:20:40 +000074from Sun has a "sign gutter" for showing signs.
75
76
771.4 Message Footer *gui-footer*
78
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000079The message footer can be used to display messages from a debugger or IPE. It
80can also be used to display menu and toolbar tips. The footer area is at the
Bram Moolenaar071d4272004-06-13 20:20:40 +000081bottom of the GUI window, below the line used to display colon commands.
82
83The display of the footer is controlled by the 'guioptions' letter 'F'.
84
85
861.5 Balloon Evaluation *balloon-eval*
87
88This feature allows a debugger, or other external tool, to display dynamic
Bram Moolenaar402d2fe2005-04-15 21:00:38 +000089information based on where the mouse is pointing. The purpose of this feature
Bram Moolenaar071d4272004-06-13 20:20:40 +000090was to allow Sun's Visual WorkShop debugger to display expression evaluations.
91However, the feature was implemented in as general a manner as possible and
Bram Moolenaar68e65602019-05-26 21:33:31 +020092could be used for displaying other information as well. The functionality is
93limited though, for advanced popups see |popup-window|.
Bram Moolenaar071d4272004-06-13 20:20:40 +000094
Bram Moolenaar396e8292019-07-13 23:04:31 +020095Another way to use the balloon is with the 'balloonexpr' option. This is
96completely user definable.
97
Bram Moolenaar05159a02005-02-26 23:04:13 +000098The Balloon Evaluation has some settable parameters too. For Motif the font
99list and colors can be set via X resources (XmNballoonEvalFontList,
Bram Moolenaar071d4272004-06-13 20:20:40 +0000100XmNballoonEvalBackground, and XmNballoonEvalForeground).
101The 'balloondelay' option sets the delay before an attempt is made to show a
102balloon.
Bram Moolenaara2a80162017-11-21 23:09:50 +0100103The 'ballooneval' and/or the 'balloonevalterm' option needs to be set to
104switch it on.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000105
Bram Moolenaara2a80162017-11-21 23:09:50 +0100106Balloon evaluation is only available in the GUI when compiled with the
107|+balloon_eval| feature. For the terminal the |+balloon_eval_term| feature
108matters.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000109
110The Balloon evaluation functions are also used to show a tooltip for the
111toolbar. The 'ballooneval' option does not need to be set for this. But the
112other settings apply.
113
114==============================================================================
1152. Vim Compile Options *debugger-compilation*
116
117The debugger features were added explicitly for use with Sun's Visual
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000118WorkShop Integrated Programming Environment (ipe). However, they were done
Bram Moolenaar071d4272004-06-13 20:20:40 +0000119in as generic a manner as possible so that integration with other debuggers
120could also use some or all of the tools used with Sun's ipe.
121
122The following compile time preprocessor variables control the features:
123
124 Alternate Command Input ALT_X_INPUT
125 Debug Glyphs FEAT_SIGNS
126 Debug Highlights FEAT_SIGNS
127 Message Footer FEAT_FOOTER
128 Balloon Evaluation FEAT_BEVAL
129
Bram Moolenaar402d2fe2005-04-15 21:00:38 +0000130The first integration with a full IPE/IDE was with Sun Visual WorkShop. To
Bram Moolenaar071d4272004-06-13 20:20:40 +0000131compile a gvim which interfaces with VWS set the following flag, which sets
132all the above flags:
133
134 Sun Visual WorkShop FEAT_SUN_WORKSHOP
135
136==============================================================================
1373. Integrated Debuggers *debugger-integration*
138
Bram Moolenaarb23c3382005-01-31 19:09:12 +0000139One fully integrated debugger/IPE/IDE is Sun's Visual WorkShop Integrated
140Programming Environment.
141
142For Sun NetBeans support see |netbeans|.
Bram Moolenaar071d4272004-06-13 20:20:40 +0000143
Bram Moolenaar91f84f62018-07-29 15:07:52 +0200144 vim:tw=78:sw=4:ts=8:noet:ft=help:norl: