From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27978 invoked by alias); 21 Apr 2008 14:41:25 -0000 Received: (qmail 27970 invoked by uid 22791); 21 Apr 2008 14:41:24 -0000 X-Spam-Check-By: sourceware.org Received: from qnxmail.qnx.com (HELO nimbus.ott.qnx.com) (209.226.137.76) by sourceware.org (qpsmtpd/0.31) with ESMTP; Mon, 21 Apr 2008 14:40:46 +0000 Received: by nimbus.ott.qnx.com with Internet Mail Service (5.5.2653.19) id ; Mon, 21 Apr 2008 10:40:41 -0400 Message-ID: <480CA75A.5060906@qnx.com> From: Aleksandar Ristovski To: Daniel Jacobowitz Cc: GDB Patches Subject: Re: PR 2343 fix: signal number mismatch Date: Mon, 21 Apr 2008 15:30:00 -0000 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) user-agent: Thunderbird 2.0.0.12 (Windows/20080213) Content-Type: multipart/mixed; boundary="----_=_NextPart_000_01C8A3BD.A929ACB9" X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-04/txt/msg00432.txt.bz2 This message is in MIME format. Since your mail reader does not understand this format, some or all of this message may not be legible. ------_=_NextPart_000_01C8A3BD.A929ACB9 Content-Type: text/plain; charset="iso-8859-1" Content-length: 1483 Daniel Jacobowitz wrote: > > gdbarch.h and gdbarch.c are generated files (see the big comment at > the top of them). You need to add the new function to the list in > gdbarch.sh instead. > Hello Daniel, I have made changes to gdbarch.sh. The attached patch is not complete (and the generated gdbarch.c would not produce linkable gdb) but I just wanted to double-check if this is correct. After you confirm I will add other necessary changes. The patch introduces two new functions for translating signal number between GDB's internal representation and targeted system's signal number. To give some background to those who are not familiar with the issue: in multi-arch situations, or in remote debugging situations, target's signal number and gdb's signal number may not match, e.g. signal number 14 on the target may mean SIGINT, while it may mean something else on the GDB's host system. In such cases, GDB will misinterpret the inferior's signal; this can also easily happen when examining core files on a GDB host other than the system that generated the core. Please pay special attention to the naming, it is somewhat confusing: 'enum target_signal' is GDB's universal representation of signals and is GDB's host independent. New functions added to gdbarch structure are named as follows: target_signal_to_host and target_signal_from_host where 'host' means 'inferior's host' (host where inferior is running). Thanks, Aleksandar Ristovski QNX Software Systems ------_=_NextPart_000_01C8A3BD.A929ACB9 Content-Type: text/plain; name="gdbarch.sh.target_signal.diff" Content-Disposition: attachment; filename="gdbarch.sh.target_signal.diff" Content-length: 871 Index: gdbarch.sh =================================================================== RCS file: /cvs/src/src/gdb/gdbarch.sh,v retrieving revision 1.461 diff -u -p -r1.461 gdbarch.sh --- gdbarch.sh 20 Feb 2008 14:31:40 -0000 1.461 +++ gdbarch.sh 21 Apr 2008 14:23:11 -0000 @@ -619,6 +619,13 @@ M:const struct target_desc *:core_read_d F:char *:static_transform_name:char *name:name # Set if the address in N_SO or N_FUN stabs may be zero. v:int:sofun_address_maybe_missing:::0:0::0 + +# Signal translation: translate inferior's signal (host's) number into +# GDB's representation. +m:enum target_signal:target_signal_from_host:int signo:signo::default_target_signal_from_host::0 +# Signal translation: translate GDB's signal number into inferior's host +# signal number. +m:int:target_signal_to_host:enum target_signal ts:ts::default_target_signal_to_host::0 EOF } ------_=_NextPart_000_01C8A3BD.A929ACB9--