aboutsummaryrefslogtreecommitdiff
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
commit154b82dc7a655809172117d0f7d669b589b2e594 (patch)
tree7336d1209d2a2f3a048a5212a7fe4b33155985bb
parent52f0b832d7b4afcd85f54b6e6390881c7a8f586b (diff)
downloadgdb-154b82dc7a655809172117d0f7d669b589b2e594.zip
gdb-154b82dc7a655809172117d0f7d669b589b2e594.tar.gz
gdb-154b82dc7a655809172117d0f7d669b589b2e594.tar.bz2
Make sure that a reasonable value is always returned by
mn10300_dwarf2_reg_to_regnum().
-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 532015d..4e9f372 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];
}