public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] sim: nrun: decode signal when crashing
@ 2010-11-16  2:50 Mike Frysinger
  2010-11-16 16:10 ` Frank Ch. Eigler
  0 siblings, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2010-11-16  2:50 UTC (permalink / raw)
  To: gdb-patches

Signed-off-by: Mike Frysinger <vapier@gentoo.org>

2010-11-16  Mike Frysinger  <vapier@gentoo.org>

	* nrun.c (main): Display strsignal of sigrc.
---
 sim/common/nrun.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index e537849..4eefa7b 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -203,7 +203,8 @@ main (int argc, char **argv)
     case sim_signalled:
     case sim_stopped:
       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;
 
     case sim_exited:
-- 
1.7.3.1

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sim: nrun: decode signal when crashing
  2010-11-16  2:50 [PATCH] sim: nrun: decode signal when crashing Mike Frysinger
@ 2010-11-16 16:10 ` Frank Ch. Eigler
  2010-11-16 19:06   ` Mike Frysinger
  2010-12-28  4:43   ` Mike Frysinger
  0 siblings, 2 replies; 5+ messages in thread
From: Frank Ch. Eigler @ 2010-11-16 16:10 UTC (permalink / raw)
  To: Mike Frysinger; +Cc: gdb-patches


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.


- FChE

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sim: nrun: decode signal when crashing
  2010-11-16 16:10 ` Frank Ch. Eigler
@ 2010-11-16 19:06   ` Mike Frysinger
  2010-12-28  4:43   ` Mike Frysinger
  1 sibling, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2010-11-16 19:06 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 1248 bytes --]

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.

for the platforms i care about, they are ;).  but that's a fair point.  i 
think the reason i did this is because the signal_map logic isnt really used 
anywhere that i can see.  perhaps i should bite the bullet and add a 
target_strsignal() that operates on the callback maps ...

i get the feeling that the sim history is something like:
 - there were no viable sims, so this one was started up ... it was a bit 
bare, but it worked for people's minimal needs
 - ibm threw a lot of money at developers who created a pretty full ppc sim as 
a semi-fork ... then over time, much of that work was merged back
 - qemu gathered steam and sucked up all the potential developers
 - many cool sim features remain stalled & under developed
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sim: nrun: decode signal when crashing
  2010-11-16 16:10 ` Frank Ch. Eigler
  2010-11-16 19:06   ` Mike Frysinger
@ 2010-12-28  4:43   ` Mike Frysinger
  2012-03-19  3:59     ` Mike Frysinger
  1 sibling, 1 reply; 5+ messages in thread
From: Mike Frysinger @ 2010-12-28  4:43 UTC (permalink / raw)
  To: Frank Ch. Eigler; +Cc: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 945 bytes --]

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

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] sim: nrun: decode signal when crashing
  2010-12-28  4:43   ` Mike Frysinger
@ 2012-03-19  3:59     ` Mike Frysinger
  0 siblings, 0 replies; 5+ messages in thread
From: Mike Frysinger @ 2012-03-19  3:59 UTC (permalink / raw)
  To: gdb-patches

[-- Attachment #1: Type: Text/Plain, Size: 1082 bytes --]

On Monday 27 December 2010 21:04:01 Mike Frysinger wrote:
> 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 ...

committed in light of this
-mike

[-- Attachment #2: This is a digitally signed message part. --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2012-03-19  3:59 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-11-16  2:50 [PATCH] sim: nrun: decode signal when crashing Mike Frysinger
2010-11-16 16:10 ` Frank Ch. Eigler
2010-11-16 19:06   ` Mike Frysinger
2010-12-28  4:43   ` Mike Frysinger
2012-03-19  3:59     ` Mike Frysinger

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).