summaryrefslogtreecommitdiff
path: root/data/vim/patches/8.1.0080
blob: 03dba7e9f33ecd3b4a22057f6b1f9870ff281a92 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
To: vim_dev@googlegroups.com
Subject: Patch 8.1.0080
Fcc: outbox
From: Bram Moolenaar <Bram@moolenaar.net>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
------------

Patch 8.1.0080
Problem:    Can't see the breakpoint number in the terminal debugger.
Solution:   Use the breakpoint number for the sign. (Christian Brabandt)
Files:	    runtime/doc/terminal.txt,
            runtime/pack/dist/opt/termdebug/plugin/termdebug.vim


*** ../vim-8.1.0079/runtime/doc/terminal.txt	2018-06-17 22:19:07.267202961 +0200
--- runtime/doc/terminal.txt	2018-06-19 16:55:43.126412132 +0200
***************
*** 19,26 ****
        Resizing				|terminal-resizing|
        Terminal Modes			|Terminal-mode|
        Cursor style			|terminal-cursor-style|
-       Special keys			|terminal-special-keys|
        Session				|terminal-session|
        Unix				|terminal-unix|
        MS-Windows			|terminal-ms-windows|
  2. Terminal communication	|terminal-communication|
--- 19,26 ----
        Resizing				|terminal-resizing|
        Terminal Modes			|Terminal-mode|
        Cursor style			|terminal-cursor-style|
        Session				|terminal-session|
+       Special keys			|terminal-special-keys|
        Unix				|terminal-unix|
        MS-Windows			|terminal-ms-windows|
  2. Terminal communication	|terminal-communication|
***************
*** 116,124 ****
  
  <							*options-in-terminal*
  After opening the terminal window and setting 'buftype' to "terminal" the
! BufWinEnter autocommand event is triggered.  This makes it possible to set
  options specifically for the window and buffer.  Example: >
!    au BufWinEnter * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
  
  Mouse events (click and drag) are passed to the terminal.  Mouse move events
  are only passed when Vim itself is receiving them.  For a terminal that is
--- 116,127 ----
  
  <							*options-in-terminal*
  After opening the terminal window and setting 'buftype' to "terminal" the
! TerminalOpen autocommand event is triggered.  This makes it possible to set
  options specifically for the window and buffer.  Example: >
!    au TerminalOpen * if &buftype == 'terminal' | setlocal bufhidden=hide | endif
! The <abuf> is set to the terminal buffer, but if there is no window (hidden
! terminal) then setting options will happen in the wrong buffer, therefore the
! check for &buftype in the example.
  
  Mouse events (click and drag) are passed to the terminal.  Mouse move events
  are only passed when Vim itself is receiving them.  For a terminal that is
***************
*** 449,455 ****
  		of the terminal and {argument}, the decoded JSON argument. 
  		The function name must start with "Tapi_" to avoid
  		accidentally calling a function not meant to be used for the
! 		terminal API
  		The user function should sanity check the argument.
  		The function can use |term_sendkeys()| to send back a reply.
  		Example in JSON: >
--- 452,458 ----
  		of the terminal and {argument}, the decoded JSON argument. 
  		The function name must start with "Tapi_" to avoid
  		accidentally calling a function not meant to be used for the
! 		terminal API.
  		The user function should sanity check the argument.
  		The function can use |term_sendkeys()| to send back a reply.
  		Example in JSON: >
***************
*** 702,712 ****
  Vim will start running in the program window. Put focus there and type: >
  	:help gui
  Gdb will run into the ex_help breakpoint.  The source window now shows the 
! ex_cmds.c file.  A ">>" marker will appear where the breakpoint was set.  The
! line where the debugger stopped is highlighted.  You can now step through the
! program.  Let's use the mouse: click on the "Next" button in the window
! toolbar.  You will see the highlighting move as the debugger executes a line
! of source code.
  
  Click "Next" a few times until the for loop is highlighted.  Put the cursor on
  the end of "eap->arg", then click "Eval" in the toolbar.  You will see this
--- 705,715 ----
  Vim will start running in the program window. Put focus there and type: >
  	:help gui
  Gdb will run into the ex_help breakpoint.  The source window now shows the 
! ex_cmds.c file.  A red "1 " marker will appear in the signcolumn where the
! breakpoint was set.  The line where the debugger stopped is highlighted.  You
! can now step through the program.  Let's use the mouse: click on the "Next"
! button in the window toolbar.  You will see the highlighting move as the
! debugger executes a line of source code.
  
  Click "Next" a few times until the for loop is highlighted.  Put the cursor on
  the end of "eap->arg", then click "Eval" in the toolbar.  You will see this
***************
*** 785,790 ****
--- 788,800 ----
  happens if the buffer in the source code window has been modified and can't be
  abandoned.
  
