gdb: remove BLOCK_SUPERBLOCK macro
authorSimon Marchi <simon.marchi@efficios.com>
Fri, 28 Jan 2022 16:41:38 +0000 (11:41 -0500)
committerSimon Marchi <simon.marchi@polymtl.ca>
Thu, 28 Apr 2022 02:05:03 +0000 (22:05 -0400)
Replace with equivalent methods.

Change-Id: I334a319909a50b5cc5570a45c38c70e10dc00630

26 files changed:
gdb/ada-lang.c
gdb/block.c
gdb/block.h
gdb/blockframe.c
gdb/buildsym.c
gdb/compile/compile-c-symbols.c
gdb/compile/compile-object-load.c
gdb/cp-namespace.c
gdb/cp-support.c
gdb/d-namespace.c
gdb/f-valprint.c
gdb/findvar.c
gdb/go-lang.c
gdb/guile/scm-block.c
gdb/guile/scm-frame.c
gdb/inline-frame.c
gdb/jit.c
gdb/linespec.c
gdb/mdebugread.c
gdb/mi/mi-cmd-stack.c
gdb/python/py-block.c
gdb/python/py-frame.c
gdb/stack.c
gdb/symmisc.c
gdb/symtab.c
gdb/tracepoint.c

index dfcaf12104aa4a7cc28dadd401c522fe461973fc..c06dbc2f055eb85f8252f7c2ac987c18f62d2733 100644 (file)
@@ -5334,7 +5334,7 @@ ada_add_local_symbols (std::vector<struct block_symbol> &result,
       if (block->function () != nullptr && is_nonfunction (result))
        return;
 
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 }
 
@@ -13040,7 +13040,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg,
        }
       if (block->function () != NULL)
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 }
 
@@ -13662,9 +13662,9 @@ public:
     /* Search upwards from currently selected frame (so that we can
        complete on local vars.  */
 
-    for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
+    for (b = get_selected_block (0); b != NULL; b = b->superblock ())
       {
-       if (!BLOCK_SUPERBLOCK (b))
+       if (!b->superblock ())
          surrounding_static_block = b;   /* For elmin of dups */
 
        ALL_BLOCK_SYMBOLS (b, iter, sym)
index b70b8e22a91ea992d5ff305afe90ceb9b28372c2..9c4ed260abb239522a1f368bb1e8c083d58fa42a 100644 (file)
@@ -82,7 +82,7 @@ contained_in (const struct block *a, const struct block *b,
         except if A was inlined.  */
       if (!allow_nested && a->function () != NULL && !block_inlined_p (a))
        return false;
-      a = BLOCK_SUPERBLOCK (a);
+      a = a->superblock ();
     }
   while (a != NULL);
 
@@ -99,8 +99,8 @@ struct symbol *
 block_linkage_function (const struct block *bl)
 {
   while ((bl->function () == NULL || block_inlined_p (bl))
-        && BLOCK_SUPERBLOCK (bl) != NULL)
-    bl = BLOCK_SUPERBLOCK (bl);
+        && bl->superblock () != NULL)
+    bl = bl->superblock ();
 
   return bl->function ();
 }
@@ -113,8 +113,8 @@ block_linkage_function (const struct block *bl)
 struct symbol *
 block_containing_function (const struct block *bl)
 {
-  while (bl->function () == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
-    bl = BLOCK_SUPERBLOCK (bl);
+  while (bl->function () == NULL && bl->superblock () != NULL)
+    bl = bl->superblock ();
 
   return bl->function ();
 }
@@ -295,7 +295,7 @@ block_for_pc (CORE_ADDR pc)
 const char *
 block_scope (const struct block *block)
 {
-  for (; block != NULL; block = BLOCK_SUPERBLOCK (block))
+  for (; block != NULL; block = block->superblock ())
     {
       if (BLOCK_NAMESPACE (block) != NULL
          && BLOCK_NAMESPACE (block)->scope != NULL)
@@ -360,11 +360,11 @@ block_initialize_namespace (struct block *block, struct obstack *obstack)
 const struct block *
 block_static_block (const struct block *block)
 {
-  if (block == NULL || BLOCK_SUPERBLOCK (block) == NULL)
+  if (block == NULL || block->superblock () == NULL)
     return NULL;
 
-  while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) != NULL)
-    block = BLOCK_SUPERBLOCK (block);
+  while (block->superblock ()->superblock () != NULL)
+    block = block->superblock ();
 
   return block;
 }
@@ -378,8 +378,8 @@ block_global_block (const struct block *block)
   if (block == NULL)
     return NULL;
 
-  while (BLOCK_SUPERBLOCK (block) != NULL)
-    block = BLOCK_SUPERBLOCK (block);
+  while (block->superblock () != NULL)
+    block = block->superblock ();
 
   return block;
 }
