This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFA] Use GDB signal enum in corelow.c
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Pedro Alves'" <palves at redhat dot com>
- Cc: "'GDB Patches'" <gdb-patches at sourceware dot org>
- Date: Mon, 17 Jun 2013 08:16:33 +0200
- Subject: RE: [RFA] Use GDB signal enum in corelow.c
- References: <51bb279a dot ea49ec0a dot 1fd0 dot ffff98edSMTPIN_ADDED_BROKEN at mx dot google dot com> <51BB5A04 dot 4020201 at redhat dot com>
> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Pedro Alves
> Envoyé : vendredi 14 juin 2013 20:00
> À : Pierre Muller
> Cc : 'GDB Patches'
> Objet : Re: [RFA] Use GDB signal enum in corelow.c
>
> On 06/14/2013 03:24 PM, Pierre Muller wrote:
> > This RFA is related to the
> > thread started today by Sergio Durigan Junior
> > [RFC/PATCH] Add new internal variable $_signo
> >
> > But the patch I sent in my answer was not applying correctly
> > as I modified the patch file directly after using patch
> > executable.
> >
> > The "inconsistency" is that in corelow.c
> > the integer variable siggy is printed out,
> > but this corresponds to the value of the signal on the system
> > on which the core dump was created, which might be different
> > from the internal enum normally used by GDB.
>
> That's OK. If we're printing the signal number, we do
> want the number on the system on which the core was created.
> That's the number the program sees and uses, and the one
> that has meaning for the user. The internal GDB number has no
> meaning for the user or the program.
>
> > Other signals are always first converted to GDB enum values
> > before being printed, and apparently not in
> > integer form but using the gdb_signal_to_name function.
>
> Right, GDB enum values are never displayed. They're an
> internal implementation detail.
>
> >
> > Thus this patch simply converts the printout of the
> > numerical value of the signal into the converted GDB signal name.
>
> I only half agree with the rationale, but I agree with the patch. :-)
Thus I committed the patch.
> With live debugging, we print:
>
> if (ui_out_is_mi_like_p (uiout))
> ui_out_field_string
> (uiout, "reason", async_reason_lookup
(EXEC_ASYNC_EXITED_SIGNALLED));
> ui_out_text (uiout, "\nProgram terminated with signal ");
> annotate_signal_name ();
> ui_out_field_string (uiout, "signal-name",
> gdb_signal_to_name (siggnal));
> annotate_signal_name_end ();
> ui_out_text (uiout, ", ");
> annotate_signal_string ();
> ui_out_field_string (uiout, "signal-meaning",
> gdb_signal_to_string (siggnal));
> annotate_signal_string_end ();
> ui_out_text (uiout, ".\n");
> ui_out_text (uiout, "The program no longer exists.\n");
> }
>
> And it looks to me that your patch:
>
> > - printf_filtered (_("Program terminated with signal %d, %s.\n"),
> > - siggy, gdb_signal_to_string (sig));
> > + printf_filtered (_("Program terminated with signal %s, %s.\n"),
> > + gdb_signal_to_name (sig), gdb_signal_to_string
>
> Makes the output of live debugging vs core debugging exactly
> the same (please confirm). _That_ rationale makes me agree
> with the patch.
>
> > * corelow.c (core_open): Use GDB signal name instead of raw
> > signal value.
>
> s/Use/Print/
> s/raw/target/
> s/value/number/
With your substitutions made.
Thanks for the approval,
Pierre Muller