Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Aleksandar Ristovski <ARistovski@qnx.com>
To: Daniel Jacobowitz <drow@false.org>
Cc: GDB Patches <gdb-patches@sourceware.org>
Subject: Re: PR 2343 fix: signal number mismatch
Date: Mon, 21 Apr 2008 15:30:00 -0000	[thread overview]
Message-ID: <480CA75A.5060906@qnx.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 1483 bytes --]

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





[-- Attachment #2: gdbarch.sh.target_signal.diff --]
[-- Type: text/plain, Size: 871 bytes --]

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
 }
 

             reply	other threads:[~2008-04-21 14:41 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-21 15:30 Aleksandar Ristovski [this message]
  -- strict thread matches above, loose matches on Subject: below --
2008-04-22 15:56 Aleksandar Ristovski
2008-05-01 19:07 ` Daniel Jacobowitz
2008-05-01 19:39   ` Aleksandar Ristovski
2007-12-16 22:19 Aleksandar Ristovski
2007-12-16 22:25 ` Daniel Jacobowitz
2007-12-13 17:05 Aleksandar Ristovski
2008-01-29 17:02 ` Daniel Jacobowitz

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=480CA75A.5060906@qnx.com \
    --to=aristovski@qnx.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    /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