Thread: [Cgdb-users] key bindings
Brought to you by:
bobbybrasko,
crouchingturbo
From: James L. <le...@al...> - 2004-08-17 00:05:36
|
Hi, I used cgdb almost everyday at work to do debugging whenever I need to debug on linux machines. Having used it often, I find some things that perhaps you might want to consider, namely key-bindings. 1. The keys were supposed to vi-like, but it uses <esc> to switch between source, io and debug windows. But <esc> in vi changes from insert mode to command mode, which is very confusing to me sometimes. I find myself unconsciously hitting the <esc> key often! Another problem also arises when I tried to use arrow keys to move up and down the output/debug window. Since those keys also send out escape sequences, I often find the cursor jumping to the source window instead of paging, and I cannot page. This is quite limiting for me since I often have tons of output to look through. vim uses ctrl-w j or k to move up or down, which is ok (but more keystrokes) 2. I can't seem to get vi mode in readline in cgdb. Is it allowed? It works in plain gdb. thanks a lot. James. |
From: William P. <bil...@gm...> - 2007-08-05 07:10:05
|
I just started using cgdb a few weeks ago, and I'm loving it. This is a great tool. Thanks! I'm having a problem that seems related to the discussion in the archive around Aug '04 with the thread subject "key bindings". When in GDB mode and with readline in vi-mode, I can do: '<esc>kkAfoo' to append the text 'foo' to the command executed 2 instances back in the history, but I can't edit the line beyond that. Ie, if I try to replace 'foo' with 'bar', I would normally do: '<esc>FfRbar', but the esc there is being grabbed by cgdb and sending me into the source window. Is there a workaround for this? |
From: Bob R. <bob...@co...> - 2007-08-06 13:03:34
|
On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > > > I just started using cgdb a few weeks ago, and I'm loving it. This > is a great tool. Thanks! > > I'm having a problem that seems related to the discussion in the > archive around Aug '04 with the thread subject "key bindings". Hi William, There currently isn't a workaround that I know of. However, I would love to see this issue fixed. I don't use readline in vi mode, so I have never run into this problem. For starters, how do you put readline in vi mode when using cgdb? Do you have to put something in your .inputrc? If so, what do you put in there? > When in GDB mode and with readline in vi-mode, I can do: > '<esc>kkAfoo' to append the text 'foo' to the command > executed 2 instances back in the history, but I can't OK, I'm confused as to why this works for you, I would like to reproduce it. After you type '<esc>kkAfoo', you are still in GDB mode? I would except that you would be put into the source window. > edit the line beyond that. Ie, if I try to replace > 'foo' with 'bar', I would normally do: '<esc>FfRbar', > but the esc there is being grabbed by cgdb and sending > me into the source window. Yes, this currently makes sense to me. > Is there a workaround for this? Not that I know of. However, I think if we can come up with a solution to this problem, it shouldn't be to hard to add to CGDB. Is the issue that sometimes when you hit <Esc> you want to stay in GDB mode and sometimes you want to go to CGDB mode? How would CGDB know the difference? One solution, which wouldn't be super friendly, is to provide a way to send esc to readline by having an escape key. For instance, if you type '<esc><esc>', than that escape goes to gdb. These solutions tend to be a pain on users I think though. Any ideas? Bob Rossi |
From: William P. <bil...@gm...> - 2007-08-07 04:23:44
|
Bob Rossi wrote: > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: >> >> I just started using cgdb a few weeks ago, and I'm loving it. This >> is a great tool. Thanks! >> >> I'm having a problem that seems related to the discussion in the >> archive around Aug '04 with the thread subject "key bindings". > > Hi William, > > There currently isn't a workaround that I know of. However, I would love > to see this issue fixed. I don't use readline in vi mode, so I have > never run into this problem. > > For starters, how do you put readline in vi mode when using cgdb? Do you > have to put something in your .inputrc? If so, what do you put in there? set editing-mode vi I actually set that as the first line in /etc/inputrc on all boxes on which I have root. Well, not quite all, but any box that I "own"...my co-workers hate me for it, but I think it's good for them as they might otherwise never even realize that readline has options. > >> When in GDB mode and with readline in vi-mode, I can do: >> '<esc>kkAfoo' to append the text 'foo' to the command >> executed 2 instances back in the history, but I can't > > OK, I'm confused as to why this works for you, I would like to reproduce > it. After you type '<esc>kkAfoo', you are still in GDB mode? I would > except that you would be put into the source window. Yes, still in gdb mode. I can edit the line as long as I don't go into insert mode. (ie, I can delete characters with 'x' and replace single characters with 'r', but if I use 'i', 'a', or 'R', I can't get back to command mode in readline) > >> edit the line beyond that. Ie, if I try to replace >> 'foo' with 'bar', I would normally do: '<esc>FfRbar', >> but the esc there is being grabbed by cgdb and sending >> me into the source window. > > Yes, this currently makes sense to me. > >> Is there a workaround for this? > > Not that I know of. However, I think if we can come up with a solution > to this problem, it shouldn't be to hard to add to CGDB. Is the issue > that sometimes when you hit <Esc> you want to stay in GDB mode and > sometimes you want to go to CGDB mode? How would CGDB know the > difference? > > One solution, which wouldn't be super friendly, is to provide a way to > send esc to readline by having an escape key. For instance, if you type > '<esc><esc>', than that escape goes to gdb. These solutions tend to be > a pain on users I think though. I agree that it would be a pain. Personally, I would prefer that esc always go to readline, and some other key be used to switch to the cgdb window, but I can't see that being an acceptable solution at all. Perhaps that could simply be made an option with an alternate key-binding as a value. I haven't yet had a chance to read through very much of the cgdb documentation yet, so I'm not going to have much insight into what would be appropriate. |
From: Peter K. <pe...@ko...> - 2007-08-07 11:44:02
|
On Tue, Aug 07, 2007 at 05:32:46AM +0100, William Pursell wrote: > > One solution, which wouldn't be super friendly, is to provide a way to > > send esc to readline by having an escape key. For instance, if you type > > '<esc><esc>', than that escape goes to gdb. These solutions tend to be > > a pain on users I think though. Why not add a new key-code like <gdb-esc> which sends the <esc> directly to gdb instead of cgdb? Its been a while since I looked at the code, but maybe that's a little easier to do, and a little more self-documenting. - Peter |
From: Bob R. <bob...@co...> - 2007-08-07 14:06:15
|
On Tue, Aug 07, 2007 at 07:43:48AM -0400, Peter Kovacs wrote: > On Tue, Aug 07, 2007 at 05:32:46AM +0100, William Pursell wrote: > > > One solution, which wouldn't be super friendly, is to provide a way to > > > send esc to readline by having an escape key. For instance, if you type > > > '<esc><esc>', than that escape goes to gdb. These solutions tend to be > > > a pain on users I think though. > > Why not add a new key-code like <gdb-esc> which sends the <esc> directly > to gdb instead of cgdb? Its been a while since I looked at the code, > but maybe that's a little easier to do, and a little more > self-documenting. OK, here is the summary of our situation. This problem hits deep into the design of cgdb. Currently, libcex hasn't been written yet. libcex is inteded to be a library that allows CGDB to map any set of keys to any CGDB action. This library is still in the design phase, as it might stay for a long time without developer contribution. There are 2 possible designs for this library, one is what I call the 'vi style' design, which hardcodes keys to a particular action. You can't change what keys cause which actions. Thus the library wouldn't support having a vim and an emacs mode style interface. The advantage to this design is that because the keys are specific to a commamd, it's easy to have CGDB do command specific things while the user is actively typing the keys. Think of how vim allows you to type, 'd/foo<Enter>' After you type the /, in the middle of the delete command, it starts searching for foo. Now that's context! With this design, the library will simply be an abstraction of what keys do what action. The user can not modify this. The other design is what I call the 'mutt' design. They essentially allow you to map any set of keys to any command. So, each cgdb command will have a name, and potentially a set of parameters. This allows for the user to customize the front end with multiple feels (vi, emacs). The downside is you loose context during interactive typing, unless you create some sort of very complicated description of the command. Now, I mention all of this because what you are asking for would essentially require a higher level library to allow the user to tune CGDB to understand what command it should do based on what the user typed. With all of this in mind, since it will be a while before this particular feature is available cleanly, it was suggested by Peter, that we make a config option, 'set escape-key key' that will allow us to define what the escape key is. The default would be, 'set escape-key <Esc>'. You could change that to whatever you want. That would allow you to setup CGDB so that a different key would be responsible for you to get in and out of CGDB/GDB mode. Now, after that is implemented, it might just automatically work they way you want. Since, there would be no reason to eat the <Esc> key to go into insert mode, CGDB would just send it to GDB/readline. This is an initial idea, does anyone see any holes in it? Does anyone object? The main issue is that vim doesn't have a 'set escape-key' command. So, once we wrote libcex, we may have to end up dropping the command. Thanks, Bob Rossi |
From: Bob R. <bob...@co...> - 2007-08-07 15:20:33
|
On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > Is there a workaround for this? Try downloading and installing http://brasko.net:81/bob/cgdb-20070807.tar.gz Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any normal key on the keyboard, or a keycode string. For example, <F1> or <PageUp>. Make sure to give us feedback on if this is useful. If so, we'll consider adding it for the next release. Thanks, Bob Rossi |
From: William P. <bil...@gm...> - 2007-08-07 20:15:35
|
Bob Rossi wrote: > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: >> Is there a workaround for this? > > Try downloading and installing > http://brasko.net:81/bob/cgdb-20070807.tar.gz > > Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any > normal key on the keyboard, or a keycode string. For example, <F1> or > <PageUp>. > > Make sure to give us feedback on if this is useful. If so, we'll > consider adding it for the next release. This works to remap the key, but <esc> is now (apparently) ignored and I can't get readline into command mode. I will try to spend some time looking into this, but I'm going on a 3 week trip in about 9 days, so it will be quite some time before I'm able to offer any useful contribution. I'm very pleased by the code layout and look forward to digging in. |
From: Bob R. <bob...@co...> - 2007-08-07 21:14:39
|
On Tue, Aug 07, 2007 at 09:24:41PM +0100, William Pursell wrote: > Bob Rossi wrote: > > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > >> Is there a workaround for this? > > > > Try downloading and installing > > http://brasko.net:81/bob/cgdb-20070807.tar.gz > > > > Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any > > normal key on the keyboard, or a keycode string. For example, <F1> or > > <PageUp>. > > > > Make sure to give us feedback on if this is useful. If so, we'll > > consider adding it for the next release. > > This works to remap the key, but <esc> is now (apparently) ignored > and I can't get readline into command mode. I will try to > spend some time looking into this, but I'm going on a 3 week > trip in about 9 days, so it will be quite some time before I'm > able to offer any useful contribution. I'm very pleased by the code > layout and look forward to digging in. OK, give me a quick test case to try, step by step that doesn't work. For example, start cgdb type i to get into cgdb window type .... I'd like to reproduce that the example doesn't work for me, and then I'll make sure that it does work. Bob Rossi |
From: Bob R. <bob...@co...> - 2007-08-07 21:31:06
|
On Tue, Aug 07, 2007 at 09:24:41PM +0100, William Pursell wrote: > Bob Rossi wrote: > > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > >> Is there a workaround for this? > > > > Try downloading and installing > > http://brasko.net:81/bob/cgdb-20070807.tar.gz > > > > Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any > > normal key on the keyboard, or a keycode string. For example, <F1> or > > <PageUp>. > > > > Make sure to give us feedback on if this is useful. If so, we'll > > consider adding it for the next release. > > This works to remap the key, but <esc> is now (apparently) ignored > and I can't get readline into command mode. Oops, I think I see the problem and I've fixed it. I'm not able to get into and out of command mode in readline, in cgdb. Try this version and let me know. http://brasko.net:81/bob/cgdb-20070807.tar.gz The above is a different version of the code, even though it has the same name. Thanks, Bob Rossi |
From: William P. <bil...@gm...> - 2007-08-11 22:27:13
|
Bob Rossi wrote: > On Tue, Aug 07, 2007 at 05:30:53PM -0400, Bob Rossi wrote: >> On Tue, Aug 07, 2007 at 09:24:41PM +0100, William Pursell wrote: >>> Bob Rossi wrote: >>>> On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: >>>>> Is there a workaround for this? >>>> Try downloading and installing >>>> http://brasko.net:81/bob/cgdb-20070807.tar.gz >>>> >>>> Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any >>>> normal key on the keyboard, or a keycode string. For example, <F1> or >>>> <PageUp>. >>>> >>>> Make sure to give us feedback on if this is useful. If so, we'll >>>> consider adding it for the next release. >>> This works to remap the key, but <esc> is now (apparently) ignored >>> and I can't get readline into command mode. >> Oops, I think I see the problem and I've fixed it. I'm not able to get >> into and out of command mode in readline, in cgdb. Try this version and >> let me know. >> >> http://brasko.net:81/bob/cgdb-20070807.tar.gz >> >> The above is a different version of the code, even though it has the >> same name. > > I've committed these changes allong with the documentation. You should > be able to use CGDB with readline in vi mode now. Sorry for the delay in checking this. Although remapping cgdbmodekey works in this version, there is something wrong. The following key sequence causes cgdb to hang, and I'm having to SIGKILL it: set args foo<esc>bc Many of the readline commands work as expected (I've checked: xhjklAaIifFtTbwBW), but 'c' and 'd' are locking it up; it looks like rl_callback_read_char() is never returning. |
From: Bob R. <bob...@co...> - 2007-08-13 02:56:44
|
On Sat, Aug 11, 2007 at 11:36:25PM +0100, William Pursell wrote: > Bob Rossi wrote: > > On Tue, Aug 07, 2007 at 05:30:53PM -0400, Bob Rossi wrote: > >> On Tue, Aug 07, 2007 at 09:24:41PM +0100, William Pursell wrote: > >>> Bob Rossi wrote: > >>>> On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > >>>>> Is there a workaround for this? > >>>> Try downloading and installing > >>>> http://brasko.net:81/bob/cgdb-20070807.tar.gz > >>>> > >>>> Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any > >>>> normal key on the keyboard, or a keycode string. For example, <F1> or > >>>> <PageUp>. > >>>> > >>>> Make sure to give us feedback on if this is useful. If so, we'll > >>>> consider adding it for the next release. > >>> This works to remap the key, but <esc> is now (apparently) ignored > >>> and I can't get readline into command mode. > >> Oops, I think I see the problem and I've fixed it. I'm not able to get > >> into and out of command mode in readline, in cgdb. Try this version and > >> let me know. > >> > >> http://brasko.net:81/bob/cgdb-20070807.tar.gz > >> > >> The above is a different version of the code, even though it has the > >> same name. > > > > I've committed these changes allong with the documentation. You should > > be able to use CGDB with readline in vi mode now. > > Sorry for the delay in checking this. Although remapping > cgdbmodekey works in this version, there is something wrong. > The following key sequence causes cgdb to hang, and I'm having > to SIGKILL it: > > set args foo<esc>bc > > Many of the readline commands work as expected (I've > checked: xhjklAaIifFtTbwBW), but 'c' and 'd' are locking > it up; it looks like rl_callback_read_char() is never > returning. Aaaa, I see. That's to bad. I'll try to reproduce this behavior, but it seems that readline is probably not honoring the callback interface. I've had this happen before and hat to patch readline, which is why cgdb depends on a fairly recent version of readline. If this is true, I'll have to talk with the readline maintainer about fixing this problem. He's on vacation for another 2 weeks, afaik. If we get a fix, you'll have to build the modified readline with cgdb to verify that it works. If this is the issue, it'll probably be a few months before readline is releaesd, and cgdb works with an official version. In the long run though, it's probably worth it. Bob Rossi |
From: Bob R. <bob...@co...> - 2007-08-23 10:16:29
|
> On Sun, Aug 12, 2007 at 10:56:34PM -0400, Bob Rossi wrote: > > On Sat, Aug 11, 2007 at 11:36:25PM +0100, William Pursell wrote: > > Sorry for the delay in checking this. Although remapping > > cgdbmodekey works in this version, there is something wrong. > > The following key sequence causes cgdb to hang, and I'm having > > to SIGKILL it: > > > > set args foo<esc>bc > > > > Many of the readline commands work as expected (I've > > checked: xhjklAaIifFtTbwBW), but 'c' and 'd' are locking > > it up; it looks like rl_callback_read_char() is never > > returning. > > Aaaa, I see. That's to bad. I'll try to reproduce this behavior, but it > seems that readline is probably not honoring the callback interface. > I've had this happen before and hat to patch readline, which is why > cgdb depends on a fairly recent version of readline. > > If this is true, I'll have to talk with the readline maintainer about > fixing this problem. He's on vacation for another 2 weeks, afaik. If we > get a fix, you'll have to build the modified readline with cgdb to > verify that it works. If this is the issue, it'll probably be a few > months before readline is releaesd, and cgdb works with an official > version. In the long run though, it's probably worth it. Just so you know, I did verify that this was a readline bug. I'm still waiting for a response from the readline maintainer. In the event that you have more time than him, you could always modify readline and send in a patch. Bob Rossi |
From: Bob R. <bob...@co...> - 2007-08-08 14:27:02
|
On Tue, Aug 07, 2007 at 05:30:53PM -0400, Bob Rossi wrote: > On Tue, Aug 07, 2007 at 09:24:41PM +0100, William Pursell wrote: > > Bob Rossi wrote: > > > On Sun, Aug 05, 2007 at 08:19:13AM +0100, William Pursell wrote: > > >> Is there a workaround for this? > > > > > > Try downloading and installing > > > http://brasko.net:81/bob/cgdb-20070807.tar.gz > > > > > > Then in your ~/.cgdb/cgdbrc do 'set cgdbmodekey=key'. Key can be any > > > normal key on the keyboard, or a keycode string. For example, <F1> or > > > <PageUp>. > > > > > > Make sure to give us feedback on if this is useful. If so, we'll > > > consider adding it for the next release. > > > > This works to remap the key, but <esc> is now (apparently) ignored > > and I can't get readline into command mode. > > Oops, I think I see the problem and I've fixed it. I'm not able to get > into and out of command mode in readline, in cgdb. Try this version and > let me know. > > http://brasko.net:81/bob/cgdb-20070807.tar.gz > > The above is a different version of the code, even though it has the > same name. I've committed these changes allong with the documentation. You should be able to use CGDB with readline in vi mode now. Enjoy, Bob Rossi |
From: Mike M. <mmu...@cs...> - 2004-08-17 00:55:55
|
Hi James, Nice to hear from you. I'm glad cgdb has been useful to you. 1. Bob and I are currently working on an overhaul for cgdb.=20 Unfortunately I haven't been able to put a lot of time into it, but that should change soon. The new concept will be much like you described, where window changing is exactly like it is in vim. C-w j and C-w k will work, as well as :split, :vsplit, etc. I'm currently working on the window manager library that will make this possible. Hopefully you can make do with the current version until a beta of this new stuff comes out= . :) 2. That's a good question, I'll check into it! Mike > > Hi, > > I used cgdb almost everyday at work to do debugging > whenever I need to debug on linux machines. Having used > it often, I find some things that perhaps you might want > to consider, namely key-bindings. > > 1. The keys were supposed to vi-like, but it uses <esc> > to switch between source, io and debug windows. But <esc> in > vi changes from insert mode to command mode, which is very > confusing to me sometimes. I find myself unconsciously > hitting the <esc> key often! Another problem also arises when I > tried to use arrow keys to move up and down the output/debug > window. Since those keys also send out escape sequences, > I often find the cursor jumping to the source window instead > of paging, and I cannot page. This is quite limiting for me > since I often have tons of output to look through. > > vim uses ctrl-w j or k to move up or down, which is ok (but > more keystrokes) > > > 2. I can't seem to get vi mode in readline in cgdb. Is it > allowed? It works in plain gdb. > > thanks a lot. > > > James. > > > ------------------------------------------------------- > SF.Net email is sponsored by Shop4tech.com-Lowest price on Blank Media > 100pk Sonic DVD-R 4x for only $29 -100pk Sonic DVD+R for only $33 > Save 50% off Retail on Ink & Toner - Free Shipping and Free Gift. > http://www.shop4tech.com/z/Inkjet_Cartridges/9_108_r285 > _______________________________________________ > Cgdb-users mailing list > Cgd...@li... > https://lists.sourceforge.net/lists/listinfo/cgdb-users > |
From: James L. <le...@al...> - 2004-08-17 21:05:26
|
Hi Mike, > 1. Bob and I are currently working on an overhaul for cgdb. > Unfortunately I haven't been able to put a lot of time into it, but that > should change soon. The new concept will be much like you described, > where window changing is exactly like it is in vim. C-w j and C-w k will > work, as well as :split, :vsplit, etc. I'm currently working on the > window manager library that will make this possible. Hopefully you can > make do with the current version until a beta of this new stuff comes out. > :) That sounds really great! Your replies are so quick. Keep up the good work. James. |
From: Bob R. <bo...@br...> - 2004-08-17 01:20:32
|
> Another problem also arises when I=20 > tried to use arrow keys to move up and down the output/debug > window. Since those keys also send out escape sequences,=20 > I often find the cursor jumping to the source window instead > of paging, and I cannot page. This is quite limiting for me > since I often have tons of output to look through. This seems like a bug. Normally, when I am in the source window or if I am in the GDB window the page up,page down,home,end, and arrow keys all work the way they are supposed to. If you are in the GDB window and you hit an arrow key, does it move in the correct direction, or does it go up into the source window? If it goes up into the source window, please let me know, this is a bug, and hopefully it can be resolved. Finally, I have most of the infrastructure in place to get the 'map' command working. After Mike finishes his window manager, and I finish the new main event loop, 'mapping' commands will work. Hopefully this will simplify your use of CGDB. Thanks, Bob Rossi |
From: James L. <le...@al...> - 2004-08-17 22:52:20
|
Hi Bob, > This seems like a bug. Normally, when I am in the source > window or if I am in the GDB window the page up,page > down,home,end, and arrow keys all work the way they are > supposed to. If you are in the GDB window and you hit an > arrow key, does it move in the correct direction, or does > it go up into the source window? If it goes up into the > source window, please let me know, this is a bug, and > hopefully it can be resolved. The problem I'm talking about happens in the gdb window (i.e., I'm trying to scroll the output). It happens most of the time, and at other times it works correctly (something 70-30 split?). What usually happen is that when I try to use arrow keys in the gdb window, instead of paging up and down, it jumps into the source window. I'm not sure (you guys would know better), but my suspicion is that the escape codes from the arrow keys somehow got interpreted as <esc> key, thus jumping into the source window. TERM is set to xterm. I'm using this with a SUN sparc machine (and SUN keyboard) rsh'ed into linux machines. > Finally, I have most of the infrastructure in place to get > the 'map' command working. After Mike finishes his window > manager, and I finish the new main event loop, 'mapping' > commands will work. Hopefully this will simplify your use > of CGDB. Thanks. I can't wait to use the new features. Thanks for the great work and quick replies. James. |
From: Bob R. <bo...@br...> - 2004-08-18 12:16:24
|
> > This seems like a bug. Normally, when I am in the source > > window or if I am in the GDB window the page up,page > > down,home,end, and arrow keys all work the way they are > > supposed to. If you are in the GDB window and you hit an > > arrow key, does it move in the correct direction, or does > > it go up into the source window? If it goes up into the > > source window, please let me know, this is a bug, and > > hopefully it can be resolved. >=20 > The problem I'm talking about happens in the gdb window > (i.e., I'm trying to scroll the output). It happens most of > the time, and at other times it works correctly (something > 70-30 split?). What usually happen is that when I try to use > arrow keys in the gdb window, instead of paging up and down, > it jumps into the source window. I'm not sure (you guys > would know better), but my suspicion is that the escape > codes from the arrow keys somehow got interpreted as <esc> > key, thus jumping into the source window.=20 This is one of the two possible problems. > TERM is set to > xterm. I'm using this with a SUN sparc machine (and SUN > keyboard) rsh'ed into linux machines. Please try this, :set escdelay=3D10000 int the source window. Then, go into the GDB window and try the arrow keys. If it works correct now then I can explain the problem, if it doesn't work, then it is a different, probably worse problem. Please let me know. Thanks, Bob Rossi |
From: James L. <le...@al...> - 2004-08-18 21:04:15
|
> Please try this, > :set escdelay=10000 > int the source window. Then, go into the GDB window and try the arrow > keys. If it works correct now then I can explain the problem, if it > doesn't work, then it is a different, probably worse problem. Please let > me know. Yes! It looks like setting this does make it work. I guess that means that the program needs to wait a bit longer to interpret the escape codes. Thanks, learnt something new about cgdb today. James. |
From: Bob R. <bo...@br...> - 2004-08-18 21:24:37
|
On Wed, Aug 18, 2004 at 09:04:00PM +0000, James Lee wrote: > > Please try this, > > :set escdelay=3D10000 > > int the source window. Then, go into the GDB window and try the arrow > > keys. If it works correct now then I can explain the problem, if it > > doesn't work, then it is a different, probably worse problem. Please let > > me know. >=20 > Yes! It looks like setting this does make it work. > I guess that means that the program needs to wait > a bit longer to interpret the escape codes. >=20 > Thanks, learnt something new about cgdb today. Great! I'm glad to hear that's the problem. The other problem would have been much worse :) You should adjust the value to something reasonable. So that when you hit <ESC> to go the source window, you don't have to wait for ever. You could try it at say '60' and then move to '100' if that doesn't work. The value is in tenths of seconds I believe. You can start CGDB and type :help to get all of the options. Then search for escdelay to see a little documentation about it. On the other hand, you could just get used to hitting <esc><esc> in order to move to the source window. Anyways, once you get the value that you want, you should add it to your ~/.cgdb/cgdbrc file. Once you do that, you will not have to ever worry about it again. Thanks, Bob Rossi |
From: Mike M. <mmu...@cs...> - 2004-08-18 05:35:32
|
> 2. I can't seem to get vi mode in readline in cgdb. Is it > allowed? It works in plain gdb. I just realized this will not work because CGDB catches <ESC> and does it= s own thing, so you'll never be able to send <ESC> to gdb/readline. Our current use of ESC/i makes it impossible... Thinking about this more generally, if we do what we plan on doing, which is that ESC/i does the 'normal' vi command/insert mode switching (but doesn't change the focused window), readline's vi-mode won't work either.= =20 In either case, we're snagging the <ESC> key before you can send it to gdb. I definitely see where you're coming from with this. It seems like in th= e context of the gdb window, there should be no command mode for cgdb, it'l= l always be in insert mode. That way if your readline is configured for vi-mode, you can use it normally. Bob, do you agree with this assessment? I believe it doesn't affect our design at all, but I'm not completely sure. James, I hope you're a patient man. :) These revisions to cgdb have been in the works for a while, but we haven't a long way to go still. I honestly have no idea how long it'll be before a new version comes out. Mike |
From: Peter K. <pe...@ko...> - 2004-08-18 12:21:04
|
On Wed, Aug 18, 2004 at 01:35:22AM -0400, Mike Mueller wrote: > > 2. I can't seem to get vi mode in readline in cgdb. Is it > > allowed? It works in plain gdb. >=20 > I just realized this will not work because CGDB catches <ESC> and does its > own thing, so you'll never be able to send <ESC> to gdb/readline. Our > current use of ESC/i makes it impossible... >=20 > Thinking about this more generally, if we do what we plan on doing, which > is that ESC/i does the 'normal' vi command/insert mode switching (but > doesn't change the focused window), readline's vi-mode won't work either.= =20 > In either case, we're snagging the <ESC> key before you can send it to > gdb. Isn't that going to be true no matter what your escape key is? Perhaps you need a meta escape key, like Ctrl-V. If you want to actually send an escape to the debugged process, you do a <ctrl-v><esc>, or something like that. - Peter --=20 Peter D. Kovacs <pe...@ko...> |
From: James L. <le...@al...> - 2004-08-18 21:34:05
|
Hi Mike, > > 2. I can't seem to get vi mode in readline in cgdb. Is it > > allowed? It works in plain gdb. > > I just realized this will not work because CGDB catches <ESC> and does its > own thing, so you'll never be able to send <ESC> to gdb/readline. Our > current use of ESC/i makes it impossible... Under the current framework, I agree that it will not work since <esc> is being used in vi to set modes, while cgdb uses it to jump to source window. However, in your proposed version 1.0, where window movements uses ctl-w, this could be ok. > Thinking about this more generally, if we do what we plan on doing, which > is that ESC/i does the 'normal' vi command/insert mode switching (but > doesn't change the focused window), readline's vi-mode won't work either. > In either case, we're snagging the <ESC> key before you can send it to > gdb. this part, I don't quite understand. What will you be snagging <esc> for in the new version? Are you planning on allowing editing in source window? > James, I hope you're a patient man. :) These revisions to > cgdb have been in the works for a while, but we haven't a > long way to go still. I honestly have no idea how long > it'll be before a new version comes out. Yes, I will be patient. Even now, cgdb 0.50 is very useful for me already. I'm sure version 1.0 will be great. Thanks for the work. James. |