Use new %p format suffixes in gdb
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index f6dd861c36f9f498138892cf2b19a64e869809fd..a3f82ef5a9c76cc36ed810a0af2f9284d89a0a69 100644 (file)
@@ -1,7 +1,7 @@
 /* Get info from stack frames; convert between frames, blocks,
    functions and pc values.
 
-   Copyright (C) 1986-2018 Free Software Foundation, Inc.
+   Copyright (C) 1986-2019 Free Software Foundation, Inc.
 
    This file is part of GDB.
 
@@ -209,7 +209,7 @@ clear_pc_function_cache (void)
 
 /* See symtab.h.  */
 
-int
+bool
 find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
                          CORE_ADDR *endaddr, const struct block **block)
 {
@@ -217,7 +217,6 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
   struct symbol *f;
   struct bound_minimal_symbol msymbol;
   struct compunit_symtab *compunit_symtab = NULL;
-  struct objfile *objfile;
   CORE_ADDR mapped_pc;
 
   /* To ensure that the symbol returned belongs to the correct setion
@@ -237,18 +236,19 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
     goto return_cached_value;
 
   msymbol = lookup_minimal_symbol_by_pc_section (mapped_pc, section);
-  ALL_OBJFILES (objfile)
-  {
-    if (objfile->sf)
-      {
-       compunit_symtab
-         = objfile->sf->qf->find_pc_sect_compunit_symtab (objfile, msymbol,
-                                                          mapped_pc, section,
-                                                          0);
-      }
-    if (compunit_symtab != NULL)
-      break;
-  }
+  for (objfile *objfile : current_program_space->objfiles ())
+    {
+      if (objfile->sf)
+       {
+         compunit_symtab
+           = objfile->sf->qf->find_pc_sect_compunit_symtab (objfile, msymbol,
+                                                            mapped_pc,
+                                                            section,
+                                                            0);
+       }
+      if (compunit_symtab != NULL)
+       break;
+    }
 
   if (compunit_symtab != NULL)
     {
@@ -331,7 +331,9 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
        *address = 0;
       if (endaddr != NULL)
        *endaddr = 0;
-      return 0;
+      if (block != nullptr)
+       *block = nullptr;
+      return false;
     }
 
   cache_pc_function_low = BMSYMBOL_VALUE_ADDRESS (msymbol);
@@ -372,7 +374,7 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
   if (block != nullptr)
     *block = cache_pc_function_block;
 
-  return 1;
+  return true;
 }
 
 /* See symtab.h.  */
This page took 0.041115 seconds and 4 git commands to generate.