This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA] Use GDB signal enum in corelow.c
- From: "Pierre Muller" <pierre dot muller at ics-cnrs dot unistra dot fr>
- To: "'GDB Patches'" <gdb-patches at sourceware dot org>
- Date: Fri, 14 Jun 2013 16:24:14 +0200
- Subject: [RFA] Use GDB signal enum in corelow.c
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.
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.
Thus this patch simply converts the printout of the
numerical value of the signal into the converted GDB signal name.
Here is an updated patch that I tested
on gcc10 from the GCC compile farm.
The testsuite run revealed no new failure.
Pierre Muller
GDB pascal language maintainer
2013-06-14 Pierre Muller <muller@sourceware.org>
* corelow.c (core_open): Use GDB signal name instead of raw
signal value.
Index: src/gdb/corelow.c
===================================================================
RCS file: /cvs/src/src/gdb/corelow.c,v
retrieving revision 1.132
diff -u -p -r1.132 corelow.c
--- src/gdb/corelow.c 15 May 2013 12:26:14 -0000 1.132
+++ src/gdb/corelow.c 14 Jun 2013 08:56:08 -0000
@@ -444,8 +444,8 @@ core_open (char *filename, int from_tty)
siggy)
: gdb_signal_from_host (siggy));
- 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
(sig));
}
/* Fetch all registers from core file. */