disasm: split dump_insns
[deliverable/binutils-gdb.git] / gdb / microblaze-tdep.c
index 8cc1df22d67dece6bbd707d026c2c5dbbd44c004..4bcd88d12b5776b78c206d9fd0f9d61618d878df 100644 (file)
@@ -441,7 +441,7 @@ microblaze_frame_cache (struct frame_info *next_frame, void **this_cache)
   int rn;
 
   if (*this_cache)
-    return *this_cache;
+    return (struct microblaze_frame_cache *) *this_cache;
 
   cache = microblaze_alloc_frame_cache ();
   *this_cache = cache;
@@ -638,8 +638,9 @@ static int dwarf2_to_reg_map[78] =
 static int
 microblaze_dwarf2_reg_to_regnum (struct gdbarch *gdbarch, int reg)
 {
-  gdb_assert ((size_t) reg < sizeof (dwarf2_to_reg_map));
-  return dwarf2_to_reg_map[reg];
+  if (reg >= 0 && reg < sizeof (dwarf2_to_reg_map))
+    return dwarf2_to_reg_map[reg];
+  return -1;
 }
 
 static void
This page took 0.023402 seconds and 4 git commands to generate.