Re: [Cgdb-devel] Patch: Additional vim-prompt commands/short-cuts.
Brought to you by:
bobbybrasko,
crouchingturbo
From: Gilboa D. <gi...@gm...> - 2008-05-17 03:41:20
|
On Fri, 2008-05-16 at 21:31 -0400, Bob Rossi wrote: > On Thu, May 08, 2008 at 11:13:44AM +0300, Gilboa Davara wrote: > > > > > > Patch 2: Additional vim-prompt commands and shortcuts. > > > > diff -X patch/diff.exclude -ur cgdb/cgdb/src/cgdbrc.c cgdb-new/cgdb/src/cgdbrc.c > > > > --- cgdb/cgdb/src/cgdbrc.c 2008-05-07 09:12:25.000000000 +0300 > > > > +++ cgdb-new/cgdb/src/cgdbrc.c 2008-05-07 10:11:40.000000000 +0300 > > > > @@ -175,7 +175,7 @@ > > > > /* edit */ { "e", command_source_reload, 0 }, > > > > /* focus */ { "focus", command_do_focus, 0 }, > > > > /* help */ { "help", command_do_help, 0 }, > > > > - /* highlight */ { "highlight", command_parse_highlight,0 }, > > > > + /* highlight */ { "highlight", command_parse_highlight,0 }, > > > > /* highlight */ { "hi", command_parse_highlight,0 }, > > > > /* imap */ { "imap", command_parse_map, 0 }, > > > > /* imap */ { "im", command_parse_map, 0 }, > > > > @@ -191,10 +191,18 @@ > > > > /* unmap */ { "unmap", command_parse_unmap, 0 }, > > > > /* unmap */ { "unm", command_parse_unmap, 0 }, > > > > /* continue */ { "continue", command_do_tgdbcommand, TGDB_CONTINUE }, > > > > + /* continue */ { "c", command_do_tgdbcommand, TGDB_CONTINUE }, > > > > /* finish */ { "finish", command_do_tgdbcommand, TGDB_FINISH }, > > > > + /* finish */ { "f", command_do_tgdbcommand, TGDB_FINISH }, > > > > /* next */ { "next", command_do_tgdbcommand, TGDB_NEXT }, > > > > + /* next */ { "n", command_do_tgdbcommand, TGDB_NEXT }, > > > > /* run */ { "run", command_do_tgdbcommand, TGDB_RUN }, > > > > - /* step */ { "step", command_do_tgdbcommand, TGDB_STEP } > > > > + /* run */ { "r", command_do_tgdbcommand, TGDB_RUN }, > > > > + /* kill */ { "kill", command_do_tgdbcommand, TGDB_KILL }, > > > > + /* kill */ { "k", command_do_tgdbcommand, TGDB_KILL }, > > > > + /* step */ { "step", command_do_tgdbcommand, TGDB_STEP }, > > > > + /* step */ { "s", command_do_tgdbcommand, TGDB_STEP }, > > > > + /* start */ { "start", command_do_tgdbcommand, TGDB_START } > > > > > > > > > What do we all think about this? There is a problem where :f and :n > > > actually mean something in vim. So, if we use them for cgdb, > > > we can never implement the underlying vim commands. Does anyone care? > > > > I wonder if this could be use toggle-able. (if any when cgdb gets buffer > > and print support) > > set purevimmode yes/no > > I've been busy. I've decided just to accept all of these changes for > now. I'll deal with this issue at a later point. > > > > diff -X patch/diff.exclude -ur cgdb/tgdb/annotate-two/src/a2-tgdb.c cgdb-new/tgdb/annotate-two/src/a2-tgdb.c > > > > --- cgdb/tgdb/annotate-two/src/a2-tgdb.c 2008-05-07 09:57:20.000000000 +0300 > > > > +++ cgdb-new/tgdb/annotate-two/src/a2-tgdb.c 2008-05-07 09:59:01.000000000 +0300 > > > > @@ -384,9 +384,16 @@ > > > > case TGDB_NEXT: > > > > return "next"; > > > > > > > > + case TGDB_START: > > > > + return "start"; > > > > + > > > > case TGDB_RUN: > > > > return "run"; > > > > > > > > + case TGDB_KILL: > > > > + /* Awful hack around send limitation. Should work never the less :) */ > > > > + return "set confirm no\n kill\n set confirm yes"; > > > > > > Sorry Gilboa, I can't accept this into cgdb. What problem where you > > > trying to work around? > > > > > > > If you issue a 'kill' command, you get a confirmation dialog that cannot > > be disable (within gdb). The same is true for start and run. > > In theory, I can issue the run/start/kill gdb command and then switch to > > the gdb window for the user input. > > However, this created what-looked-to-me-like a horrible layering > > violation. (cgdb shouldn't be forced to understand the inner-workings of > > the tgdb/gdb layer) > > > > A better solution will be to create a tgdb->cgdb callback that's being > > called by tgdb if the lower level requires input. While this, again, > > does present a certain layering problem - it should be less intrusive. > > This is the only part of the patch I can't accept. I can however, > provide you want a 'map' command that could perhaps accomplish the same > functionality. Far better :) IMHO customized mapping always beats static ones hands down. > I'll try to commit this some time early next week. I've > been super busy. Let you know when it goes in. OK, thanks. I'll keep an eye open on cgdb-devel. P.S. any idea when the next minor/major release is planned. I rather not push an svn version as a Fedora/RHEL update. - Gilboa |