* dwarf2read.c (read_str_index): Delete arg cu. All callers updated.
[deliverable/binutils-gdb.git] / gdb / block.c
index 150373005547057a63c761d182cadf0a87d7fa38..2eb07588dace3c5e7d68e4579a394ae916c1b98d 100644 (file)
@@ -1,6 +1,6 @@
 /* Block-related functions for the GNU debugger, GDB.
 
-   Copyright (C) 2003, 2007-2012 Free Software Foundation, Inc.
+   Copyright (C) 2003-2014 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -118,8 +118,13 @@ find_block_in_blockvector (struct blockvector *bl, CORE_ADDR pc)
     return addrmap_find (BLOCKVECTOR_MAP (bl), pc);
 
   /* Otherwise, use binary search to find the last block that starts
-     before PC.  */
-  bot = 0;
+     before PC.
+     Note: GLOBAL_BLOCK is block 0, STATIC_BLOCK is block 1.
+     They both have the same START,END values.
+     Historically this code would choose STATIC_BLOCK over GLOBAL_BLOCK but the
+     fact that this choice was made was subtle, now we make it explicit.  */
+  gdb_assert (BLOCKVECTOR_NBLOCKS (bl) >= 2);
+  bot = STATIC_BLOCK;
   top = BLOCKVECTOR_NBLOCKS (bl);
 
   while (top - bot > 1)
@@ -134,7 +139,7 @@ find_block_in_blockvector (struct blockvector *bl, CORE_ADDR pc)
 
   /* Now search backward for a block that ends after PC.  */
 
-  while (bot >= 0)
+  while (bot >= STATIC_BLOCK)
     {
       b = BLOCKVECTOR_BLOCK (bl, bot);
       if (BLOCK_END (b) > pc)
@@ -203,7 +208,7 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
 
   if (slot == NULL)
     {
-      struct minimal_symbol *msym = lookup_minimal_symbol_by_pc (pc);
+      struct bound_minimal_symbol msym = lookup_minimal_symbol_by_pc (pc);
 
       /* DW_TAG_gnu_call_site will be missing just if GCC could not determine
         the call target.  */
@@ -211,7 +216,8 @@ call_site_for_pc (struct gdbarch *gdbarch, CORE_ADDR pc)
                   _("DW_OP_GNU_entry_value resolving cannot find "
                     "DW_TAG_GNU_call_site %s in %s"),
                   paddress (gdbarch, pc),
-                  msym == NULL ? "???" : SYMBOL_PRINT_NAME (msym));
+                  (msym.minsym == NULL ? "???"
+                   : MSYMBOL_PRINT_NAME (msym.minsym)));
     }
 
   return *slot;
This page took 0.02419 seconds and 4 git commands to generate.