Tue Sep 28 09:45:38 1993 Peter Schauer (pes@regent.e-technik.tu-muenchen.de)
[deliverable/binutils-gdb.git] / gdb / mips-tdep.c
index d2d712aff718548a396d4aae91a67cd581b9ff55..82371aaecc3ffe68ccc286134ce345c6710c78ee 100644 (file)
@@ -341,8 +341,22 @@ mips_frame_chain(frame)
       return 0;
 
     cached_proc_desc = proc_desc;
-    return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
-      + PROC_FRAME_OFFSET(proc_desc);
+
+    /* If no frame pointer and frame size is zero, we must be at end
+       of stack (or otherwise hosed).  If we don't check frame size,
+       we loop forever if we see a zero size frame.  */
+    if (PROC_FRAME_REG (proc_desc) == SP_REGNUM
+       && PROC_FRAME_OFFSET (proc_desc) == 0
+       /* Frameless functions, which can happen on the innermost frame
+          or a frame which was innermost when a signal happened, can
+          have frame size zero.  No need to check for non-frameless
+          functions in these situations, though (I don't think).  */
+       && frame->next != NULL
+       && !frame->next->signal_handler_caller)
+      return 0;
+    else
+      return read_next_frame_reg(frame, PROC_FRAME_REG(proc_desc))
+       + PROC_FRAME_OFFSET(proc_desc);
 }
 
 void
@@ -913,7 +927,7 @@ mips_store_return_value (valtype, valbuf)
   write_register_bytes(REGISTER_BYTE (regnum), raw_buffer, TYPE_LENGTH (valtype));
 }
 
-static void reinit_frame_cache_sfunc PARAMS ((char *, int
+static void reinit_frame_cache_sfunc PARAMS ((char *, int,
                                              struct cmd_list_element *));
 
 /* Just like reinit_frame_cache, but with the right arguments to be
@@ -943,7 +957,10 @@ Turn off to avoid using floating point instructions when calling functions\n\
 or dealing with return values.", &setlist),
      &showlist);
 
-  c = add_set_cmd ("heuristic-fence-post", class_support, var_uinteger,
+  /* We really would like to have both "0" and "unlimited" work, but
+     command.c doesn't deal with that.  So make it a var_zinteger
+     because the user can always use "999999" or some such for unlimited.  */
+  c = add_set_cmd ("heuristic-fence-post", class_support, var_zinteger,
                   (char *) &heuristic_fence_post,
                   "\
 Set the distance searched for the start of a function.\n\
This page took 0.048306 seconds and 4 git commands to generate.