This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Committed: adjust sim/testsuite/sim/cris/asm/badarch1.ms and error messages
- From: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- To: gdb-patches at sourceware dot org
- Date: Tue, 30 Dec 2008 19:54:30 +0100
- Subject: Committed: adjust sim/testsuite/sim/cris/asm/badarch1.ms and error messages
On a 32-bit x86 host, /bin/sh matches the generic ELF
pseudo-target elf32-little, included in the BFD configuration
for cris-elf, but the architecture isn't recognized. On a
64-bit host, such as my sim autotester, /bin/sh is a 64-bit
program, not recognized even initially, and the error message is
different. Doh.
Also, the error message was both redundant and not to the point:
run: "/bin/sh" is not an object file: File format not recognized
run: invalid executable `/bin/sh'
-or-
run: not a CRIS program `/bin/sh'
Slightly better now, perhaps not by much, but by little:
run: "/bin/sh" is not an object file: File format not recognized
(not a CRIS program)
-or-
run: `/bin/sh' is not a CRIS program
The test-case is tweaked, matching both messages.
Committed, after testing on both hosts *cough*.
sim/testsuite:
* sim/cris/asm/badarch1.ms: Tweak error message match.
sim:
* cris/sim-if.c (sim_open): If sim_analyze_program fails, emit
just a short CRIS-specific notice. Tweak the wording for a
failing architecture test.
Index: testsuite/sim/cris/asm/badarch1.ms
===================================================================
RCS file: /cvs/src/src/sim/testsuite/sim/cris/asm/badarch1.ms,v
retrieving revision 1.1
diff -p -u -r1.1 badarch1.ms
--- testsuite/sim/cris/asm/badarch1.ms 30 Dec 2008 13:57:11 -0000 1.1
+++ testsuite/sim/cris/asm/badarch1.ms 30 Dec 2008 18:41:32 -0000
@@ -1,5 +1,5 @@
# mach: crisv3 crisv8 crisv10 crisv32
# xerror:
-# output: *: not a CRIS program `/bin/sh'\n
+# output: *not a CRIS program*
# sim: /bin/sh
.include "nopv32t.ms"
Index: cris/sim-if.c
===================================================================
RCS file: /cvs/src/src/sim/cris/sim-if.c,v
retrieving revision 1.7
diff -p -u -r1.7 sim-if.c
--- cris/sim-if.c 30 Dec 2008 13:10:35 -0000 1.7
+++ cris/sim-if.c 30 Dec 2008 18:41:32 -0000
@@ -688,12 +688,10 @@ sim_open (SIM_OPEN_KIND kind, host_callb
: NULL),
abfd) != SIM_RC_OK)
{
- if (STATE_PROG_ARGV (sd) != NULL)
- sim_io_eprintf (sd, "%s: invalid executable `%s'\n",
- STATE_MY_NAME (sd), *STATE_PROG_ARGV (sd));
- else
- sim_io_eprintf (sd, "%s: invalid executable\n",
- STATE_MY_NAME (sd));
+ /* When there's an error, sim_analyze_program has already output
+ a message. Let's just clarify it, as "not an object file"
+ perhaps doesn't ring a bell. */
+ sim_io_eprintf (sd, "(not a CRIS program)\n");
free_state (sd);
return 0;
}
@@ -707,7 +705,7 @@ sim_open (SIM_OPEN_KIND kind, host_callb
if (bfd_get_arch (abfd) == bfd_arch_unknown)
{
if (STATE_PROG_ARGV (sd) != NULL)
- sim_io_eprintf (sd, "%s: not a CRIS program `%s'\n",
+ sim_io_eprintf (sd, "%s: `%s' is not a CRIS program\n",
STATE_MY_NAME (sd), *STATE_PROG_ARGV (sd));
else
sim_io_eprintf (sd, "%s: program to be run is not a CRIS program\n",
brgds, H-P