Yet more signed overflow fixes
[deliverable/binutils-gdb.git] / gdb / blockframe.c
index 8b1acab22f40ecc50701bd2f4a06d2c2c1138513..d9c28e0a0176a1d91fec1df089fdc4aa382e8672 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Local non-gdb includes.  */
-#include "annotate.h"
+#include "symtab.h"
 #include "bfd.h"
-#include "block.h"
-#include "command.h"
-#include "dummy-frame.h"
+#include "objfiles.h"
 #include "frame.h"
-#include "gdbcmd.h"
 #include "gdbcore.h"
+#include "value.h"
+#include "target.h"
 #include "inferior.h"
-#include "inline-frame.h"
-#include "objfiles.h"
+#include "annotate.h"
 #include "regcache.h"
-#include "symtab.h"
-#include "target.h"
-#include "value.h"
+#include "dummy-frame.h"
+#include "command.h"
+#include "gdbcmd.h"
+#include "block.h"
+#include "inline-frame.h"
 
 /* Return the innermost lexical block in execution in a specified
    stack frame.  The frame address is assumed valid.
@@ -211,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)
 {
@@ -221,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
@@ -271,7 +269,7 @@ find_pc_partial_function (CORE_ADDR pc, const char **name, CORE_ADDR *address,
        {
          const struct block *b = SYMBOL_BLOCK_VALUE (f);
 
-         cache_pc_function_name = SYMBOL_LINKAGE_NAME (f);
+         cache_pc_function_name = f->linkage_name ();
          cache_pc_function_section = section;
          cache_pc_function_block = b;
 
@@ -333,11 +331,13 @@ 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);
-  cache_pc_function_name = MSYMBOL_LINKAGE_NAME (msymbol.minsym);
+  cache_pc_function_name = msymbol.minsym->linkage_name ();
   cache_pc_function_section = section;
   cache_pc_function_high = minimal_symbol_upper_bound (msymbol);
   cache_pc_function_block = nullptr;
@@ -374,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.024723 seconds and 4 git commands to generate.