Skip to content

Commit c387c36

Browse files
andreaslynvim-scripts
authored andcommitted
Version 0.4
* Bug fixes * New keyboard mappings
1 parent 8366430 commit c387c36

File tree

6 files changed

+66
-18
lines changed

6 files changed

+66
-18
lines changed

autoload/conque_gdb.vim

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -392,17 +392,17 @@ function! conque_gdb#open(...)
392392
return
393393
endif
394394

395-
if g:conque_gdb_gdb_py_support
396-
let l:extra = ' '
395+
"if g:conque_gdb_gdb_py_support
396+
" let l:extra = ' '
397+
"else
398+
" Find out which gdb command script gdb should execute on startup.
399+
sil let l:enable_confirm = system(s:gdb_command . ' -q -batch -ex "show confirm"')
400+
if l:enable_confirm =~ '.*\s\+[Oo][Nn]\W.*'
401+
let l:extra = ' -x ' . s:SCRIPT_DIR . 'gdbinit_confirm.gdb '
397402
else
398-
" Find out which gdb command script gdb should execute on startup.
399-
sil let l:enable_confirm = system(s:gdb_command . ' -q -batch -ex "show confirm"')
400-
if l:enable_confirm =~ '.*\s\+[Oo][Nn]\W.*'
401-
let l:extra = ' -x ' . s:SCRIPT_DIR . 'nopyc.gdb '
402-
else
403-
let l:extra = ' -x ' . s:SCRIPT_DIR . 'nopync.gdb '
404-
endif
403+
let l:extra = ' -x ' . s:SCRIPT_DIR . 'gdbinit_no_confirm.gdb '
405404
endif
405+
"endif
406406

407407
" Don't let user use the TUI feature. It does not work with ConqueGdb.
408408
let l:user_args = get(a:000, 0, '')

autoload/conque_gdb/conque_gdb.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,12 @@
99
# Marks a prompt has started and stopped
1010
GDB_PROMPT_MARK = '\x1a\x18'
1111

12-
GDB_BREAK_REGEX = re.compile(GDB_BREAK_MARK)
12+
GDB_BREAK_REGEX = re.compile('.*' + GDB_BREAK_MARK + '.*')
1313

14-
GDB_EXIT_REGEX = re.compile(GDB_EXIT_MARK)
14+
GDB_EXIT_REGEX = re.compile('.*' + GDB_EXIT_MARK + '.*')
1515

1616
GDB_PROMPT_REGEX = re.compile('.*' + GDB_PROMPT_MARK + '.*')
1717

18-
#GET_BPS_REGEX = re.compile('(bkpt\s*?\=\s*?\{.*?(?:["].*?["])+?\s*?\}.*?)', re.I)
1918
GET_BPS_REGEX = re.compile('(bkpt\s*?\=\s*?\{.*?(?:["].*?["])+?\s*?\}(?!\s*?,\s*?\{).*?)', re.I)
2019

2120
GET_ATTR_STR = '\s*?\=\s*?["](.*?)["].*?'
@@ -118,10 +117,10 @@ def plain_text(self, input):
118117
self.append_breakpoint(input)
119118
elif GDB_BREAK_REGEX.match(input):
120119
self.begin_breakpoint()
121-
self.plain_text(input.replace(GDB_BREAK_MARK, ''))
120+
self.plain_text(input.split(GDB_BREAK_MARK, 1)[1])
122121
elif GDB_EXIT_REGEX.match(input):
123122
self.handle_inferior_exit()
124-
self.plain_text(input.replace(GDB_EXIT_MARK, ''))
123+
self.plain_text(input.split(GDB_EXIT_MARK, 1)[1])
125124
elif GDB_PROMPT_REGEX.match(input):
126125
sp = input.split(GDB_PROMPT_MARK)
127126
if sp[0] != '':

autoload/conque_gdb/nopyc.gdb renamed to autoload/conque_gdb/gdbinit_confirm.gdb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ set confirm off
22

33
set prompt (gdb)
44
define set prompt
5-
echo set prompt is not supported with ConqueGdb when GDB doesn't have python support\n
5+
echo set prompt is not supported by ConqueGdb\n
66
end
77

88
define set annotate
@@ -17,4 +17,8 @@ define tui
1717
echo tui command is not supported by ConqueGdb\n
1818
end
1919

20+
define refresh
21+
echo refresh command is not supported by ConqueGdb\n
22+
end
23+
2024
set confirm on

autoload/conque_gdb/nopync.gdb renamed to autoload/conque_gdb/gdbinit_no_confirm.gdb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
set prompt (gdb)
22
define set prompt
3-
echo set prompt is not supported with ConqueGdb when GDB doesn't have python support\n
3+
echo set prompt is not supported by ConqueGdb\n
44
end
55

