xref: /vim-8.2.3635/runtime/doc/debugger.txt (revision ade0d394)
15666fcd0SBram Moolenaar*debugger.txt*  For Vim version 8.2.  Last change: 2019 Dec 21
2071d4279SBram Moolenaar
3071d4279SBram Moolenaar
4071d4279SBram Moolenaar		  VIM REFERENCE MANUAL    by Gordon Prieur
5071d4279SBram Moolenaar
6071d4279SBram Moolenaar
7071d4279SBram MoolenaarDebugger Support Features				*debugger-support*
8071d4279SBram Moolenaar
9396e829fSBram MoolenaarThese features are for integration with a debugger or an Integrated
10396e829fSBram MoolenaarProgramming Environment (IPE) or Integrated Development Environment (IDE).
11396e829fSBram MoolenaarFor the debugger running in a Vim terminal window see |terminal-debugger|.
12396e829fSBram Moolenaar
13071d4279SBram Moolenaar1. Debugger Features		|debugger-features|
14071d4279SBram Moolenaar2. Vim Compile Options		|debugger-compilation|
15071d4279SBram Moolenaar
16071d4279SBram Moolenaar==============================================================================
17071d4279SBram Moolenaar1. Debugger Features					*debugger-features*
18071d4279SBram Moolenaar
19396e829fSBram MoolenaarThe following features are available:
20071d4279SBram Moolenaar
21071d4279SBram Moolenaar	Alternate Command Input				|alt-input|
22071d4279SBram Moolenaar	Debug Signs					|debug-signs|
23071d4279SBram Moolenaar	Debug Source Highlight				|debug-highlight|
24071d4279SBram Moolenaar	Message Footer					|gui-footer|
25071d4279SBram Moolenaar	Balloon Evaluation				|balloon-eval|
26071d4279SBram Moolenaar
27071d4279SBram MoolenaarThese features were added specifically for use in the Motif version of gvim.
28071d4279SBram MoolenaarHowever, the |alt-input| and |debug-highlight| were written to be usable in
29071d4279SBram Moolenaarboth vim and gvim.  Some of the other features could be used in the non-GUI
30071d4279SBram Moolenaarvim with slight modifications.  However, I did not do this nor did I test the
31071d4279SBram Moolenaarreliability of building for vim or non Motif GUI versions.
32071d4279SBram Moolenaar
33071d4279SBram Moolenaar
34071d4279SBram Moolenaar1.1 Alternate Command Input				*alt-input*
35071d4279SBram Moolenaar
36071d4279SBram MoolenaarFor Vim to work with a debugger there must be at least an input connection
37071d4279SBram Moolenaarwith a debugger or external tool.  In many cases there will also be an output
38071d4279SBram Moolenaarconnection but this isn't absolutely necessary.
39071d4279SBram Moolenaar
40071d4279SBram MoolenaarThe purpose of the input connection is to let the external debugger send
41071d4279SBram Moolenaarcommands to Vim.  The commands sent by the debugger should give the debugger
42071d4279SBram Moolenaarenough control to display the current debug environment and state.
43071d4279SBram Moolenaar
44071d4279SBram MoolenaarThe current implementation is based on the X Toolkit dispatch loop and the
45071d4279SBram MoolenaarXtAddInput() function call.
46071d4279SBram Moolenaar
47071d4279SBram Moolenaar
48071d4279SBram Moolenaar1.2 Debug Signs						*debug-signs*
49071d4279SBram Moolenaar
50071d4279SBram MoolenaarMany debuggers mark specific lines by placing a small sign or color highlight
51071d4279SBram Moolenaaron the line.  The |:sign| command lets the debugger set this graphic mark.  Some
52071d4279SBram Moolenaarexamples where this feature would be used would be a debugger showing an arrow
53071d4279SBram Moolenaarrepresenting the Program Counter (PC) of the program being debugged.  Another
54071d4279SBram Moolenaarexample would be a small stop sign for a line with a breakpoint.  These visible
55071d4279SBram Moolenaarhighlights let the user keep track of certain parts of the state of the
56071d4279SBram Moolenaardebugger.
57071d4279SBram Moolenaar
58071d4279SBram MoolenaarThis feature can be used with more than debuggers, too.  An IPE can use a sign
59071d4279SBram Moolenaarto highlight build errors, searched text, or other things.  The sign feature
60071d4279SBram Moolenaarcan also work together with the |debug-highlight| to ensure the mark is
61071d4279SBram Moolenaarhighly visible.
62071d4279SBram Moolenaar
63071d4279SBram MoolenaarDebug signs are defined and placed using the |:sign| command.
64071d4279SBram Moolenaar
65071d4279SBram Moolenaar
66071d4279SBram Moolenaar1.3 Debug Source Highlight				*debug-highlight*
67071d4279SBram Moolenaar
68071d4279SBram MoolenaarThis feature allows a line to have a predominant highlight.  The highlight is
69071d4279SBram Moolenaarintended to make a specific line stand out.  The highlight could be made to
70071d4279SBram Moolenaarwork for both vim and gvim, whereas the debug sign is, in most cases, limited
71071d4279SBram Moolenaarto gvim.  The one exception to this is Sun Microsystem's dtterm.  The dtterm
72071d4279SBram Moolenaarfrom Sun has a "sign gutter" for showing signs.
73071d4279SBram Moolenaar
74071d4279SBram Moolenaar
75071d4279SBram Moolenaar1.4 Message Footer					*gui-footer*
76071d4279SBram Moolenaar
77071d4279SBram MoolenaarThe message footer can be used to display messages from a debugger or IPE.  It
78071d4279SBram Moolenaarcan also be used to display menu and toolbar tips.  The footer area is at the
79071d4279SBram Moolenaarbottom of the GUI window, below the line used to display colon commands.
80071d4279SBram Moolenaar
81071d4279SBram MoolenaarThe display of the footer is controlled by the 'guioptions' letter 'F'.
82071d4279SBram Moolenaar
83071d4279SBram Moolenaar
84071d4279SBram Moolenaar1.5 Balloon Evaluation					*balloon-eval*
85071d4279SBram Moolenaar
86071d4279SBram MoolenaarThis feature allows a debugger, or other external tool, to display dynamic
87071d4279SBram Moolenaarinformation based on where the mouse is pointing.  The purpose of this feature
88071d4279SBram Moolenaarwas to allow Sun's Visual WorkShop debugger to display expression evaluations.
89071d4279SBram MoolenaarHowever, the feature was implemented in as general a manner as possible and
9068e6560bSBram Moolenaarcould be used for displaying other information as well.  The functionality is
9168e6560bSBram Moolenaarlimited though, for advanced popups see |popup-window|.
92071d4279SBram Moolenaar
93396e829fSBram MoolenaarAnother way to use the balloon is with the 'balloonexpr' option.  This is
94396e829fSBram Moolenaarcompletely user definable.
95396e829fSBram Moolenaar
9605159a0cSBram MoolenaarThe Balloon Evaluation has some settable parameters too.  For Motif the font
9705159a0cSBram Moolenaarlist and colors can be set via X resources (XmNballoonEvalFontList,
98071d4279SBram MoolenaarXmNballoonEvalBackground, and XmNballoonEvalForeground).
99071d4279SBram MoolenaarThe 'balloondelay' option sets the delay before an attempt is made to show a
100071d4279SBram Moolenaarballoon.
101a2a80162SBram MoolenaarThe 'ballooneval' and/or the 'balloonevalterm' option needs to be set to
102a2a80162SBram Moolenaarswitch it on.
103071d4279SBram Moolenaar
104a2a80162SBram MoolenaarBalloon evaluation is only available in the GUI when compiled with the
105a2a80162SBram Moolenaar|+balloon_eval| feature.  For the terminal the  |+balloon_eval_term| feature
106a2a80162SBram Moolenaarmatters.
107071d4279SBram Moolenaar
108071d4279SBram MoolenaarThe Balloon evaluation functions are also used to show a tooltip for the
109071d4279SBram Moolenaartoolbar.  The 'ballooneval' option does not need to be set for this.  But the
110071d4279SBram Moolenaarother settings apply.
111071d4279SBram Moolenaar
112071d4279SBram Moolenaar==============================================================================
113071d4279SBram Moolenaar2. Vim Compile Options					*debugger-compilation*
114071d4279SBram Moolenaar
1155666fcd0SBram MoolenaarThe debugger features were added for use with Sun's Visual WorkShop Integrated
1165666fcd0SBram MoolenaarProgramming Environment (ipe).  However, they were done in as generic a manner
117*ade0d394SBram Moolenaaras possible so that integration with other debuggers could also use these
1185666fcd0SBram Moolenaarfeatures.
119071d4279SBram Moolenaar
120071d4279SBram MoolenaarThe following compile time preprocessor variables control the features:
121071d4279SBram Moolenaar
122071d4279SBram Moolenaar    Alternate Command Input			ALT_X_INPUT
123071d4279SBram Moolenaar    Debug Glyphs				FEAT_SIGNS
124071d4279SBram Moolenaar    Debug Highlights				FEAT_SIGNS
125071d4279SBram Moolenaar    Message Footer				FEAT_FOOTER
126071d4279SBram Moolenaar    Balloon Evaluation				FEAT_BEVAL
127071d4279SBram Moolenaar
1285666fcd0SBram MoolenaarThe support specifically for Sun Visual WorkShop has been removed, since the
1295666fcd0SBram Moolenaarproduct no longer exists.
130b23c3387SBram Moolenaar
131b23c3387SBram MoolenaarFor Sun NetBeans support see |netbeans|.
132071d4279SBram Moolenaar
1335666fcd0SBram Moolenaar
13491f84f6eSBram Moolenaar vim:tw=78:sw=4:ts=8:noet:ft=help:norl:
135