+ Gdb gives each breakpoint a number.  In Vim the number shows up in the sign
+ column, with a red background.  You can use these gdb commands:
+ - info break	list breakpoints
+ - delete N	delete breakpoint N
+ You can also use the `:Clear` command if the cursor is in the line with the
+ breakpoint, or use the "Clear breakpoint" right-click menu entry.
+ 
  
  Inspecting variables ~
  					*termdebug-variables* *:Evaluate*
***************
*** 828,833 ****
--- 838,850 ----
  gdb.  The buffer name is "gdb communication".  Do not delete this buffer, it
  will break the debugger.
  
+ Gdb has some weird behavior, the plugin does its best to work around that.
+ For example, after typing "continue" in the gdb window a CTRL-C can be used to
+ interrupt the running program.  But after using the MI command
+ "-exec-continue"  pressing CTRL-C does not interrupt.  Therefore you will see
+ "continue" being used for the `:Continue` command, instead of using the
+ communication channel.
+ 
  
  Customizing ~
  
***************
*** 885,891 ****
    let g:termdebug_wide = 163
  This will set &columns to 163 when :Termdebug is used.  The value is restored
  when quitting the debugger.
! If g:termdebug_wide is set and &Columns is already  larger than
  g:termdebug_wide then a vertical split will be used without changing &columns.
  Set it to 1 to get a vertical split without every changing &columns (useful
  for when the terminal can't be resized by Vim).
--- 902,908 ----
    let g:termdebug_wide = 163
  This will set &columns to 163 when :Termdebug is used.  The value is restored
  when quitting the debugger.
! If g:termdebug_wide is set and &columns is already larger than
  g:termdebug_wide then a vertical split will be used without changing &columns.
  Set it to 1 to get a vertical split without every changing &columns (useful
  for when the terminal can't be resized by Vim).
*** ../vim-8.1.0079/runtime/pack/dist/opt/termdebug/plugin/termdebug.vim	2018-06-17 21:34:08.277873656 +0200
--- runtime/pack/dist/opt/termdebug/plugin/termdebug.vim	2018-06-19 16:59:18.185759005 +0200
***************
*** 67,73 ****
  endif
  
  let s:pc_id = 12
! let s:break_id = 13
  let s:stopped = 1
  
  if &background == 'light'
--- 67,73 ----
  endif
  
  let s:pc_id = 12
! let s:break_id = 13  " breakpoint number is added to this
  let s:stopped = 1
  
  if &background == 'light'
***************
*** 325,334 ****
    " There can be only one.
    sign define debugPC linehl=debugPC
  
-   " Sign used to indicate a breakpoint.
-   " Can be used multiple times.
-   sign define debugBreakpoint text=>> texthl=debugBreakpoint
- 
    " Install debugger commands in the text window.
    call win_gotoid(s:sourcewin)
    call s:InstallCommands()
--- 325,330 ----
***************
*** 345,350 ****
--- 341,347 ----
      endif
    endif
  
+   " Contains breakpoints that have been placed, key is the number.
    let s:breakpoints = {}
  
    augroup TermDebug
***************
*** 813,818 ****
--- 810,825 ----
    call win_gotoid(wid)
  endfunc
  
+ func s:CreateBreakpoint(nr)
+   if !exists("s:BreakpointSigns")
+     let s:BreakpointSigns = []
+   endif
+   if index(s:BreakpointSigns, a:nr) == -1
+     call add(s:BreakpointSigns, a:nr)
+     exe "sign define debugBreakpoint". a:nr . " text=" . a:nr . " texthl=debugBreakpoint"
+   endif
+ endfunc
+ 
  " Handle setting a breakpoint
  " Will update the sign that shows the breakpoint
  func s:HandleNewBreakpoint(msg)
***************
*** 820,825 ****
--- 827,833 ----
    if nr == 0
      return
    endif
+   call s:CreateBreakpoint(nr)
  
    if has_key(s:breakpoints, nr)
      let entry = s:breakpoints[nr]
***************
*** 839,845 ****
  endfunc
  
  func s:PlaceSign(nr, entry)
!   exe 'sign place ' . (s:break_id + a:nr) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint file=' . a:entry['fname']
    let a:entry['placed'] = 1
  endfunc
  
--- 847,853 ----
  endfunc
  
  func s:PlaceSign(nr, entry)
!   exe 'sign place ' . (s:break_id + a:nr) . ' line=' . a:entry['lnum'] . ' name=debugBreakpoint' . a:nr . ' file=' . a:entry['fname']
    let a:entry['placed'] = 1
  endfunc
  
*** ../vim-8.1.0079/src/version.c	2018-06-19 14:45:33.583620880 +0200
--- src/version.c	2018-06-19 16:57:00.654200256 +0200
***************
*** 763,764 ****
--- 763,766 ----
  {   /* Add new patch number below this line */
+ /**/
+     80,
  /**/

-- 
hundred-and-one symptoms of being an internet addict:
90. Instead of calling you to dinner, your spouse sends e-mail.

 /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\  an exciting new programming language -- http://www.Zimbu.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///