[SOLVED] "a" key doesn't register in GDB, other letters work fine
SlackwareThis Forum is for the discussion of Slackware Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
"a" key doesn't register in GDB, other letters work fine
I've got a bit of an odd problem here. In GDB, my "a" key does not register. I've tried it in the console and in X11, and neither method allows me to type the letter a. Interestingly, capital A registers fine. For example, if I try and type "breakpoints," I only get "brekpoints." I thought it might be a problem with the GDB frontend, so I tried to use DDD as a front-end. The same problem occurs there! The only difference is that in DDD I can actually see the "a" as I type it. If I type in "breakpoints" and hit Enter, I get "Undefined info command: "brekpoints"." So, the a is not getting actually passed to GDB correctly.
I figure this is a problem with my key mappings, but I'm unsure of how to fix the problem. Has anyone had this problem before? What'd you do to fix it? It's so strange- "a" works fine in other programs, but not GDB.
Edit: I ran "dumpkeys" and +a is mapped to keycode 30.
very odd, your setup seems to match mine and gdb works fine for me. I am on 14.2 x64 no multilib
I have see problems with the letter 'a' in rxvt on a non-Linux OS, turned out rxvt had issues, Xterm was fine on that OS. On Slackware no issues with rxvt.
very odd, your setup seems to match mine and gdb works fine for me. I am on 14.2 x64 no multilib
John
I'm on 14.2 i686. It's a head scratcher for sure. I figured it HAD to be some sort of problem in my terminal, but the problem persists whether I'm using xterm, the standard Linux console, st, you name it. It almost seems like it's a problem in GDB itself and how that software handles keyboard input.
What happens if you set LC_ALL=C before you execute gdb ?
That is a good idea! I gave both methods a shot and the results were the same. I think the next step might be digging through the GDB source code to see if I can figure out how input is captured. It'd be great if I could find another piece of software that has this same problem so that I can look for similarities. I know that mutt, mc, top, emacs and cpan work fine. One would think that some of these programs might have the same problem.
Interestingly, if I pipe an "a" into gdb from the terminal, it works. Of course, that's no way to actually debug a program so this is useless to me, but it's an interesting piece of the puzzle.
I always run `screen` on remote systems when doing OS updates just in case I lose my ssh connection in the middle of 'something important'.
The screen program seems to do all sorts of wonderful things ( and some not so wonderful things ) to my terminal ...
Anyhow ...
Speaking of ssh: I wonder if: ssh -p 22 localhost and then try gdb ?
And screen ... Does your a-key work if you invoke gdb from within a screen session ?
A-ha! That did the trick! If I log in as root or as a freshly-created user, the a key works fine. It must be something in my login scripts that is screwing this up. I'm going to comb through them and see if I can spot the problem.
When I hit a, I get \7?! Weird. I'm going to mark this as solved and as I find out more about this, I will add my findings to the thread. Thank you Jjanel! I had forgotten all about strace. It's a wonderful program.
First off, I'm using zsh. When I tried to change my shell to bash, I encountered the problem on the shell as well as in GDB. Something gets loaded in bash that doesn't in zsh. I ended up loading a session of bash inside my zsh session, with strace attached. I noticed that bash loads .inputrc. When I removed that, the a key worked again everywhere.
Now, I have no idea what in my .inputrc was causing this problem, but here's the entire contents of that file:
Code:
gpg-agent --daemon --enable-ssh-support --write-env-file "${HOME}/.gpg-agent-info"
# set path
PATH=/usr/local/sbin:/usr/sbin:/sbin:/home/mike/bin:$PATH
It all seems pretty innocuous to me. Anyway, things are good now.
I deleted each part of the .inputrc file and tested after each part, and the culprit is that first line with the gpg-agent. I have no clue how that command would cause the "a" key not to work in some programs and not others, but there you have it.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.