1999-01-19 Fernando Nasser <fnasser@totem.to.cygnus.com>
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index 85fd61fffd7bfffd0809b0cc5c283d72b11eaaf2..3cb00c85a48706c0ae209d98008482cc16358e6b 100644 (file)
@@ -1,6 +1,6 @@
 /* Get info from stack frames;
    convert between frames, blocks, functions and pc values.
-   Copyright 1986, 1987, 1988, 1989, 1991, 1994, 1995, 1996, 1997
+   Copyright 1986, 87, 88, 89, 91, 94, 95, 96, 97, 1998
              Free Software Foundation, Inc.
 
 This file is part of GDB.
@@ -31,6 +31,10 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.  */
 #include "inferior.h"          /* for read_pc */
 #include "annotate.h"
 
+/* Prototypes for exported functions. */
+
+void _initialize_blockframe PARAMS ((void));
+
 /* Is ADDR inside the startup file?  Note that if your machine
    has a way to detect the bottom of the stack, there is no need
    to call this function from FRAME_CHAIN_VALID; the reason for
@@ -807,14 +811,19 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
   cache_pc_function_name    = SYMBOL_NAME (msymbol);
   cache_pc_function_section = section;
 
-  /* Use the lesser of the next minimal symbol in the same section, or the end
-     of the section, as the end of the function. Step over other symbols at 
-     this same address to find the next one.  */
+  /* Use the lesser of the next minimal symbol in the same section, or
+     the end of the section, as the end of the function.  */
+  
+  /* Step over other symbols at this same address, and symbols in
+     other sections, to find the next symbol in this section with
+     a different address.  */
 
-  for (i=1; SYMBOL_NAME (msymbol+i) != NULL 
-        && (SYMBOL_VALUE_ADDRESS(msymbol+i) == SYMBOL_VALUE_ADDRESS (msymbol)
-        || SYMBOL_BFD_SECTION(msymbol+i) != section);
-       i++) /* empty */;
+  for (i=1; SYMBOL_NAME (msymbol+i) != NULL; i++)
+    {
+      if (SYMBOL_VALUE_ADDRESS (msymbol+i) != SYMBOL_VALUE_ADDRESS (msymbol) 
+         && SYMBOL_BFD_SECTION (msymbol+i) == SYMBOL_BFD_SECTION (msymbol))
+       break;
+    }
 
   if (SYMBOL_NAME (msymbol + i) != NULL
       && SYMBOL_VALUE_ADDRESS (msymbol + i) < osect->endaddr)
@@ -827,27 +836,31 @@ find_pc_sect_partial_function (pc, section, name, address, endaddr)
  return_cached_value:
 
   if (address)
-    if (pc_in_unmapped_range (pc, section))
-      *address = overlay_unmapped_address (cache_pc_function_low, section);
-    else
-      *address = cache_pc_function_low;
+    {
+      if (pc_in_unmapped_range (pc, section))
+        *address = overlay_unmapped_address (cache_pc_function_low, section);
+      else
+        *address = cache_pc_function_low;
+    }
     
   if (name)
     *name = cache_pc_function_name;
 
   if (endaddr)
-    if (pc_in_unmapped_range (pc, section))
-      {
-       /* Because the high address is actually beyond the end of
-          the function (and therefore possibly beyond the end of
-          the overlay), we must actually convert (high - 1)
-          and then add one to that. */
+    {
+      if (pc_in_unmapped_range (pc, section))
+        {
+         /* Because the high address is actually beyond the end of
+            the function (and therefore possibly beyond the end of
+            the overlay), we must actually convert (high - 1)
+            and then add one to that. */
 
-       *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1, 
-                                                section);
-      }
-    else
-      *endaddr = cache_pc_function_high;
+         *endaddr = 1 + overlay_unmapped_address (cache_pc_function_high - 1, 
+                                                  section);
+        }
+      else
+        *endaddr = cache_pc_function_high;
+    }
 
   return 1;
 }
@@ -1040,7 +1053,7 @@ generic_push_dummy_frame ()
 
   dummy_frame = dummy_frame_stack;
   while (dummy_frame)
-    if (dummy_frame->fp INNER_THAN fp) /* stale -- destroy! */
+    if (INNER_THAN (dummy_frame->fp, fp))      /* stale -- destroy! */
       {
        dummy_frame_stack = dummy_frame->next;
        free (dummy_frame);
@@ -1105,7 +1118,7 @@ generic_frame_chain_valid (fp, fi)
     return 1;   /* don't prune CALL_DUMMY frames */
   else          /* fall back to default algorithm (see frame.h) */
     return (fp != 0
-           && (fi->frame INNER_THAN fp || fi->frame == fp)
+           && (INNER_THAN (fi->frame, fp) || fi->frame == fp)
            && !inside_entry_file (FRAME_SAVED_PC(fi)));
 }
  
This page took 0.024454 seconds and 4 git commands to generate.