gdb/python: Introduce gdb.lookup_static_symbols
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index 106f8a49c2b7acf579737d07fccc881c2ed6f65b..4306b5409ad1d7da64dbae86540392cdf5525420 100644 (file)
@@ -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)
 {
@@ -219,7 +219,7 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
   struct compunit_symtab *compunit_symtab = NULL;
   CORE_ADDR mapped_pc;
 
-  /* To ensure that the symbol returned belongs to the correct setion
+  /* To ensure that the symbol returned belongs to the correct section
      (and that the last [random] symbol from the previous section
      isn't returned) try to find the section containing PC.  First try
      the overlay code (which by default returns NULL); and second try
@@ -236,7 +236,7 @@ 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);
-  for (objfile *objfile : all_objfiles (current_program_space))
+  for (objfile *objfile : current_program_space->objfiles ())
     {
       if (objfile->sf)
        {
@@ -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.025185 seconds and 4 git commands to generate.