@@ -418,7 +418,7 @@ set_block_compunit_symtab (struct block *block, struct compunit_symtab *cu)
 {
   struct global_block *gb;
 
-  gdb_assert (BLOCK_SUPERBLOCK (block) == NULL);
+  gdb_assert (block->superblock () == NULL);
   gb = (struct global_block *) block;
   gdb_assert (gb->compunit_symtab == NULL);
   gb->compunit_symtab = cu;
@@ -446,7 +446,7 @@ get_block_compunit_symtab (const struct block *block)
 {
   struct global_block *gb;
 
-  gdb_assert (BLOCK_SUPERBLOCK (block) == NULL);
+  gdb_assert (block->superblock () == NULL);
   gb = (struct global_block *) block;
   gdb_assert (gb->compunit_symtab != NULL);
   return gb->compunit_symtab;
@@ -467,15 +467,15 @@ initialize_block_iterator (const struct block *block,
 
   iter->idx = -1;
 
-  if (BLOCK_SUPERBLOCK (block) == NULL)
+  if (block->superblock () == NULL)
     {
       which = GLOBAL_BLOCK;
       cu = get_block_compunit_symtab (block);
     }
-  else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL)
+  else if (block->superblock ()->superblock () == NULL)
     {
       which = STATIC_BLOCK;
-      cu = get_block_compunit_symtab (BLOCK_SUPERBLOCK (block));
+      cu = get_block_compunit_symtab (block->superblock ());
     }
   else
     {
@@ -775,8 +775,8 @@ block_lookup_symbol_primary (const struct block *block, const char *name,
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
 
   /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK.  */
-  gdb_assert (BLOCK_SUPERBLOCK (block) == NULL
-             || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
+  gdb_assert (block->superblock () == NULL
+             || block->superblock ()->superblock () == NULL);
 
   other = NULL;
   for (sym
@@ -838,8 +838,8 @@ block_find_symbol (const struct block *block, const char *name,
   lookup_name_info lookup_name (name, symbol_name_match_type::FULL);
 
   /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK.  */
-  gdb_assert (BLOCK_SUPERBLOCK (block) == NULL
-             || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL);
+  gdb_assert (block->superblock () == NULL
+             || block->superblock ()->superblock () == NULL);
 
   ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym)
     {
index 0330b6de4d20957d5776f3679dc5d97b260fade5..a5f931e354ee904e1eefdcd0ec2fa3bece0378b0 100644 (file)
@@ -114,6 +114,14 @@ struct block
   void set_function (symbol *function)
   { m_function = function; }
 
+  /* Return this block's superblock.  */
+  const block *superblock () const
+  { return m_superblock; }
+
+  /* Set this block's superblock.  */
+  void set_superblock (const block *superblock)
+  { m_superblock = superblock; }
+
   /* Addresses in the executable code that are in this block.  */
 
   CORE_ADDR m_start;
@@ -130,7 +138,7 @@ struct block
      case of C) is the STATIC_BLOCK.  The superblock of the
      STATIC_BLOCK is the GLOBAL_BLOCK.  */
 
-  const struct block *superblock;
+  const struct block *m_superblock;
 
   /* This is used to store the symbols in the block.  */
 
@@ -162,7 +170,6 @@ struct global_block
   struct compunit_symtab *compunit_symtab;
 };
 
-#define BLOCK_SUPERBLOCK(bl)   (bl)->superblock
 #define BLOCK_MULTIDICT(bl)    (bl)->multidict
 #define BLOCK_NAMESPACE(bl)    (bl)->namespace_info
 
index aaf76953648a2629b3aa8677c4e67baedfdecd59..cfc4fd2fd704a5d3b6dd2b9e2d541026dc084527 100644 (file)
@@ -75,7 +75,7 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *addr_in_block)
       if (block_inlined_p (bl))
        inline_count--;
 
-      bl = BLOCK_SUPERBLOCK (bl);
+      bl = bl->superblock ();
       gdb_assert (bl != NULL);
     }
 
@@ -122,8 +122,8 @@ get_frame_function (struct frame_info *frame)
   if (bl == NULL)
     return NULL;
 
-  while (bl->function () == NULL && BLOCK_SUPERBLOCK (bl) != NULL)
-    bl = BLOCK_SUPERBLOCK (bl);
+  while (bl->function () == NULL && bl->superblock () != NULL)
+    bl = bl->superblock ();
 
   return bl->function ();
 }
index f761444fff4dd3faf84cf30da818f373e01fae79..5c5fc207d6ef80e3955a020060b484d0f8aaf63a 100644 (file)
@@ -331,7 +331,7 @@ buildsym_compunit::finish_block_internal
        pblock && pblock != old_blocks; 
        pblock = pblock->next)
     {
-      if (BLOCK_SUPERBLOCK (pblock->block) == NULL)
+      if (pblock->block->superblock () == NULL)
        {
          /* Check to be sure the blocks are nested as we receive
             them.  If the compiler/assembler/linker work, this just
@@ -365,7 +365,7 @@ buildsym_compunit::finish_block_internal
              if (pblock->block->end () > block->end ())
                pblock->block->set_end (block->end ());
            }
-         BLOCK_SUPERBLOCK (pblock->block) = block;
+         pblock->block->set_superblock (block);
        }
       opblock = pblock;
     }
index 9e13d7650ddb8a3195cbed88e666ea646341c1aa..4c30ae98c1c22991e718610744d3cf901d5f0b23 100644 (file)
@@ -647,7 +647,7 @@ generate_c_for_variable_locations (compile_instance *compiler,
         done.  */
       if (block->function () != NULL)
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   return registers_used;
index 89a47859c2207e1998c632aaaa295fd26bc13124..2835f2d73d1f296740cbacf3bc2953c71c0d45d5 100644 (file)
@@ -444,13 +444,13 @@ get_out_value_type (struct symbol *func_sym, struct objfile *objfile,
       while (function_block != BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)
             && function_block != BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK))
        {
-         function_block = BLOCK_SUPERBLOCK (function_block);
+         function_block = function_block->superblock ();
          function = function_block->function ();
          if (function != NULL)
            break;
        }
       if (function != NULL
-         && (BLOCK_SUPERBLOCK (function_block)
+         && (function_block->superblock ()
              == BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK))
          && symbol_matches_search_name (function, func_matcher))
        break;
index d84486e8bf7746fc26115755bc1e65f61a79a4e5..e734effe7f0a05a248f3a59fece8950b1357af34 100644 (file)
@@ -547,7 +547,7 @@ cp_lookup_symbol_imports_or_template (const char *scope,
          struct type *context;
          std::string name_copy (function->natural_name ());
          const struct language_defn *lang = language_def (language_cplus);
-         const struct block *parent = BLOCK_SUPERBLOCK (block);
+         const struct block *parent = block->superblock ();
          struct symbol *sym;
 
          while (1)
@@ -615,7 +615,7 @@ cp_lookup_symbol_via_all_imports (const char *scope, const char *name,
       if (sym.symbol)
        return sym;
 
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   return {};
index 78015d43fe8a94e783c046e0f71255b1a69da63b..14fad2d453feee2d1594a194832dfdc8e104bdc9 100644 (file)
@@ -1400,7 +1400,7 @@ add_symbol_overload_list_using (const char *func_name,
 
   for (block = get_selected_block (0);
        block != NULL;
-       block = BLOCK_SUPERBLOCK (block))
+       block = block->superblock ())
     for (current = block_using (block);
        current != NULL;
        current = current->next)
@@ -1451,7 +1451,7 @@ add_symbol_overload_list_qualified (const char *func_name,
   /* Search upwards from currently selected frame (so that we can
      complete on local vars.  */
 
-  for (b = get_selected_block (0); b != NULL; b = BLOCK_SUPERBLOCK (b))
+  for (b = get_selected_block (0); b != NULL; b = b->superblock ())
     add_symbol_overload_list_block (func_name, b, overload_list);
 
   surrounding_static_block = block_static_block (get_selected_block (0));
index 07c22e0eae54da4d081ff8a1e9acaeebba35c0a8..5af042abb119e2373681fa083f6765887b30d35c 100644 (file)
@@ -491,7 +491,7 @@ d_lookup_symbol_module (const char *scope, const char *name,
       if (sym.symbol != NULL)
        return sym;
 
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   return {};
index f977d8cad96614b7ae3d63e982703bc092ec2e57..6a3f83c21941bc6cce4b7e0ce70e6967ac8bce5a 100644 (file)
@@ -690,7 +690,7 @@ info_common_command (const char *comname, int from_tty)
         continue to its superblock, the block of per-file symbols.  */
       if (block->function ())
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   if (!values_printed)
index 2e2b10bb6254a3a1d38971a6c155ea3346f429e2..bdc3d35c3458c541773229804af1a684fec673e8 100644 (file)
@@ -559,7 +559,7 @@ get_hosting_frame (struct symbol *var, const struct block *var_block,
       else
        /* We must be in some function nested lexical block.  Just get the
           outer block: both must share the same frame.  */
-       frame_block = BLOCK_SUPERBLOCK (frame_block);
+       frame_block = frame_block->superblock ();
     }
 
   /* Old compilers may not provide a static link, or they may provide an
index b4d85b06dd9daf797b931956f6afacbf1d135dc5..844f743e83dc9fb8298fc95eb9beec5a65b6a7f2 100644 (file)
@@ -433,7 +433,7 @@ go_block_package_name (const struct block *block)
          return NULL;
        }
 
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   return NULL;
index 1683ed1ac8aea1cdb98304e9f430bccde785a4d2..41954c70519535681a7b58faf2bd3caf68e1bb1e 100644 (file)
@@ -151,9 +151,9 @@ bkscm_print_block_smob (SCM self, SCM port, scm_print_state *pstate)
 
   gdbscm_printf (port, "#<%s", block_smob_name);
 
-  if (BLOCK_SUPERBLOCK (b) == NULL)
+  if (b->superblock () == NULL)
     gdbscm_printf (port, " global");
-  else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (b)) == NULL)
+  else if (b->superblock ()->superblock () == NULL)
     gdbscm_printf (port, " static");
 
   if (b->function () != NULL)
@@ -421,7 +421,7 @@ gdbscm_block_superblock (SCM self)
   const struct block *block = b_smob->block;
   const struct block *super_block;
 
-  super_block = BLOCK_SUPERBLOCK (block);
+  super_block = block->superblock ();
 
   if (super_block)
     return bkscm_scm_from_block (super_block, b_smob->objfile);
@@ -456,7 +456,7 @@ gdbscm_block_static_block (SCM self)
   const struct block *block = b_smob->block;
   const struct block *static_block;
 
-  if (BLOCK_SUPERBLOCK (block) == NULL)
+  if (block->superblock () == NULL)
     return SCM_BOOL_F;
 
   static_block = block_static_block (block);
@@ -474,7 +474,7 @@ gdbscm_block_global_p (SCM self)
     = bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   const struct block *block = b_smob->block;
 
-  return scm_from_bool (BLOCK_SUPERBLOCK (block) == NULL);
+  return scm_from_bool (block->superblock () == NULL);
 }
 
 /* (block-static? <gdb:block>) -> boolean
@@ -487,8 +487,8 @@ gdbscm_block_static_p (SCM self)
     = bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME);
   const struct block *block = b_smob->block;
 
-  if (BLOCK_SUPERBLOCK (block) != NULL
-      && BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL)
+  if (block->superblock () != NULL
+      && block->superblock ()->superblock () == NULL)
     return SCM_BOOL_T;
   return SCM_BOOL_F;
 }
index f0de7c368f917b451fc977feae1497d4b1abd9be..6bbb6f81d685bb8771e7bbf1588e473775031d4a 100644 (file)
@@ -612,7 +612,7 @@ gdbscm_frame_block (SCM self)
 
   for (fn_block = block;
        fn_block != NULL && fn_block->function () == NULL;
-       fn_block = BLOCK_SUPERBLOCK (fn_block))
+       fn_block = fn_block->superblock ())
     continue;
 
   if (block == NULL || fn_block == NULL || fn_block->function () == NULL)
index 95cc80b7a1c18e9275ada1c6a52dc06295d03075..bd173a1d21b75adcdc3abfc59fb61998ebf249f1 100644 (file)
@@ -226,14 +226,14 @@ inline_frame_sniffer (const struct frame_unwind *self,
      location.  */
   depth = 0;
   cur_block = frame_block;
-  while (BLOCK_SUPERBLOCK (cur_block))
+  while (cur_block->superblock ())
     {
       if (block_inlined_p (cur_block))
        depth++;
       else if (cur_block->function () != NULL)
        break;
 
-      cur_block = BLOCK_SUPERBLOCK (cur_block);
+      cur_block = cur_block->superblock ();
     }
 
   /* Check how many inlined functions already have frames.  */
@@ -356,7 +356,7 @@ skip_inline_frames (thread_info *thread, bpstat *stop_chain)
   if (frame_block != NULL)
     {
       cur_block = frame_block;
-      while (BLOCK_SUPERBLOCK (cur_block))
+      while (cur_block->superblock ())
        {
          if (block_inlined_p (cur_block))
            {
@@ -380,7 +380,7 @@ skip_inline_frames (thread_info *thread, bpstat *stop_chain)
          else if (cur_block->function () != NULL)
            break;
 
-         cur_block = BLOCK_SUPERBLOCK (cur_block);
+         cur_block = cur_block->superblock ();
        }
     }
 
index 17dfdd9ef24f4bd0d1252df7a3fa31b3dc761cc5..1283d2edc5001dbab69962697504d7fff7a105e3 100644 (file)
--- a/gdb/jit.c
+++ b/gdb/jit.c
@@ -620,7 +620,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
                   : allocate_block (&objfile->objfile_obstack));
       BLOCK_MULTIDICT (new_block)
        = mdict_create_linear (&objfile->objfile_obstack, NULL);
-      BLOCK_SUPERBLOCK (new_block) = block_iter;
+      new_block->set_superblock (block_iter);
       block_iter = new_block;
 
       new_block->set_start (begin);
@@ -640,14 +640,15 @@ finalize_symtab (struct gdb_symtab *stab, struct objfile *objfile)
        {
          /* If the plugin specifically mentioned a parent block, we
             use that.  */
-         BLOCK_SUPERBLOCK (gdb_block_iter.real_block) =
-           gdb_block_iter.parent->real_block;
+         gdb_block_iter.real_block->set_superblock
+           (gdb_block_iter.parent->real_block);
+
        }
       else
        {
          /* And if not, we set a default parent block.  */
-         BLOCK_SUPERBLOCK (gdb_block_iter.real_block) =
-           BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK);
+         gdb_block_iter.real_block->set_superblock
+           (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK));
        }
     }
 }
index 90e4c813e4e09f2d0942fcb533b5eb558f59017c..fd3fba871c5cc46522652e8e8ae2ec8dea5c0439 100644 (file)
@@ -1234,7 +1234,7 @@ iterate_over_file_blocks
   for (block = BLOCKVECTOR_BLOCK (symtab->compunit ()->blockvector (),
                                  STATIC_BLOCK);
        block != NULL;
-       block = BLOCK_SUPERBLOCK (block))
+       block = block->superblock ())
     current_language->iterate_over_symbols (block, name, domain, callback);
 }
 
