Christian Brabandt | b4ddc6c | 2024-01-02 16:51:11 +0100 | [diff] [blame] | 1 | *debugger.txt* For Vim version 9.1. Last change: 2019 Dec 21 |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 2 | |
| 3 | |
| 4 | VIM REFERENCE MANUAL by Gordon Prieur |
| 5 | |
| 6 | |
| 7 | Debugger Support Features *debugger-support* |
| 8 | |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 9 | These features are for integration with a debugger or an Integrated |
| 10 | Programming Environment (IPE) or Integrated Development Environment (IDE). |
| 11 | For the debugger running in a Vim terminal window see |terminal-debugger|. |
| 12 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 13 | 1. Debugger Features |debugger-features| |
| 14 | 2. Vim Compile Options |debugger-compilation| |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 15 | |
| 16 | ============================================================================== |
| 17 | 1. Debugger Features *debugger-features* |
| 18 | |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 19 | The following features are available: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 20 | |
| 21 | Alternate Command Input |alt-input| |
| 22 | Debug Signs |debug-signs| |
| 23 | Debug Source Highlight |debug-highlight| |
| 24 | Message Footer |gui-footer| |
| 25 | Balloon Evaluation |balloon-eval| |
| 26 | |
| 27 | These features were added specifically for use in the Motif version of gvim. |
| 28 | However, the |alt-input| and |debug-highlight| were written to be usable in |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 29 | both vim and gvim. Some of the other features could be used in the non-GUI |
| 30 | vim with slight modifications. However, I did not do this nor did I test the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 31 | reliability of building for vim or non Motif GUI versions. |
| 32 | |
| 33 | |
| 34 | 1.1 Alternate Command Input *alt-input* |
| 35 | |
| 36 | For Vim to work with a debugger there must be at least an input connection |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 37 | with a debugger or external tool. In many cases there will also be an output |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 38 | connection but this isn't absolutely necessary. |
| 39 | |
| 40 | The purpose of the input connection is to let the external debugger send |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 41 | commands to Vim. The commands sent by the debugger should give the debugger |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 42 | enough control to display the current debug environment and state. |
| 43 | |
| 44 | The current implementation is based on the X Toolkit dispatch loop and the |
| 45 | XtAddInput() function call. |
| 46 | |
| 47 | |
| 48 | 1.2 Debug Signs *debug-signs* |
| 49 | |
| 50 | Many debuggers mark specific lines by placing a small sign or color highlight |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 51 | on the line. The |:sign| command lets the debugger set this graphic mark. Some |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 52 | examples where this feature would be used would be a debugger showing an arrow |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 53 | representing the Program Counter (PC) of the program being debugged. Another |
| 54 | example would be a small stop sign for a line with a breakpoint. These visible |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 55 | highlights let the user keep track of certain parts of the state of the |
| 56 | debugger. |
| 57 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 58 | This feature can be used with more than debuggers, too. An IPE can use a sign |
| 59 | to highlight build errors, searched text, or other things. The sign feature |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 60 | can also work together with the |debug-highlight| to ensure the mark is |
| 61 | highly visible. |
| 62 | |
| 63 | Debug signs are defined and placed using the |:sign| command. |
| 64 | |
| 65 | |
| 66 | 1.3 Debug Source Highlight *debug-highlight* |
| 67 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 68 | This feature allows a line to have a predominant highlight. The highlight is |
| 69 | intended to make a specific line stand out. The highlight could be made to |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 70 | work for both vim and gvim, whereas the debug sign is, in most cases, limited |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 71 | to gvim. The one exception to this is Sun Microsystem's dtterm. The dtterm |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 72 | from Sun has a "sign gutter" for showing signs. |
| 73 | |
| 74 | |
| 75 | 1.4 Message Footer *gui-footer* |
| 76 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 77 | The message footer can be used to display messages from a debugger or IPE. It |
| 78 | can also be used to display menu and toolbar tips. The footer area is at the |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 79 | bottom of the GUI window, below the line used to display colon commands. |
| 80 | |
| 81 | The display of the footer is controlled by the 'guioptions' letter 'F'. |
| 82 | |
| 83 | |
| 84 | 1.5 Balloon Evaluation *balloon-eval* |
| 85 | |
| 86 | This feature allows a debugger, or other external tool, to display dynamic |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 87 | information based on where the mouse is pointing. The purpose of this feature |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 88 | was to allow Sun's Visual WorkShop debugger to display expression evaluations. |
| 89 | However, the feature was implemented in as general a manner as possible and |
Bram Moolenaar | 68e6560 | 2019-05-26 21:33:31 +0200 | [diff] [blame] | 90 | could be used for displaying other information as well. The functionality is |
| 91 | limited though, for advanced popups see |popup-window|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 92 | |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 93 | Another way to use the balloon is with the 'balloonexpr' option. This is |
| 94 | completely user definable. |
| 95 | |
Bram Moolenaar | 05159a0 | 2005-02-26 23:04:13 +0000 | [diff] [blame] | 96 | The Balloon Evaluation has some settable parameters too. For Motif the font |
| 97 | list and colors can be set via X resources (XmNballoonEvalFontList, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 98 | XmNballoonEvalBackground, and XmNballoonEvalForeground). |
| 99 | The 'balloondelay' option sets the delay before an attempt is made to show a |
| 100 | balloon. |
Bram Moolenaar | a2a8016 | 2017-11-21 23:09:50 +0100 | [diff] [blame] | 101 | The 'ballooneval' and/or the 'balloonevalterm' option needs to be set to |
| 102 | switch it on. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 103 | |
Bram Moolenaar | a2a8016 | 2017-11-21 23:09:50 +0100 | [diff] [blame] | 104 | Balloon evaluation is only available in the GUI when compiled with the |
| 105 | |+balloon_eval| feature. For the terminal the |+balloon_eval_term| feature |
| 106 | matters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 107 | |
| 108 | The Balloon evaluation functions are also used to show a tooltip for the |
| 109 | toolbar. The 'ballooneval' option does not need to be set for this. But the |
| 110 | other settings apply. |
| 111 | |
| 112 | ============================================================================== |
| 113 | 2. Vim Compile Options *debugger-compilation* |
| 114 | |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 115 | The debugger features were added for use with Sun's Visual WorkShop Integrated |
| 116 | Programming Environment (ipe). However, they were done in as generic a manner |
Bram Moolenaar | ade0d39 | 2020-01-21 22:33:58 +0100 | [diff] [blame] | 117 | as possible so that integration with other debuggers could also use these |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 118 | features. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 119 | |
| 120 | The following compile time preprocessor variables control the features: |
| 121 | |
| 122 | Alternate Command Input ALT_X_INPUT |
| 123 | Debug Glyphs FEAT_SIGNS |
| 124 | Debug Highlights FEAT_SIGNS |
| 125 | Message Footer FEAT_FOOTER |
| 126 | Balloon Evaluation FEAT_BEVAL |
| 127 | |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 128 | The support specifically for Sun Visual WorkShop has been removed, since the |
| 129 | product no longer exists. |
Bram Moolenaar | b23c338 | 2005-01-31 19:09:12 +0000 | [diff] [blame] | 130 | |
| 131 | For Sun NetBeans support see |netbeans|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 132 | |
Bram Moolenaar | 5666fcd | 2019-12-26 14:35:26 +0100 | [diff] [blame] | 133 | |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame] | 134 | vim:tw=78:sw=4:ts=8:noet:ft=help:norl: |