Re: [PUSHED/OBVIOUS] Remove gdb-gdb.gdb breakpoint on disappeared function info_command.

Philippe Waroquiers
2020-05-03T12:45:52Z

On Sun, 2020-05-03 at 01:13 +0100, Maciej W. Rozycki wrote:
> On Sun, 3 May 2020, Philippe Waroquiers wrote:
> > I do limited GDB debugging, but was not aware of this feature.
> > I am not sure to understand the problem:
> > C-c works for me to interrupt GDB, and the top GDB gets
> > back the control (I typically launch top-gdb separately
> > and attach to the inferior GDB).
> > Can you explain more in details the problem this was solving ?
>
> I don't remember offhand; I do remember there were issues in some debug
> scenarios with using signals, perhaps unintended delivery to the debuggee
> GDB (or its debuggee), or some problems with trapping the signal in the
> first place (perhaps on MinGW, where obviously we don't have a typical
> *nix environment and ^C may have simply killed the outer GDB and other
> signals such as SIGQUIT may not have had a way to be produced at all).
> Especially as when debugging broken GDB (which is why you debug it in the
> first place) you often find it in an odd state.
>
> In any case `info' was a clean and reliable way to break into the outer
> GDB from the inner GDB's command prompt.
>
> > > So what's the current mechanism to do that? I do hope to have it the
> > > next time I poke at GDB.
> > If something done in the inferior GDB must trigger the top GDB to regain
> > control, we could add a specific dummy command
> > e.g. maintenance wake-up-top-gdb
> > and then have the breakpoint put on the wake_up_top_gdb_command function
> > implementing this dummy command.
>
> Ouch, that's a horrible lot of characters to type, even if we factor in
> completion (which some host configurations lack, e.g. MinGW); one of the
> obvious features of `info' was its brevity (especially in its `i' short
> form).
>
> If the `info' command has been removed (why?), then I think a stub ought
> to be added back, just to have this feature restored.
As I understand, the purpose of the commit 0743fc83c03 was to remove
(not too sure how many commands were removed but something like 100 ?)
duplicated implementations of some commands.

For the user, "info" without arguments works as before, but is using
code common to all such prefix commands.

I debugged GDB (without the 'i' break-me feature :)). In the stack
trace, I see no function specific to the "info" command.
So, if we want to restore this 'i' break-me feature exactly as is,
it looks like something special must then be done in the code
for the "info" command (like re-duplicating the code just for
"info").

Alternatively, alias I = maintenance wake-up-top-gdb
or alias mw = maintenance wake-up-top-gdb
would make it short (but break the habits of GDB developers
used to 'i' or 'info').

Philippe