@@ -3968,7 +3968,7 @@ find_label_symbols (struct linespec_state *self,
 
       for (;
           block && !block->function ();
-          block = BLOCK_SUPERBLOCK (block))
+          block = block->superblock ())
        ;
 
       if (!block)
index 87d2fb1d477725f02384e397d8919d7b2a660814..ddf3cd582534b18aa189669e09a64aabd72eacae 100644 (file)
@@ -800,7 +800,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       b->set_function (s);
       b->set_start (sh->value);
       b->set_end (sh->value);
-      BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
+      b->set_superblock (top_stack->cur_block);
       add_block (b, top_stack->cur_st);
 
       /* Not if we only have partial info.  */
@@ -1128,7 +1128,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
       top_stack->blocktype = stBlock;
       b = new_block (NON_FUNCTION_BLOCK, psymtab_language);
       b->set_start (sh->value + top_stack->procadr);
-      BLOCK_SUPERBLOCK (b) = top_stack->cur_block;
+      b->set_superblock (top_stack->cur_block);
       top_stack->cur_block = b;
       add_block (b, top_stack->cur_st);
       break;
@@ -1172,7 +1172,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh, int bigend,
            {
              struct block *b_bad = BLOCKVECTOR_BLOCK (bv, i);
 
-             if (BLOCK_SUPERBLOCK (b_bad) == cblock
+             if (b_bad->superblock () == cblock
                  && b_bad->start () == top_stack->procadr
                  && b_bad->end () == top_stack->procadr)
                {
@@ -4476,7 +4476,7 @@ mylookup_symbol (const char *name, const struct block *block,
        return sym;
     }
 
-  block = BLOCK_SUPERBLOCK (block);
+  block = block->superblock ();
   if (block)
     return mylookup_symbol (name, block, domain, theclass);
   return 0;
@@ -4637,8 +4637,8 @@ new_symtab (const char *name, int maxlines, struct objfile *objfile)
   bv = new_bvect (2);
   BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) = new_block (NON_FUNCTION_BLOCK, lang);
   BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) = new_block (NON_FUNCTION_BLOCK, lang);
-  BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =
-    BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK);
+  BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->set_superblock
+    (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK));
   cust->set_blockvector (bv);
 
   cust->set_debugformat ("ECOFF");
