[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[suggestion] gdb interfacing with any-editor via GNU screen
From: |
Stephane CHAZELAS |
Subject: |
[suggestion] gdb interfacing with any-editor via GNU screen |
Date: |
Sun, 23 Mar 2003 14:48:09 +0100 |
User-agent: |
Mutt/1.3.14i |
This is not a bug report.
I didn't find any better address to send this.
Being a vi user, I've long tried to interface it with GDB. I had
written once a kind of wrapper that opened two pseudo-ttys,
catched the \032\032 sequences sent by "gdb -f" and turned them
into ":e +line filename" sent to vi.
I recently noticed I could use GNU screen to do this.
screen provides a special control sequence which allows to run
arbitrary screen commands based on output from a command.
>From "info -f screen -n 'Control Sequences'":
I| ESC ] 83 ; cmd ^G (A) Execute screen command. This only works if
I| multi-user support is compiled into screen.
I| The pseudo-user ":window:" is used to check
I| the access control list. Use "addacl :window:
I| -rwx #?" to create a user with no rights and
I| allow only the needed commands.
My idea was then, that gdb could send something like "\e]83;<a
screen command to have vi open the right file at the right
line>\a" instead of sending
"\032\032filename:line:char:mid:addr\n".
That's my suggestion: add a new -F/--annotation-format option to
GDB with one required argument only used when the
annotation_level is 1 (-f option). The default would be:
"\032\032%f:%l:%c:%m:%a\n".
Attached, you'll find a quick patch on GDB 5.3, with my
suggestion implemented. (%f, %l, %c, %m, %a are replaced by
filename, line#, char#, middle/beg, address in the annotation
format).
vim-gdb-screen is a GNU bash script that
sets up a screen environment with a splitted screen (vim above,
gdb below) to use this feature. This must be run from within
screen, with two optionnal arguments: the executable to debug
and its source directory.
screenshot.png is a screenshot of an example usage.
Tell me what you think of it and don't hesitate to ask more
details.
Best regards,
Stéphane
screenshot.png
Description: Screen shot VIM+GDB debugging screen-3.9.15
gdb-5.3+annotation-format.diff
Description: unified format diff applied on GDB 5.3
vim-gdb-screen
Description: Example script to use the new feature
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [suggestion] gdb interfacing with any-editor via GNU screen,
Stephane CHAZELAS <=