Questions about emacs 24 gud-mi gdb

I'm having problems using the Emacs v24 gud-mi interface with gdb. I hope someone here can help me, Google did not help much (perhaps due to very general terms)

I use gdb in Emacs as follows: gdb -i = mi --annotate = 0

Questions:

1) One of the problems that I saw is that the gdb prompt is not always displayed (you are stuck on a new line without a hint, not knowing if it is processing something or waiting for your input). I initially had --annotate = 3, and the problem was worse: with -annotate = 0, the hints look much better, but there are still a few times when the prompt disappears.

Is there any parameter to make sure the invitation is not lost?

2) Another problem is that gud-gdb would like to ask me for confirmation when reloading the executable file, say by mistake pressing <r> <enter> or just pressing <enter> when my previous command (similar for some large actions like quit, attach, etc.). Is there a setting to get this behavior?

Platform: RHEL5.0

Thanks for your time and comments!

+4
source share
1 answer

Hacking the second problem:

(defadvice gdb-send (before ask activate) (when (and (string-match "^r" string) (null (y-or-np "Really run?"))) (setq string "show version"))) 

The string argument that is being overwritten is the string sent to gdb. If run not confirmed, it is replaced by the relatively harmless show version command. Just a little noisy.

I think you get the point.

0
source

Source: https://habr.com/ru/post/1486067/


All Articles