index 9ae64f092a84089e773aa81d198cce374931ecaa..0fe204dbc666a0dfeb7b9af539aa91ae97d866bc 100644 (file)
@@ -674,7 +674,7 @@ list_args_or_locals (const frame_print_options &fp_opts,
       if (block->function ())
        break;
       else
-       block = BLOCK_SUPERBLOCK (block);
+       block = block->superblock ();
     }
 }
 
index 7ab98687387f3d38f57a704dbc5a05df6e828073..872fb89ba834a0bf1c85aaf571d98c8153352232 100644 (file)
@@ -146,7 +146,7 @@ blpy_get_superblock (PyObject *self, void *closure)
 
   BLPY_REQUIRE_VALID (self, block);
 
-  super_block = BLOCK_SUPERBLOCK (block);
+  super_block = block->superblock ();
   if (super_block)
     return block_to_block_object (super_block, self_obj->objfile);
 
@@ -183,7 +183,7 @@ blpy_get_static_block (PyObject *self, void *closure)
 
   BLPY_REQUIRE_VALID (self, block);
 
-  if (BLOCK_SUPERBLOCK (block) == NULL)
+  if (block->superblock () == NULL)
     Py_RETURN_NONE;
 
   static_block = block_static_block (block);
@@ -201,7 +201,7 @@ blpy_is_global (PyObject *self, void *closure)
 
   BLPY_REQUIRE_VALID (self, block);
 
