This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
RE: [RFC/PATCH] Add new internal variable $_signo
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'Sergio Durigan Junior'" <sergiodj at redhat dot com>, "'GDB Patches'" <gdb-patches at sourceware dot org>
- Date: Fri, 14 Jun 2013 10:59:44 +0200
- Subject: RE: [RFC/PATCH] Add new internal variable $_signo
- References: <m3obb9y1aw dot fsf at redhat dot com>
Is it that I didn't understand the patch correctly or
do you use the GDB signal number in infrun.c
while you use the native signal integer value in the
corelow.c case?
Aren't those two values sometimes different?
Wouldn't it be more consistent to only use the GDB internal number?
In fact, this "inconsistency" is not specific to your patch,
the siggy from corelow.c is printed out, while 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.
Shouldn't we use gdb_signal_to_name (sig) in core_open
and set $_signo also to sig?
Pierre
Proposed patch (untested...)
Should I submit it independently or
is there a specific reason to print the numeric value of the signal
for core dumps while we seem to use signal names elsewhere?
2013-06-14 Pierre Muller <muller@sourceware.org>
* corelow.c (core_open): Use GDB signal name instead of raw
signal value.
Index: corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.132
diff -u -p -r1.132 corelow.c
--- corelow.c 15 May 2013 12:26:14 -0000 1.132
+++ corelow.c 14 Jun 2013 08:56:08 -0000
@@ -445,7 +445,7 @@ core_open (char *filename, int from_tty)
: gdb_signal_from_host (siggy));
printf_filtered (_("Program terminated with signal %s, %s.\n"),
- siggy, gdb_signal_to_string (sig));
+ gdb_signal_to_name (sig), gdb_signal_to_string
(sig));
}
/* Fetch all registers from core file. */