From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24610 invoked by alias); 14 Oct 2009 20:54:19 -0000 Received: (qmail 24596 invoked by uid 22791); 14 Oct 2009 20:54:18 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from lo.gmane.org (HELO lo.gmane.org) (80.91.229.12) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 14 Oct 2009 20:54:14 +0000 Received: from list by lo.gmane.org with local (Exim 4.50) id 1MyApC-0000GN-IO for gdb@sources.redhat.com; Wed, 14 Oct 2009 22:51:58 +0200 Received: from 82-68-48-14.dsl.in-addr.zen.co.uk ([82.68.48.14]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2009 22:51:58 +0200 Received: from jsmith by 82-68-48-14.dsl.in-addr.zen.co.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 14 Oct 2009 22:51:58 +0200 To: gdb@sources.redhat.com From: Julian Smith Subject: gdb displaying incorrect signal names with remote target ? Date: Wed, 14 Oct 2009 20:54:00 -0000 Message-ID: <20091014214827.7259ea9e.jsmith@undo-software.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00259.txt.bz2 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/