From: Julian Smith <jsmith@undo-software.com>
To: gdb@sources.redhat.com
Subject: gdb displaying incorrect signal names with remote target ?
Date: Wed, 14 Oct 2009 20:54:00 -0000 [thread overview]
Message-ID: <20091014214827.7259ea9e.jsmith@undo-software.com> (raw)
Hello
I'm using a remote target (undodb running on the same machine) with
current gdb (checked out of cvs today), and i'm seeing gdb print the
wrong signal name when the inferior is stopped by a signal.
The inferior is receiving SIGUSR1 (signal number 10 on my i386 Linux
system), thus the remote target sends a packet `S0a' to gdb.
However, gdb is displaying this as:
Program received signal SIGBUS, Bus error.
- whereas i would expect to see:
Program received signal SIGUSR1, User defined signal 1.
Does anyone know why this is happening? E.g. does the remote target
need to send any information about the signal number => text mapping
that gdb should be doing ?
I've looked in the gdb source code, and it looks like there are three
different mappings from signal number to text:
$ find ~/gdb_cvs_dir/src/ -name "*.c*"|xargs grep -nw "Bus error"
/home/jules/gdb_cvs_dir/src/gdb/common/signals.c:69: {"SIGBUS", "Bus error"},
/home/jules/gdb_cvs_dir/src/gdb/proc-events.c:1473: { SIGBUS, "SIGBUS", "Bus error" },
/home/jules/gdb_cvs_dir/src/libiberty/strsignal.c:113: ENTRY(SIGBUS, "SIGBUS", "Bus error"),
$
The first of these creates a static array of text strings, and appears
to index into this list using the signal number. The resulting mapping
matches what i'm seeing, where signal 10 is displayed as SIGBUS:
/* This table must match in order and size the signals in enum target_signal
in src/include/gdb/signals.h. */
/* *INDENT-OFF* */
static const struct {
const char *name;
const char *string;
} signals [] =
{
{"0", "Signal 0"},
{"SIGHUP", "Hangup"},
{"SIGINT", "Interrupt"},
{"SIGQUIT", "Quit"},
{"SIGILL", "Illegal instruction"},
{"SIGTRAP", "Trace/breakpoint trap"},
{"SIGABRT", "Aborted"},
{"SIGEMT", "Emulation trap"},
{"SIGFPE", "Arithmetic exception"},
{"SIGKILL", "Killed"},
{"SIGBUS", "Bus error"},
{"SIGSEGV", "Segmentation fault"},
{"SIGSYS", "Bad system call"},
{"SIGPIPE", "Broken pipe"},
{"SIGALRM", "Alarm clock"},
{"SIGTERM", "Terminated"},
{"SIGURG", "Urgent I/O condition"},
{"SIGSTOP", "Stopped (signal)"},
{"SIGTSTP", "Stopped (user)"},
...
}
In case it makes any difference, i'm building gdb with a simple `cd src;
./configure && make'. Then running the resulting executable directly in
place. The verion info is:
GNU gdb (GDB) 7.0.0.20091014-cvs
Thanks for any help.
- Julian
--
http://undo-software.com/
next reply other threads:[~2009-10-14 20:54 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-10-14 20:54 Julian Smith [this message]
2009-10-14 21:01 ` Daniel Jacobowitz
2009-10-14 21:37 ` Pedro Alves
2009-10-14 21:05 ` Pedro Alves
2009-10-15 6:24 ` Julian Smith
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=20091014214827.7259ea9e.jsmith@undo-software.com \
--to=jsmith@undo-software.com \
--cc=gdb@sources.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