Reputation: 41
I am having niggling issues using Emacs v24's gud-mi interface with gdb. I hope someone here can help me out, Google hasn't been much help (probably because of very generic terms)
I use gdb in Emacs thusly: gdb -i=mi --annotate=0
Questions:
1) One of the issues I have seen is that the gdb prompt is not always displayed (you are stuck on a new line without a prompt not knowing whether it is processing something, or waiting for your input). I initially had --annotate=3 and the problem was worse, with --annotate=0, the prompts appear much better, but there still are a few times when the prompt goes missing.
Is there any setting to make sure the prompt is not getting lost?
2) Another "issue" is that I would like gud-gdb to ask me confirmations when I restart the executable, say by mistakenly pressing <r><enter> or just pressing <enter> when my previous command was run (similarly for some big actions like quit, attach etc). Is there a setting to get this behavior?
Platform: RHEL5.0
Thanks for your time and comments!!
Upvotes: 4
Views: 678
Reputation: 5198
A hack for the second issue:
(defadvice gdb-send (before ask activate)
(when (and (string-match "^r" string)
(null (y-or-n-p "Really run?")))
(setq string "show version")))
The argument string
which is overwritten is the string sent to gdb.
If run
is not confirmed it is replaced with the relatively harmless command show version
. Just a bit noisy.
I think you get the idea.
Upvotes: 0