X-Git-Url: http://drtracing.org/?a=blobdiff_plain;f=sim%2Fcommon%2Fnrun.c;h=2e477153022a873c8e4ade1da8f1d5796983f6b2;hb=1ac72f0659d64d6a14da862242db0d841d2878d0;hp=2a7ac51034035e77238fcd66c3dbb5d337707623;hpb=028f6515424e832ee10a1e4cb1f96ea241e2acae;p=deliverable%2Fbinutils-gdb.git
diff --git a/sim/common/nrun.c b/sim/common/nrun.c
index 2a7ac51034..2e47715302 100644
--- a/sim/common/nrun.c
+++ b/sim/common/nrun.c
@@ -1,6 +1,5 @@
/* New version of run front end support for simulators.
- Copyright (C) 1997, 2004, 2007, 2008, 2009, 2010, 2011
- Free Software Foundation, Inc.
+ Copyright (C) 1997-2016 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
@@ -15,7 +14,22 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see . */
+/* Need to be before general includes, to pick up e.g. _GNU_SOURCE. */
+#ifdef HAVE_CONFIG_H
+#include "cconfig.h"
+#endif
+
#include
+
+/* For strsignal. */
+#ifdef HAVE_STRING_H
+#include
+#else
+#ifdef HAVE_STRINGS_H
+#include
+#endif
+#endif
+
#include "sim-main.h"
#include "bfd.h"
@@ -85,7 +99,7 @@ main (int argc, char **argv)
/* We can't set the endianness in the callback structure until
sim_config is called, which happens in sim_open. */
default_callback.target_endian
- = (CURRENT_TARGET_BYTE_ORDER == BIG_ENDIAN
+ = (CURRENT_TARGET_BYTE_ORDER == BFD_ENDIAN_BIG
? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE);
/* Was there a program to run? */
@@ -203,7 +217,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: