summaryrefslogtreecommitdiff
path: root/gdb/mn10300-tdep.c
diff options
context:
space:
mode:
authorKevin Buettner <kevinb@redhat.com>2005-09-03 01:55:26 +0000
committerKevin Buettner <kevinb@redhat.com>2005-09-03 01:55:26 +0000
commitc7d6fad9d8ca9d9897d8b9dce0416f298e5a89d8 (patch)
tree343ca129e3f822f23d37e99550ef4ba8d8a42d11 /gdb/mn10300-tdep.c
parent1d2ef346e44814a4fd427628994ced4e82dafe3e (diff)
downloadgdb-c7d6fad9d8ca9d9897d8b9dce0416f298e5a89d8.tar.gz
Make sure that a reasonable value is always returned by
mn10300_dwarf2_reg_to_regnum().
Diffstat (limited to 'gdb/mn10300-tdep.c')
-rw-r--r--gdb/mn10300-tdep.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/gdb/mn10300-tdep.c b/gdb/mn10300-tdep.c
index 532015d4049..4e9f372dfdf 100644
--- a/gdb/mn10300-tdep.c
+++ b/gdb/mn10300-tdep.c
@@ -963,7 +963,10 @@ mn10300_dwarf2_reg_to_regnum (int dwarf2)
if (dwarf2 < 0
|| dwarf2 >= ARRAY_SIZE (dwarf2_to_gdb)
|| dwarf2_to_gdb[dwarf2] == -1)
- warning (_("bogus register number in debug info: %d"), dwarf2);
+ {
+ warning (_("Bogus register number in debug info: %d"), dwarf2);
+ return 0;
+ }
return dwarf2_to_gdb[dwarf2];
}