PR 2343 fix: signal number mismatch

Aleksandar Ristovski ARistovski@qnx.com
Mon Apr 21 15:30:00 GMT 2008


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




-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: gdbarch.sh.target_signal.diff
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20080421/a4246215/attachment.ksh>


More information about the Gdb-patches mailing list