diff options
author | Michael Meissner <gnu@the-meissners.org> | 1996-10-15 15:44:10 +0000 |
---|---|---|
committer | Michael Meissner <gnu@the-meissners.org> | 1996-10-15 15:44:10 +0000 |
commit | 57bc1a721a6b00bf4f01897cdba81ca42fa94f6d (patch) | |
tree | 2110550623484b141711058196ae6655c78e4045 /sim/common/run.c | |
parent | 684d50a53eb1b63c327205f2a712379cfa912da5 (diff) | |
download | gdb-57bc1a721a6b00bf4f01897cdba81ca42fa94f6d.zip gdb-57bc1a721a6b00bf4f01897cdba81ca42fa94f6d.tar.gz gdb-57bc1a721a6b00bf4f01897cdba81ca42fa94f6d.tar.bz2 |
Better error messages when a program stops due to signal; support d10v getpid/kill
Diffstat (limited to 'sim/common/run.c')
-rw-r--r-- | sim/common/run.c | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/sim/common/run.c b/sim/common/run.c index 76cc48a..79484eb 100644 --- a/sim/common/run.c +++ b/sim/common/run.c @@ -33,7 +33,7 @@ void usage(); extern int optind; extern char *optarg; -bfd *sim_bfd; +bfd *exec_bfd; int target_byte_order; @@ -87,7 +87,7 @@ main (ac, av) printf ("run %s\n", name); } - sim_bfd = abfd = bfd_openr (name, 0); + exec_bfd = abfd = bfd_openr (name, 0); if (!abfd) { fprintf (stderr, "run: can't open %s: %s\n", @@ -154,6 +154,18 @@ main (ac, av) sim_close(0); + /* Why did we stop? */ + switch (reason) + { + case sim_signalled: + case sim_stopped: + fprintf (stderr, "program stopped with signal %d.\n", sigrc); + break; + + case sim_exited: + break; + } + /* If reason is sim_exited, then sigrc holds the exit code which we want to return. If reason is sim_stopped or sim_signalled, then sigrc holds the signal that the simulator received; we want to return that to |