Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Pedro Alves <palves@redhat.com>
To: Sergio Durigan Junior <sergiodj@redhat.com>
Cc: Pierre Muller <pierre.muller@ics-cnrs.unistra.fr>,
	       "'GDB Patches'" <gdb-patches@sourceware.org>
Subject: Re: [RFC/PATCH] New convenience variable $_exitsignal
Date: Tue, 17 Sep 2013 16:19:00 -0000	[thread overview]
Message-ID: <523880F6.7030900@redhat.com> (raw)
In-Reply-To: <m3txhkpasb.fsf@redhat.com>

On 09/17/2013 01:11 AM, Sergio Durigan Junior wrote:

>> I can't say I really understand how any of that argues against my
>> original rationale for not setting $_exitsignal on corefiles (because
>> the inferior has not really exited at the point the core has been
>> generated), rather than point at implementation choices.
> 
> Interesting.  I thought setting it made sense because it seems to me
> that the inferior has exited when the corefile has been generated.  I am
> clearly missing some knowledge here, then...

Then that's what you need to argue.  ;-) My point of view was that
when inspecting a core dump, you're seeing the state of the
program _before_ it exited.  E.g, if you stop the program (with a
breakpoint, ctrl-c, or even "interrupt -a"/non-stop), do "gcore", and
then debug the resulting core, the program never exited.

>> Now, if one were to instead argue that _user interface_ -wise, it'd
>> make sense to set $_exitsignal, because we also print
>> "Program terminated with signal", (emphasis on "terminated"), then
>> I'd agree:
>>
>>   siggy = bfd_core_file_failing_signal (core_bfd);
>>   if (siggy > 0)
>>     {
>> ...
>>       printf_filtered (_("Program terminated with signal %s, %s.\n"),
>> 		       gdb_signal_to_name (sig), gdb_signal_to_string (sig));
>>     }
> 
> ...or not.  Apparently, you are differentiating between "exited" and
> "terminated", right?  Could you expand a little more on this?

No, not differentiating.  The emphasis was for pointing out that GDB already
claims the program has indeed terminated, so from that perspective, it does
indeed make sense to set $_exitsignal, otherwise, to make things consistent,
_I_, in turn, would need to argue for removing that "Program terminated with
signal" message.  I don't plan to, so I get to agree with setting $_exitsignal.
See, this is all about _user interface_, not random internal implementation
choices, which will naturally change over time, but the user interface design
decision will most probably outlast that for a long while.

> And BTW, I guess my reasoning for setting $_exitsignal here is indeed
> because we already assume that the inferior has been terminated (or
> exited?) indeed.

Thanks,
-- 
Pedro Alves


  reply	other threads:[~2013-09-17 16:19 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-16  6:30 Sergio Durigan Junior
2013-06-16 16:22 ` Doug Evans
2013-06-17  3:33 ` Eli Zaretskii
2013-06-17  7:32 ` Pierre Muller
2013-06-17 17:55   ` Sergio Durigan Junior
2013-06-19  5:26     ` Sergio Durigan Junior
2013-09-16 18:04       ` Pedro Alves
2013-09-17  0:11         ` Sergio Durigan Junior
2013-09-17 16:19           ` Pedro Alves [this message]
2013-09-17 18:39         ` Tom Tromey
2013-09-17 18:53           ` Philippe Waroquiers
2013-09-17 18:59             ` Tom Tromey
2013-09-17 18:59             ` Sergio Durigan Junior
2013-09-17 19:08             ` Pedro Alves
2013-09-17 19:02           ` Pedro Alves
2013-09-17 19:09             ` Tom Tromey
2013-07-18 16:48     ` Tom Tromey
2013-06-17 17:28 ` Pedro Alves
2013-06-17 17:31   ` Pedro Alves
2013-06-17 17:41   ` Sergio Durigan Junior

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=523880F6.7030900@redhat.com \
    --to=palves@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=pierre.muller@ics-cnrs.unistra.fr \
    --cc=sergiodj@redhat.com \
    /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