[Top][All Lists]

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

Re: Gdb in emacs 24

From: Stefan Monnier
Subject: Re: Gdb in emacs 24
Date: Wed, 19 Oct 2011 10:35:30 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

> 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.

>   create a new command (e.g., "set interpreter") to set the current
>   interpreter

This is ambiguous if there's an `interpreter' variable in the currently
debugged program.  But, yes, such a command would be very welcome,
especially if it fails reliably in GDB versions that don't support it.

>   Even if not optimal, the cost of setting the interpreter on
>   a per-command basis (as opposed to setting the current interpreter
>   for all future commands) should not have a noticeable impact
>   on performance.

At least for commands typed interactively by the user, that's true.
Don't know how many commands are sent by gdb-mi.el so I don't know if
the impact could be noticeable there, but I expect it shouldn't be
a problem.
OTOH I wonder if macros defined for example in .gdbinit would go through
`mi' or not.

> * What to do if the user ever passed "-i=tui" in the gdb cmdline
>   (which seems to make MI unusable even through "interpreter-exec").

If we can test for `mi', we can signal 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.


reply via email to

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