-  if (BLOCK_SUPERBLOCK (block))
+  if (block->superblock ())
     Py_RETURN_FALSE;
 
   Py_RETURN_TRUE;
@@ -217,8 +217,8 @@ blpy_is_static (PyObject *self, void *closure)
 
   BLPY_REQUIRE_VALID (self, block);
 
-  if (BLOCK_SUPERBLOCK (block) != NULL
-     && BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) == NULL)
+  if (block->superblock () != NULL
+     && block->superblock ()->superblock () == NULL)
     Py_RETURN_TRUE;
 
   Py_RETURN_FALSE;
index c4225c84affc3a4bff09cb56e22debb3351ed1a8..769e28c1a2c361c0eac3662a3d100a11f0b76dc5 100644 (file)
@@ -293,7 +293,7 @@ frapy_block (PyObject *self, PyObject *args)
 
   for (fn_block = block;
        fn_block != NULL && fn_block->function () == NULL;
-       fn_block = BLOCK_SUPERBLOCK (fn_block))
+       fn_block = fn_block->superblock ())
     ;
 
   if (block == NULL || fn_block == NULL || fn_block->function () == NULL)
index 35726b71398226ab426b51a0ef5c4f26544f669d..71d85985d18c0706f221c04b4e146f286996329d 100644 (file)
@@ -2275,7 +2275,7 @@ iterate_over_block_local_vars (const struct block *block,
         symbols.  */
       if (block->function ())
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 }
 