66
define set annotate
@@ -14,3 +14,7 @@ end
1414
define tui
1515
echo tui command is not supported by ConqueGdb\n
1616
end
17+
18+
define refresh
19+
echo refresh command is not supported by ConqueGdb\n
20+
end

doc/conque_gdb.txt

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Contents
5151
3.5.7 Toggle break point mapping |conque-gdb-toggle-mapping|
5252
3.5.8 Set break point mapping |conque-gdb-break-mapping|
5353
3.5.9 Delete break point mapping |conque-gdb-delete-break-mapping|
54+
3.5.10 Finish mapping |conque-gdb-finish-mapping|
55+
3.5.11 Backtrace mapping |conque-gdb-backtrace-mapping|
56+
4. Custom key mappings |conque-gdb-custom-key-mappings|
5457

5558
==============================================================================
5659

@@ -212,9 +215,9 @@ keyboard mappings described below. You can specify this to anything you want,
212215
however you can freely modify any of the keyboard mapping regardless of the
213216
value of |g:ConqueGdb_Leader|. By default it is:
214217
>
215-
let g:ConqueGdb_Leader = '<leader>'
218+
let g:ConqueGdb_Leader = '<Leader>'
216219
>
217-
Note that |<leader>| is usually defined as \ (backslash).
220+
Note that |<Leader>| is usually defined as \ (backslash).
218221

219222
3.4.2 Run program mapping *conque-gdb-run-mapping*
220223
*g:ConqueGdb_Run*
@@ -289,6 +292,36 @@ line. Default:
289292
>
290293
let g:ConqueGdb_DeleteBreak = g:ConqueGdb_Leader . 'd'
291294
>
295+
3.5.10 Finish mapping *conque-gdb-finish-mapping*
296+
*g:ConqueGdb_Finish*
297+
298+
Mapping to issue the finish command. Default:
299+
>
300+
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'f'
301+
>
302+
3.5.11 Backtrace mapping *conque-gdb-backtrace-mapping*
303+
*g:ConqueGdb_Backtrace*
304+
305+
Mapping to execute the backtrace command. By default it is:
306+
>
307+
let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
308+
>
309+
4. Custom key mappings *conque-gdb-custom-key-mappings*
310+
311+
This section shows you how you can use |ConqueGdbCommand| to setup your
312+
own customized Conque GDB key mappings.
313+
314+
You might want to be able answer GDB confirmations (say y or n) without
315+
having to go to the Conque GDB window. You can use the |ConqueGdbCommand|
316+
command to achieve this:
317+
>
318+
nnoremap <silent> <Leader>Y :ConqueGdbCommand y<CR>
319+
nnoremap <silent> <Leader>N :ConqueGdbCommand n<CR>
320+
>
321+
With those 2 lines in your vimrc file you can type the leader key followed
322+
by a capital Y to answer yes to GDB confirmations and leader followed by
323+
capital N to answer no to GDB confirmations.
324+
292325
==============================================================================
293326

294327
vim:tw=78:ts=8:ft=help:norl:

plugin/conque_gdb.vim

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,12 @@ endif
6666
if !exists('g:ConqueGdb_Print')
6767
let g:ConqueGdb_Print = g:ConqueGdb_Leader . 'p'
6868
endif
69+
if !exists('g:ConqueGdb_Finish')
70+
let g:ConqueGdb_Finish = g:ConqueGdb_Leader . 'f'
71+
endif
72+
if !exists('g:ConqueGdb_Backtrace')
73+
let g:ConqueGdb_Backtrace = g:ConqueGdb_Leader . 't'
74+
endif
6975

7076
" Commands to open conque gdb
7177
command! -nargs=* -complete=file ConqueGdb call conque_gdb#open(<q-args>, [
@@ -98,4 +104,6 @@ exe 'nnoremap <silent> ' . g:ConqueGdb_Continue . ' :call conque_gdb#command("co
98104
exe 'nnoremap <silent> ' . g:ConqueGdb_Run . ' :call conque_gdb#command("run")<CR>'
99105
exe 'nnoremap <silent> ' . g:ConqueGdb_Next . ' :call conque_gdb#command("next")<CR>'
100106
exe 'nnoremap <silent> ' . g:ConqueGdb_Step . ' :call conque_gdb#command("step")<CR>'
107+
exe 'nnoremap <silent> ' . g:ConqueGdb_Finish . ' :call conque_gdb#command("finish")<CR>'
108+
exe 'nnoremap <silent> ' . g:ConqueGdb_Backtrace . ' :call conque_gdb#command("backtrace")<CR>'
101109
exe 'nnoremap <silent> ' . g:ConqueGdb_Print . ' :call conque_gdb#print_word(expand("<cword>"))<CR>'

0 commit comments

Comments
 (0)