[PATCH] sim: nrun: decode signal when crashing

Mike Frysinger vapier@gentoo.org
Tue Dec 28 04:43:00 GMT 2010


On Tuesday, November 16, 2010 11:10:43 Frank Ch. Eigler wrote:
> vapier wrote:
> > [...]
> > 
> >        if (sigrc != 0)
> > 
> > -        fprintf (stderr, "program stopped with signal %d.\n", sigrc);
> > +	fprintf (stderr, "program stopped with signal %d (%s).\n", sigrc,
> > +		 strsignal (sigrc));
> > 
> >        break;
> 
> I don't know if we can assume that the target signal numbering matches
> the host.  Else I suspect we wouldn't have all those TARGET_SIGNAL_*
> defs.

looking through the code, it seems nrun.c already assumes this.  i cant find 
any logic that utilizes the signal_map member of the callback structure.

sim-reason.c:sim_stop_reason() sets sigrc to the target signal based on the 
sim signal (uses sim_signal_to_target()).  nrun.c:main() then compares that 
sigrc directly to the result of sim_signal_to_host().

so i think this patch is OK considering the existing state of things ...
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://sourceware.org/pipermail/gdb-patches/attachments/20101228/a7306d09/attachment.sig>


More information about the Gdb-patches mailing list