* breakpoint.c, breakpoint.h (breakpoint_init_inferior): New function
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index 6430cba7b921b6f4a8a3f2e733629bcac1fc0867..7acbf6a41f22f895b00b955101a090714973a405 100644 (file)
@@ -45,6 +45,12 @@ inside_entry_file (addr)
     return 1;
   if (symfile_objfile == 0)
     return 0;
+#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+  /* Do not stop backtracing if the pc is in the call dummy
+     at the entry point.  */
+  if (PC_IN_CALL_DUMMY (addr, 0, 0))
+    return 0;
+#endif
   return (addr >= symfile_objfile -> ei.entry_file_lowpc &&
          addr <  symfile_objfile -> ei.entry_file_highpc);
 }
@@ -85,6 +91,12 @@ CORE_ADDR pc;
     return 1;
   if (symfile_objfile == 0)
     return 0;
+#if CALL_DUMMY_LOCATION == AT_ENTRY_POINT
+  /* Do not stop backtracing if the pc is in the call dummy
+     at the entry point.  */
+  if (PC_IN_CALL_DUMMY (pc, 0, 0))
+    return 0;
+#endif
   return (symfile_objfile -> ei.entry_func_lowpc  <= pc &&
          symfile_objfile -> ei.entry_func_highpc > pc);
 }
@@ -186,10 +198,17 @@ flush_cached_frames ()
 void
 reinit_frame_cache ()
 {
-  FRAME fr = current_frame;
   flush_cached_frames ();
-  if (fr)
-    set_current_frame ( create_new_frame (read_fp (), read_pc ()));
+  if (target_has_stack)
+    {
+      set_current_frame (create_new_frame (read_fp (), read_pc ()));
+      select_frame (get_current_frame (), 0);
+    }
+  else
+    {
+      set_current_frame (0);
+      select_frame ((FRAME) 0, -1);
+    }
 }
 
 /* Return a structure containing various interesting information
@@ -262,7 +281,7 @@ struct frame_info *
 get_prev_frame_info (next_frame)
      FRAME next_frame;
 {
-  FRAME_ADDR address;
+  FRAME_ADDR address = 0;
   struct frame_info *prev;
   int fromleaf = 0;
   char *name;
@@ -646,23 +665,26 @@ find_pc_partial_function (pc, name, address, endaddr)
              goto return_cached_value;
            }
        }
-
-      /* Now that static symbols go in the minimal symbol table, perhaps
-        we could just ignore the partial symbols.  But at least for now
-        we use the partial or minimal symbol, whichever is larger.  */
-      psb = find_pc_psymbol (pst, pc);
-
-      if (psb
-         && (msymbol == NULL ||
-             (SYMBOL_VALUE_ADDRESS (psb) >= SYMBOL_VALUE_ADDRESS (msymbol))))
+      else
        {
-         /* This case isn't being cached currently. */
-         if (address)
-           *address = SYMBOL_VALUE_ADDRESS (psb);
-         if (name)
-           *name = SYMBOL_NAME (psb);
-         /* endaddr non-NULL can't happen here.  */
-         return 1;
+         /* Now that static symbols go in the minimal symbol table, perhaps
+            we could just ignore the partial symbols.  But at least for now
+            we use the partial or minimal symbol, whichever is larger.  */
+         psb = find_pc_psymbol (pst, pc);
+
+         if (psb
+             && (msymbol == NULL ||
+                 (SYMBOL_VALUE_ADDRESS (psb)
+                  >= SYMBOL_VALUE_ADDRESS (msymbol))))
+           {
+             /* This case isn't being cached currently. */
+             if (address)
+               *address = SYMBOL_VALUE_ADDRESS (psb);
+             if (name)
+               *name = SYMBOL_NAME (psb);
+             /* endaddr non-NULL can't happen here.  */
+             return 1;
+           }
        }
     }
 
@@ -725,7 +747,7 @@ find_pc_partial_function (pc, name, address, endaddr)
 }
 
 /* Return the innermost stack frame executing inside of BLOCK,
-   or zero if there is no such frame.  If BLOCK is NULL, just return NULL.  */
+   or NULL if there is no such frame.  If BLOCK is NULL, just return NULL.  */
 
 FRAME
 block_innermost_frame (block)
@@ -733,12 +755,15 @@ block_innermost_frame (block)
 {
   struct frame_info *fi;
   register FRAME frame;
-  register CORE_ADDR start = BLOCK_START (block);
-  register CORE_ADDR end = BLOCK_END (block);
+  register CORE_ADDR start;
+  register CORE_ADDR end;
 
   if (block == NULL)
     return NULL;
 
+  start = BLOCK_START (block);
+  end = BLOCK_END (block);
+
   frame = 0;
   while (1)
     {
This page took 0.024814 seconds and 4 git commands to generate.