index 1dd747d5386ddc6e2b2a0cdb7ea9d201bb646e27..e49322c2a84ac68951817ebd3d606d99178f8ece 100644 (file)
@@ -287,9 +287,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *outfile)
          gdb_printf (outfile, "%*sblock #%03d, object at %s",
                      depth, "", i,
                      host_address_to_string (b));
-         if (BLOCK_SUPERBLOCK (b))
+         if (b->superblock ())
            gdb_printf (outfile, " under %s",
-                       host_address_to_string (BLOCK_SUPERBLOCK (b)));
+                       host_address_to_string (b->superblock ()));
          /* drow/2002-07-10: We could save the total symbols count
             even if we're using a hashtable, but nothing else but this message
             wants it.  */
@@ -939,7 +939,7 @@ block_depth (const struct block *block)
 {
   int i = 0;
 
-  while ((block = BLOCK_SUPERBLOCK (block)) != NULL)
+  while ((block = block->superblock ()) != NULL)
     {
       i++;
     }
index 58a2033f1ff995d87b79de3cb0705c375b1cbdc5..63fa9ba3196e6c90809b056d3e5190ca3027f0c0 100644 (file)
@@ -2026,7 +2026,7 @@ lookup_language_this (const struct language_defn *lang,
        }
       if (block->function ())
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   if (symbol_lookup_debug > 1)
@@ -2229,7 +2229,7 @@ lookup_local_symbol (const char *name,
 
       if (block->function () != NULL && block_inlined_p (block))
        break;
-      block = BLOCK_SUPERBLOCK (block);
+      block = block->superblock ();
     }
 
   /* We've reached the end of the function without finding a result.  */
@@ -4046,7 +4046,7 @@ skip_prologue_sal (struct symtab_and_line *sal)
        function_block = b;
       else if (b->function () != NULL)
        break;
-      b = BLOCK_SUPERBLOCK (b);
+      b = b->superblock ();
     }
   if (function_block != NULL
       && function_block->function ()->line () != 0)
@@ -4145,7 +4145,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, CORE_ADDR func_addr)
                  bl = NULL;
                  break;
                }
-             bl = BLOCK_SUPERBLOCK (bl);
+             bl = bl->superblock ();
            }
          if (bl != NULL)
            break;
@@ -6013,7 +6013,7 @@ default_collect_symbol_completion_matches_break_on
           are in scope for a nested function.  */
        if (b->function () != NULL && block_inlined_p (b))
          break;
-       b = BLOCK_SUPERBLOCK (b);
+       b = b->superblock ();
       }
 
   /* Add fields from the file's types; symbols will be added below.  */
index 76da71df0380bed813639eae6cfa85f649650c23..64419436fd740c10fbe48a137ff2a25a7b3fc1ed 100644 (file)
@@ -2618,7 +2618,7 @@ info_scope_command (const char *args_in, int from_tty)
       if (block->function ())
        break;
       else
-       block = BLOCK_SUPERBLOCK (block);
+       block = block->superblock ();
     }
   if (count <= 0)
     gdb_printf ("Scope for %s contains no locals or arguments.\n",