emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Gdb in emacs 24


From: Lluís
Subject: Re: Gdb in emacs 24
Date: Wed, 19 Oct 2011 17:42:18 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

Stefan Monnier writes:

>> There seems to be no obvious command in gdb to get the current
>> interpreter.  The closest match is routine 'top_level_interpreter', but
>> there is no command to get that.

> How 'bout some way to just check whether `mi' is the
> current interpreter.  It doesn't have to be a dedicated command, just
> a command which will reliably behave differently (e.g. return some
> recognizable value if `mi' is used, and return an error if not).

> That would at least let us provide a clear error message to the user.
[...]
>> This can be worked around by silently appending any other interface
>> option in the cmdline when starting gdb.

> No.  The whole reason why "--i=mi" and "--annotate=3" is explicitly
> present in the minibuffer prompt is because adding those options
> silently makes it impossible to use GUD with setups where gdb
> is run indirectly (e.g. the command might be "make debug" rather than
> "gdb prog", so silently adding "--i=mi" is not an option).

>> * Should user-issued commands in the gdb buffer use the mi or console
>> interpreter?

> gdb-mi.el wants those commands to go through `mi' as well.

Aha, I see. Then I think the safest way to go is using "interpreter-exec" on
every command. This will work regardless of the interpreter, so there is no need
to pass "-i=mi" in the command line.

Then, as I said, annotations can be silently disabled once gdb has started ("set
annotations 0").

Finally, we're simply left with the need to check if the user is starting gdb
with the tui interpreter. For this, issuing "interpreter-exec mi help" will do
as the tui interpreter does not support "interpreter-exec".


Lluis

-- 
 "And it's much the same thing with knowledge, for whenever you learn
 something new, the whole world becomes that much richer."
 -- The Princess of Pure Reason, as told by Norton Juster in The Phantom
 Tollbooth



reply via email to

[Prev in Thread] Current Thread [Next in Thread]