Add two convenience methods to block
[binutils-gdb.git] / gdb / findvar.c
index 806f41d0afa202fd1bdbb4cb828204ddd89f011f..1079b85df825eaecbfa063257271247e99870f00 100644 (file)
@@ -25,7 +25,7 @@
 #include "gdbcore.h"
 #include "inferior.h"
 #include "target.h"
-#include "symfile.h"           /* for overlay functions */
+#include "symfile.h"
 #include "regcache.h"
 #include "user-regs.h"
 #include "block.h"
@@ -460,8 +460,7 @@ get_hosting_frame (struct symbol *var, const struct block *var_block,
      tests that embed global/static symbols with null location lists.
      We want to get <optimized out> instead of <frame required> when evaluating
      them so return a frame instead of raising an error.  */
-  else if (var_block == var_block->global_block ()
-          || var_block == var_block->static_block ())
+  else if (var_block->is_global_block () || var_block->is_static_block ())
     return frame;
 
   /* We have to handle the "my_func::my_local_var" notation.  This requires us
@@ -486,7 +485,7 @@ get_hosting_frame (struct symbol *var, const struct block *var_block,
 
       /* If we failed to find the proper frame, fallback to the heuristic
         method below.  */
-      else if (frame_block == frame_block->global_block ())
+      else if (frame_block->is_global_block ())
        {
          frame = NULL;
          break;
@@ -498,7 +497,7 @@ get_hosting_frame (struct symbol *var, const struct block *var_block,
       else if (frame_block->function ())
        {
          const struct dynamic_prop *static_link
-           = block_static_link (frame_block);
+           = frame_block->static_link ();
          int could_climb_up = 0;
 
          if (static_link != NULL)
@@ -754,9 +753,9 @@ language_defn::read_var_value (struct symbol *var,
           a TLS variable. */
        if (obj_section == NULL
            || (obj_section->the_bfd_section->flags & SEC_THREAD_LOCAL) != 0)
-          addr = bmsym.minsym->value_raw_address ();
+         addr = CORE_ADDR (bmsym.minsym->unrelocated_address ());
        else
-          addr = bmsym.value_address ();
+         addr = bmsym.value_address ();
        if (overlay_debugging)
          addr = symbol_overlayed_address (addr, obj_section);
        /* Determine address of TLS variable. */