Bram Moolenaar | 9805653 | 2019-12-12 14:18:35 +0100 | [diff] [blame] | 1 | *debugger.txt* For Vim version 8.2. Last change: 2019 Jul 06 |
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| |
| 15 | 3. Integrated Debuggers |debugger-integration| |
| 16 | |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 17 | |
| 18 | ============================================================================== |
| 19 | 1. Debugger Features *debugger-features* |
| 20 | |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 21 | The following features are available: |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 22 | |
| 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 | |
| 29 | These features were added specifically for use in the Motif version of gvim. |
| 30 | 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] | 31 | both vim and gvim. Some of the other features could be used in the non-GUI |
| 32 | 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] | 33 | reliability of building for vim or non Motif GUI versions. |
| 34 | |
| 35 | |
| 36 | 1.1 Alternate Command Input *alt-input* |
| 37 | |
| 38 | 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] | 39 | 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] | 40 | connection but this isn't absolutely necessary. |
| 41 | |
| 42 | 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] | 43 | 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] | 44 | enough control to display the current debug environment and state. |
| 45 | |
| 46 | The current implementation is based on the X Toolkit dispatch loop and the |
| 47 | XtAddInput() function call. |
| 48 | |
| 49 | |
| 50 | 1.2 Debug Signs *debug-signs* |
| 51 | |
| 52 | 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] | 53 | 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] | 54 | 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] | 55 | representing the Program Counter (PC) of the program being debugged. Another |
| 56 | 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] | 57 | highlights let the user keep track of certain parts of the state of the |
| 58 | debugger. |
| 59 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 60 | This feature can be used with more than debuggers, too. An IPE can use a sign |
| 61 | to highlight build errors, searched text, or other things. The sign feature |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 62 | can also work together with the |debug-highlight| to ensure the mark is |
| 63 | highly visible. |
| 64 | |
| 65 | Debug signs are defined and placed using the |:sign| command. |
| 66 | |
| 67 | |
| 68 | 1.3 Debug Source Highlight *debug-highlight* |
| 69 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 70 | This feature allows a line to have a predominant highlight. The highlight is |
| 71 | 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] | 72 | 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] | 73 | 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] | 74 | from Sun has a "sign gutter" for showing signs. |
| 75 | |
| 76 | |
| 77 | 1.4 Message Footer *gui-footer* |
| 78 | |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 79 | The message footer can be used to display messages from a debugger or IPE. It |
| 80 | 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] | 81 | bottom of the GUI window, below the line used to display colon commands. |
| 82 | |
| 83 | The display of the footer is controlled by the 'guioptions' letter 'F'. |
| 84 | |
| 85 | |
| 86 | 1.5 Balloon Evaluation *balloon-eval* |
| 87 | |
| 88 | This feature allows a debugger, or other external tool, to display dynamic |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 89 | 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] | 90 | was to allow Sun's Visual WorkShop debugger to display expression evaluations. |
| 91 | 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] | 92 | could be used for displaying other information as well. The functionality is |
| 93 | limited though, for advanced popups see |popup-window|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 94 | |
Bram Moolenaar | 396e829 | 2019-07-13 23:04:31 +0200 | [diff] [blame] | 95 | Another way to use the balloon is with the 'balloonexpr' option. This is |
| 96 | completely user definable. |
| 97 | |
Bram Moolenaar | 05159a0 | 2005-02-26 23:04:13 +0000 | [diff] [blame] | 98 | The Balloon Evaluation has some settable parameters too. For Motif the font |
| 99 | list and colors can be set via X resources (XmNballoonEvalFontList, |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 100 | XmNballoonEvalBackground, and XmNballoonEvalForeground). |
| 101 | The 'balloondelay' option sets the delay before an attempt is made to show a |
| 102 | balloon. |
Bram Moolenaar | a2a8016 | 2017-11-21 23:09:50 +0100 | [diff] [blame] | 103 | The 'ballooneval' and/or the 'balloonevalterm' option needs to be set to |
| 104 | switch it on. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 105 | |
Bram Moolenaar | a2a8016 | 2017-11-21 23:09:50 +0100 | [diff] [blame] | 106 | Balloon evaluation is only available in the GUI when compiled with the |
| 107 | |+balloon_eval| feature. For the terminal the |+balloon_eval_term| feature |
| 108 | matters. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 109 | |
| 110 | The Balloon evaluation functions are also used to show a tooltip for the |
| 111 | toolbar. The 'ballooneval' option does not need to be set for this. But the |
| 112 | other settings apply. |
| 113 | |
| 114 | ============================================================================== |
| 115 | 2. Vim Compile Options *debugger-compilation* |
| 116 | |
| 117 | The debugger features were added explicitly for use with Sun's Visual |
Bram Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 118 | WorkShop Integrated Programming Environment (ipe). However, they were done |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 119 | in as generic a manner as possible so that integration with other debuggers |
| 120 | could also use some or all of the tools used with Sun's ipe. |
| 121 | |
| 122 | The 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 Moolenaar | 402d2fe | 2005-04-15 21:00:38 +0000 | [diff] [blame] | 130 | The first integration with a full IPE/IDE was with Sun Visual WorkShop. To |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 131 | compile a gvim which interfaces with VWS set the following flag, which sets |
| 132 | all the above flags: |
| 133 | |
| 134 | Sun Visual WorkShop FEAT_SUN_WORKSHOP |
| 135 | |
| 136 | ============================================================================== |
| 137 | 3. Integrated Debuggers *debugger-integration* |
| 138 | |
Bram Moolenaar | b23c338 | 2005-01-31 19:09:12 +0000 | [diff] [blame] | 139 | One fully integrated debugger/IPE/IDE is Sun's Visual WorkShop Integrated |
| 140 | Programming Environment. |
| 141 | |
| 142 | For Sun NetBeans support see |netbeans|. |
Bram Moolenaar | 071d427 | 2004-06-13 20:20:40 +0000 | [diff] [blame] | 143 | |
Bram Moolenaar | 91f84f6 | 2018-07-29 15:07:52 +0200 | [diff] [blame] | 144 | vim:tw=78:sw=4:ts=8:noet:ft=help:norl: |