Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Philippe Waroquiers <philippe.waroquiers@skynet.be>
To: "Maciej W. Rozycki" <macro@linux-mips.org>
Cc: Kevin Buettner <kevinb@redhat.com>,
	Philippe Waroquiers via Gdb-patches <gdb-patches@sourceware.org>
Subject: Re: [PUSHED/OBVIOUS] Remove gdb-gdb.gdb breakpoint on disappeared function info_command.
Date: Sun, 03 May 2020 14:45:50 +0200	[thread overview]
Message-ID: <97ebcb3519e3c79f9e081ffdb786e420c893a586.camel@skynet.be> (raw)
In-Reply-To: <alpine.LFD.2.21.2005030011440.3602499@eddie.linux-mips.org>

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




  parent reply	other threads:[~2020-05-03 12:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-01 14:54 Philippe Waroquiers
2020-05-02  4:02 ` Kevin Buettner
2020-05-02 21:19   ` Maciej W. Rozycki
2020-05-02 23:01     ` Philippe Waroquiers
2020-05-02 23:57       ` Kevin Buettner
2020-05-03  0:13       ` Maciej W. Rozycki
2020-05-03  0:33         ` Simon Marchi
2020-05-03 11:03         ` Pedro Alves
2020-05-03 12:45         ` Philippe Waroquiers [this message]
2020-05-03 17:17     ` Tom Tromey
2020-05-03 18:33       ` Philippe Waroquiers
2020-05-04 21:21         ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=97ebcb3519e3c79f9e081ffdb786e420c893a586.camel@skynet.be \
    --to=philippe.waroquiers@skynet.be \
    --cc=gdb-patches@sourceware.org \
    --cc=kevinb@redhat.com \
    --cc=macro@linux-mips.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox