1

I'm running into problems debugging c++ under emacs. When I start the debugging command:

M-xgdb --annotate=3 myprogram

The gdb shell does not prompt. Instead it stuck after showing (gdb) Current directory is ~/programs/small/ as pasted below. I can't type any debug command then... However the status bar shows no error messages. Does any body know how to fix it? Thank you!

GNU gdb (Ubuntu/Linaro 7.2-1ubuntu11) 7.2
Copyright (C) 2010 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it. 
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>...
Reading symbols from /home/chzhang/programs/small/loop...done.
(gdb) Current directory is ~/programs/small/

1 Answer 1

1

I had a problem like this once caused by binding some keys in .inputrc. If you're not sure whether you have bound keys in this way you probably haven't, but to test it you can run emacs as

INPUTRC= emacs &

and see if that fixes it.

Perhaps more likely is that you are using the new mi interface to Emacs. In Emacs 24 (not yet released, but available in snapshots) this is the default and gdb --annotate=3 is no longer "the right thing." For the new interface you want gdb -i mi.

Sign up to request clarification or add additional context in comments.

1 Comment

wow, "INPUTRC= emacs" fixed it ! You might want to point out that you do want the space after the '=' sign and you don't need the trailing "&"

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.