aboutsummaryrefslogtreecommitdiff
path: root/gdb/mep-tdep.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/mep-tdep.c')
-rw-r--r--gdb/mep-tdep.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/mep-tdep.c b/gdb/mep-tdep.c
index f7d33ca..81243b7 100644
--- a/gdb/mep-tdep.c
+++ b/gdb/mep-tdep.c
@@ -784,7 +784,9 @@ static int
mep_debug_reg_to_regnum (struct gdbarch *gdbarch, int debug_reg)
{
/* The debug info uses the raw register numbers. */
- return mep_raw_to_pseudo[debug_reg];
+ if (debug_reg >= 0 && debug_reg < ARRAY_SIZE (mep_raw_to_pseudo))
+ return mep_raw_to_pseudo[debug_reg];
+ return -1;
}