From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id EC1933857822; Thu, 28 Apr 2022 02:39:17 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EC1933857822 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Simon Marchi To: gdb-cvs@sourceware.org Subject: [binutils-gdb] gdb: remove BLOCK_SUPERBLOCK macro X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 6c00f721c834e2c622eb995a58f02900b6d98574 X-Git-Newrev: f135fe728e2d0a6168a8445a50a6d63547c4db2f Message-Id: <20220428023917.EC1933857822@sourceware.org> Date: Thu, 28 Apr 2022 02:39:17 +0000 (GMT) X-BeenThere: gdb-cvs@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Apr 2022 02:39:18 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3Df135fe728e2d= 0a6168a8445a50a6d63547c4db2f commit f135fe728e2d0a6168a8445a50a6d63547c4db2f Author: Simon Marchi Date: Fri Jan 28 11:41:38 2022 -0500 gdb: remove BLOCK_SUPERBLOCK macro =20 Replace with equivalent methods. =20 Change-Id: I334a319909a50b5cc5570a45c38c70e10dc00630 Diff: --- gdb/ada-lang.c | 8 ++++---- gdb/block.c | 40 +++++++++++++++++++----------------= ---- gdb/block.h | 11 +++++++++-- gdb/blockframe.c | 6 +++--- gdb/buildsym.c | 4 ++-- gdb/compile/compile-c-symbols.c | 2 +- gdb/compile/compile-object-load.c | 4 ++-- gdb/cp-namespace.c | 4 ++-- gdb/cp-support.c | 4 ++-- gdb/d-namespace.c | 2 +- gdb/f-valprint.c | 2 +- gdb/findvar.c | 2 +- gdb/go-lang.c | 2 +- gdb/guile/scm-block.c | 14 +++++++------- gdb/guile/scm-frame.c | 2 +- gdb/inline-frame.c | 8 ++++---- gdb/jit.c | 11 ++++++----- gdb/linespec.c | 4 ++-- gdb/mdebugread.c | 12 ++++++------ gdb/mi/mi-cmd-stack.c | 2 +- gdb/python/py-block.c | 10 +++++----- gdb/python/py-frame.c | 2 +- gdb/stack.c | 2 +- gdb/symmisc.c | 6 +++--- gdb/symtab.c | 10 +++++----- gdb/tracepoint.c | 2 +- 26 files changed, 92 insertions(+), 84 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index dfcaf12104a..c06dbc2f055 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5334,7 +5334,7 @@ ada_add_local_symbols (std::vector &result, if (block->function () !=3D nullptr && is_nonfunction (result)) return; =20 - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } } =20 @@ -13040,7 +13040,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg, } if (block->function () !=3D NULL) break; - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } } =20 @@ -13662,9 +13662,9 @@ public: /* Search upwards from currently selected frame (so that we can complete on local vars. */ =20 - for (b =3D get_selected_block (0); b !=3D NULL; b =3D BLOCK_SUPERBLOCK= (b)) + for (b =3D get_selected_block (0); b !=3D NULL; b =3D b->superblock ()) { - if (!BLOCK_SUPERBLOCK (b)) + if (!b->superblock ()) surrounding_static_block =3D b; /* For elmin of dups */ =20 ALL_BLOCK_SYMBOLS (b, iter, sym) diff --git a/gdb/block.c b/gdb/block.c index b70b8e22a91..9c4ed260abb 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -82,7 +82,7 @@ contained_in (const struct block *a, const struct block *= b, except if A was inlined. */ if (!allow_nested && a->function () !=3D NULL && !block_inlined_p (a= )) return false; - a =3D BLOCK_SUPERBLOCK (a); + a =3D a->superblock (); } while (a !=3D NULL); =20 @@ -99,8 +99,8 @@ struct symbol * block_linkage_function (const struct block *bl) { while ((bl->function () =3D=3D NULL || block_inlined_p (bl)) - && BLOCK_SUPERBLOCK (bl) !=3D NULL) - bl =3D BLOCK_SUPERBLOCK (bl); + && bl->superblock () !=3D NULL) + bl =3D bl->superblock (); =20 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 () =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NULL) - bl =3D BLOCK_SUPERBLOCK (bl); + while (bl->function () =3D=3D NULL && bl->superblock () !=3D NULL) + bl =3D bl->superblock (); =20 return bl->function (); } @@ -295,7 +295,7 @@ block_for_pc (CORE_ADDR pc) const char * block_scope (const struct block *block) { - for (; block !=3D NULL; block =3D BLOCK_SUPERBLOCK (block)) + for (; block !=3D NULL; block =3D block->superblock ()) { if (BLOCK_NAMESPACE (block) !=3D NULL && BLOCK_NAMESPACE (block)->scope !=3D NULL) @@ -360,11 +360,11 @@ block_initialize_namespace (struct block *block, stru= ct obstack *obstack) const struct block * block_static_block (const struct block *block) { - if (block =3D=3D NULL || BLOCK_SUPERBLOCK (block) =3D=3D NULL) + if (block =3D=3D NULL || block->superblock () =3D=3D NULL) return NULL; =20 - while (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) !=3D NULL) - block =3D BLOCK_SUPERBLOCK (block); + while (block->superblock ()->superblock () !=3D NULL) + block =3D block->superblock (); =20 return block; } @@ -378,8 +378,8 @@ block_global_block (const struct block *block) if (block =3D=3D NULL) return NULL; =20 - while (BLOCK_SUPERBLOCK (block) !=3D NULL) - block =3D BLOCK_SUPERBLOCK (block); + while (block->superblock () !=3D NULL) + block =3D block->superblock (); =20 return block; } @@ -418,7 +418,7 @@ set_block_compunit_symtab (struct block *block, struct = compunit_symtab *cu) { struct global_block *gb; =20 - gdb_assert (BLOCK_SUPERBLOCK (block) =3D=3D NULL); + gdb_assert (block->superblock () =3D=3D NULL); gb =3D (struct global_block *) block; gdb_assert (gb->compunit_symtab =3D=3D NULL); gb->compunit_symtab =3D cu; @@ -446,7 +446,7 @@ get_block_compunit_symtab (const struct block *block) { struct global_block *gb; =20 - gdb_assert (BLOCK_SUPERBLOCK (block) =3D=3D NULL); + gdb_assert (block->superblock () =3D=3D NULL); gb =3D (struct global_block *) block; gdb_assert (gb->compunit_symtab !=3D NULL); return gb->compunit_symtab; @@ -467,15 +467,15 @@ initialize_block_iterator (const struct block *block, =20 iter->idx =3D -1; =20 - if (BLOCK_SUPERBLOCK (block) =3D=3D NULL) + if (block->superblock () =3D=3D NULL) { which =3D GLOBAL_BLOCK; cu =3D get_block_compunit_symtab (block); } - else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) =3D=3D NULL) + else if (block->superblock ()->superblock () =3D=3D NULL) { which =3D STATIC_BLOCK; - cu =3D get_block_compunit_symtab (BLOCK_SUPERBLOCK (block)); + cu =3D 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); =20 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */ - gdb_assert (BLOCK_SUPERBLOCK (block) =3D=3D NULL - || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) =3D=3D NULL); + gdb_assert (block->superblock () =3D=3D NULL + || block->superblock ()->superblock () =3D=3D NULL); =20 other =3D NULL; for (sym @@ -838,8 +838,8 @@ block_find_symbol (const struct block *block, const cha= r *name, lookup_name_info lookup_name (name, symbol_name_match_type::FULL); =20 /* Verify BLOCK is STATIC_BLOCK or GLOBAL_BLOCK. */ - gdb_assert (BLOCK_SUPERBLOCK (block) =3D=3D NULL - || BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) =3D=3D NULL); + gdb_assert (block->superblock () =3D=3D NULL + || block->superblock ()->superblock () =3D=3D NULL); =20 ALL_BLOCK_SYMBOLS_WITH_NAME (block, lookup_name, iter, sym) { diff --git a/gdb/block.h b/gdb/block.h index 0330b6de4d2..a5f931e354e 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -114,6 +114,14 @@ struct block void set_function (symbol *function) { m_function =3D function; } =20 + /* 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 =3D superblock; } + /* Addresses in the executable code that are in this block. */ =20 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. */ =20 - const struct block *superblock; + const struct block *m_superblock; =20 /* This is used to store the symbols in the block. */ =20 @@ -162,7 +170,6 @@ struct global_block struct compunit_symtab *compunit_symtab; }; =20 -#define BLOCK_SUPERBLOCK(bl) (bl)->superblock #define BLOCK_MULTIDICT(bl) (bl)->multidict #define BLOCK_NAMESPACE(bl) (bl)->namespace_info =20 diff --git a/gdb/blockframe.c b/gdb/blockframe.c index aaf76953648..cfc4fd2fd70 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -75,7 +75,7 @@ get_frame_block (struct frame_info *frame, CORE_ADDR *add= r_in_block) if (block_inlined_p (bl)) inline_count--; =20 - bl =3D BLOCK_SUPERBLOCK (bl); + bl =3D bl->superblock (); gdb_assert (bl !=3D NULL); } =20 @@ -122,8 +122,8 @@ get_frame_function (struct frame_info *frame) if (bl =3D=3D NULL) return NULL; =20 - while (bl->function () =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NULL) - bl =3D BLOCK_SUPERBLOCK (bl); + while (bl->function () =3D=3D NULL && bl->superblock () !=3D NULL) + bl =3D bl->superblock (); =20 return bl->function (); } diff --git a/gdb/buildsym.c b/gdb/buildsym.c index f761444fff4..5c5fc207d6e 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -331,7 +331,7 @@ buildsym_compunit::finish_block_internal pblock && pblock !=3D old_blocks;=20 pblock =3D pblock->next) { - if (BLOCK_SUPERBLOCK (pblock->block) =3D=3D NULL) + if (pblock->block->superblock () =3D=3D 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) =3D block; + pblock->block->set_superblock (block); } opblock =3D pblock; } diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbol= s.c index 9e13d7650dd..4c30ae98c1c 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -647,7 +647,7 @@ generate_c_for_variable_locations (compile_instance *co= mpiler, done. */ if (block->function () !=3D NULL) break; - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 return registers_used; diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object= -load.c index 89a47859c22..2835f2d73d1 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -444,13 +444,13 @@ get_out_value_type (struct symbol *func_sym, struct o= bjfile *objfile, while (function_block !=3D BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) && function_block !=3D BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) { - function_block =3D BLOCK_SUPERBLOCK (function_block); + function_block =3D function_block->superblock (); function =3D function_block->function (); if (function !=3D NULL) break; } if (function !=3D NULL - && (BLOCK_SUPERBLOCK (function_block) + && (function_block->superblock () =3D=3D BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) && symbol_matches_search_name (function, func_matcher)) break; diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index d84486e8bf7..e734effe7f0 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -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 =3D language_def (language_cplus); - const struct block *parent =3D BLOCK_SUPERBLOCK (block); + const struct block *parent =3D block->superblock (); struct symbol *sym; =20 while (1) @@ -615,7 +615,7 @@ cp_lookup_symbol_via_all_imports (const char *scope, co= nst char *name, if (sym.symbol) return sym; =20 - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 return {}; diff --git a/gdb/cp-support.c b/gdb/cp-support.c index 78015d43fe8..14fad2d453f 100644 --- a/gdb/cp-support.c +++ b/gdb/cp-support.c @@ -1400,7 +1400,7 @@ add_symbol_overload_list_using (const char *func_name, =20 for (block =3D get_selected_block (0); block !=3D NULL; - block =3D BLOCK_SUPERBLOCK (block)) + block =3D block->superblock ()) for (current =3D block_using (block); current !=3D NULL; current =3D 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. */ =20 - for (b =3D get_selected_block (0); b !=3D NULL; b =3D BLOCK_SUPERBLOCK (= b)) + for (b =3D get_selected_block (0); b !=3D NULL; b =3D b->superblock ()) add_symbol_overload_list_block (func_name, b, overload_list); =20 surrounding_static_block =3D block_static_block (get_selected_block (0)); diff --git a/gdb/d-namespace.c b/gdb/d-namespace.c index 07c22e0eae5..5af042abb11 100644 --- a/gdb/d-namespace.c +++ b/gdb/d-namespace.c @@ -491,7 +491,7 @@ d_lookup_symbol_module (const char *scope, const char *= name, if (sym.symbol !=3D NULL) return sym; =20 - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 return {}; diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index f977d8cad96..6a3f83c2194 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -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 =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 if (!values_printed) diff --git a/gdb/findvar.c b/gdb/findvar.c index 2e2b10bb625..bdc3d35c345 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -559,7 +559,7 @@ get_hosting_frame (struct symbol *var, const struct blo= ck *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 =3D BLOCK_SUPERBLOCK (frame_block); + frame_block =3D frame_block->superblock (); } =20 /* Old compilers may not provide a static link, or they may provide an diff --git a/gdb/go-lang.c b/gdb/go-lang.c index b4d85b06dd9..844f743e83d 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -433,7 +433,7 @@ go_block_package_name (const struct block *block) return NULL; } =20 - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 return NULL; diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index 1683ed1ac8a..41954c70519 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -151,9 +151,9 @@ bkscm_print_block_smob (SCM self, SCM port, scm_print_s= tate *pstate) =20 gdbscm_printf (port, "#<%s", block_smob_name); =20 - if (BLOCK_SUPERBLOCK (b) =3D=3D NULL) + if (b->superblock () =3D=3D NULL) gdbscm_printf (port, " global"); - else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (b)) =3D=3D NULL) + else if (b->superblock ()->superblock () =3D=3D NULL) gdbscm_printf (port, " static"); =20 if (b->function () !=3D NULL) @@ -421,7 +421,7 @@ gdbscm_block_superblock (SCM self) const struct block *block =3D b_smob->block; const struct block *super_block; =20 - super_block =3D BLOCK_SUPERBLOCK (block); + super_block =3D block->superblock (); =20 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 =3D b_smob->block; const struct block *static_block; =20 - if (BLOCK_SUPERBLOCK (block) =3D=3D NULL) + if (block->superblock () =3D=3D NULL) return SCM_BOOL_F; =20 static_block =3D block_static_block (block); @@ -474,7 +474,7 @@ gdbscm_block_global_p (SCM self) =3D bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct block *block =3D b_smob->block; =20 - return scm_from_bool (BLOCK_SUPERBLOCK (block) =3D=3D NULL); + return scm_from_bool (block->superblock () =3D=3D NULL); } =20 /* (block-static? ) -> boolean @@ -487,8 +487,8 @@ gdbscm_block_static_p (SCM self) =3D bkscm_get_valid_block_smob_arg_unsafe (self, SCM_ARG1, FUNC_NAME); const struct block *block =3D b_smob->block; =20 - if (BLOCK_SUPERBLOCK (block) !=3D NULL - && BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) =3D=3D NULL) + if (block->superblock () !=3D NULL + && block->superblock ()->superblock () =3D=3D NULL) return SCM_BOOL_T; return SCM_BOOL_F; } diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index f0de7c368f9..6bbb6f81d68 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -612,7 +612,7 @@ gdbscm_frame_block (SCM self) =20 for (fn_block =3D block; fn_block !=3D NULL && fn_block->function () =3D=3D NULL; - fn_block =3D BLOCK_SUPERBLOCK (fn_block)) + fn_block =3D fn_block->superblock ()) continue; =20 if (block =3D=3D NULL || fn_block =3D=3D NULL || fn_block->function () = =3D=3D NULL) diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c index 95cc80b7a1c..bd173a1d21b 100644 --- a/gdb/inline-frame.c +++ b/gdb/inline-frame.c @@ -226,14 +226,14 @@ inline_frame_sniffer (const struct frame_unwind *self, location. */ depth =3D 0; cur_block =3D frame_block; - while (BLOCK_SUPERBLOCK (cur_block)) + while (cur_block->superblock ()) { if (block_inlined_p (cur_block)) depth++; else if (cur_block->function () !=3D NULL) break; =20 - cur_block =3D BLOCK_SUPERBLOCK (cur_block); + cur_block =3D cur_block->superblock (); } =20 /* Check how many inlined functions already have frames. */ @@ -356,7 +356,7 @@ skip_inline_frames (thread_info *thread, bpstat *stop_c= hain) if (frame_block !=3D NULL) { cur_block =3D 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_c= hain) else if (cur_block->function () !=3D NULL) break; =20 - cur_block =3D BLOCK_SUPERBLOCK (cur_block); + cur_block =3D cur_block->superblock (); } } =20 diff --git a/gdb/jit.c b/gdb/jit.c index 17dfdd9ef24..1283d2edc50 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -620,7 +620,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfil= e *objfile) : allocate_block (&objfile->objfile_obstack)); BLOCK_MULTIDICT (new_block) =3D mdict_create_linear (&objfile->objfile_obstack, NULL); - BLOCK_SUPERBLOCK (new_block) =3D block_iter; + new_block->set_superblock (block_iter); block_iter =3D new_block; =20 new_block->set_start (begin); @@ -640,14 +640,15 @@ finalize_symtab (struct gdb_symtab *stab, struct objf= ile *objfile) { /* If the plugin specifically mentioned a parent block, we use that. */ - BLOCK_SUPERBLOCK (gdb_block_iter.real_block) =3D - 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) =3D - BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK); + gdb_block_iter.real_block->set_superblock + (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)); } } } diff --git a/gdb/linespec.c b/gdb/linespec.c index 90e4c813e4e..fd3fba871c5 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -1234,7 +1234,7 @@ iterate_over_file_blocks for (block =3D BLOCKVECTOR_BLOCK (symtab->compunit ()->blockvector (), STATIC_BLOCK); block !=3D NULL; - block =3D BLOCK_SUPERBLOCK (block)) + block =3D block->superblock ()) current_language->iterate_over_symbols (block, name, domain, callback); } =20 @@ -3968,7 +3968,7 @@ find_label_symbols (struct linespec_state *self, =20 for (; block && !block->function (); - block =3D BLOCK_SUPERBLOCK (block)) + block =3D block->superblock ()) ; =20 if (!block) diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 87d2fb1d477..ddf3cd58253 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -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) =3D top_stack->cur_block; + b->set_superblock (top_stack->cur_block); add_block (b, top_stack->cur_st); =20 /* 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 =3D stBlock; b =3D new_block (NON_FUNCTION_BLOCK, psymtab_language); b->set_start (sh->value + top_stack->procadr); - BLOCK_SUPERBLOCK (b) =3D top_stack->cur_block; + b->set_superblock (top_stack->cur_block); top_stack->cur_block =3D 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 =3D BLOCKVECTOR_BLOCK (bv, i); =20 - if (BLOCK_SUPERBLOCK (b_bad) =3D=3D cblock + if (b_bad->superblock () =3D=3D cblock && b_bad->start () =3D=3D top_stack->procadr && b_bad->end () =3D=3D top_stack->procadr) { @@ -4476,7 +4476,7 @@ mylookup_symbol (const char *name, const struct block= *block, return sym; } =20 - block =3D BLOCK_SUPERBLOCK (block); + block =3D 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 ob= jfile *objfile) bv =3D new_bvect (2); BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK) =3D new_block (NON_FUNCTION_BLOCK, = lang); BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK) =3D new_block (NON_FUNCTION_BLOCK, = lang); - BLOCK_SUPERBLOCK (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =3D - BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); + BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->set_superblock + (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)); cust->set_blockvector (bv); =20 cust->set_debugformat ("ECOFF"); diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index 9ae64f092a8..0fe204dbc66 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -674,7 +674,7 @@ list_args_or_locals (const frame_print_options &fp_opts, if (block->function ()) break; else - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } } =20 diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index 7ab98687387..872fb89ba83 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -146,7 +146,7 @@ blpy_get_superblock (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - super_block =3D BLOCK_SUPERBLOCK (block); + super_block =3D block->superblock (); if (super_block) return block_to_block_object (super_block, self_obj->objfile); =20 @@ -183,7 +183,7 @@ blpy_get_static_block (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - if (BLOCK_SUPERBLOCK (block) =3D=3D NULL) + if (block->superblock () =3D=3D NULL) Py_RETURN_NONE; =20 static_block =3D block_static_block (block); @@ -201,7 +201,7 @@ blpy_is_global (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - if (BLOCK_SUPERBLOCK (block)) + if (block->superblock ()) Py_RETURN_FALSE; =20 Py_RETURN_TRUE; @@ -217,8 +217,8 @@ blpy_is_static (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - if (BLOCK_SUPERBLOCK (block) !=3D NULL - && BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (block)) =3D=3D NULL) + if (block->superblock () !=3D NULL + && block->superblock ()->superblock () =3D=3D NULL) Py_RETURN_TRUE; =20 Py_RETURN_FALSE; diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index c4225c84aff..769e28c1a2c 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -293,7 +293,7 @@ frapy_block (PyObject *self, PyObject *args) =20 for (fn_block =3D block; fn_block !=3D NULL && fn_block->function () =3D=3D NULL; - fn_block =3D BLOCK_SUPERBLOCK (fn_block)) + fn_block =3D fn_block->superblock ()) ; =20 if (block =3D=3D NULL || fn_block =3D=3D NULL || fn_block->function () = =3D=3D NULL) diff --git a/gdb/stack.c b/gdb/stack.c index 35726b71398..71d85985d18 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -2275,7 +2275,7 @@ iterate_over_block_local_vars (const struct block *bl= ock, symbols. */ if (block->function ()) break; - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } } =20 diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 1dd747d5386..e49322c2a84 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -287,9 +287,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *o= utfile) 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 =3D 0; =20 - while ((block =3D BLOCK_SUPERBLOCK (block)) !=3D NULL) + while ((block =3D block->superblock ()) !=3D NULL) { i++; } diff --git a/gdb/symtab.c b/gdb/symtab.c index 58a2033f1ff..63fa9ba3196 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2026,7 +2026,7 @@ lookup_language_this (const struct language_defn *lan= g, } if (block->function ()) break; - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 if (symbol_lookup_debug > 1) @@ -2229,7 +2229,7 @@ lookup_local_symbol (const char *name, =20 if (block->function () !=3D NULL && block_inlined_p (block)) break; - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } =20 /* 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 =3D b; else if (b->function () !=3D NULL) break; - b =3D BLOCK_SUPERBLOCK (b); + b =3D b->superblock (); } if (function_block !=3D NULL && function_block->function ()->line () !=3D 0) @@ -4145,7 +4145,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, COR= E_ADDR func_addr) bl =3D NULL; break; } - bl =3D BLOCK_SUPERBLOCK (bl); + bl =3D bl->superblock (); } if (bl !=3D NULL) break; @@ -6013,7 +6013,7 @@ default_collect_symbol_completion_matches_break_on are in scope for a nested function. */ if (b->function () !=3D NULL && block_inlined_p (b)) break; - b =3D BLOCK_SUPERBLOCK (b); + b =3D b->superblock (); } =20 /* Add fields from the file's types; symbols will be added below. */ diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 76da71df038..64419436fd7 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2618,7 +2618,7 @@ info_scope_command (const char *args_in, int from_tty) if (block->function ()) break; else - block =3D BLOCK_SUPERBLOCK (block); + block =3D block->superblock (); } if (count <=3D 0) gdb_printf ("Scope for %s contains no locals or arguments.\n",