From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id DAD603858405; Thu, 28 Apr 2022 02:39:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org DAD603858405 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_FUNCTION macro X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: 4b8791e10e574d3279e6783b58556893b0c92853 X-Git-Newrev: 6c00f721c834e2c622eb995a58f02900b6d98574 Message-Id: <20220428023912.DAD603858405@sourceware.org> Date: Thu, 28 Apr 2022 02:39:12 +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:13 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D6c00f721c834= e2c622eb995a58f02900b6d98574 commit 6c00f721c834e2c622eb995a58f02900b6d98574 Author: Simon Marchi Date: Fri Jan 28 11:19:50 2022 -0500 gdb: remove BLOCK_FUNCTION macro =20 Replace with equivalent methods. =20 Change-Id: I31ec00f5bf85335c8b23d306ca0fe0b84d489101 Diff: --- gdb/ada-lang.c | 4 ++-- gdb/block.c | 24 ++++++++++++------------ gdb/block.h | 11 +++++++++-- gdb/blockframe.c | 4 ++-- gdb/buildsym.c | 14 ++++++-------- gdb/compile/compile-c-symbols.c | 2 +- gdb/compile/compile-object-load.c | 4 ++-- gdb/cp-namespace.c | 2 +- gdb/f-valprint.c | 2 +- gdb/findvar.c | 8 ++++---- gdb/go-lang.c | 2 +- gdb/guile/scm-block.c | 6 +++--- gdb/guile/scm-frame.c | 6 +++--- gdb/inline-frame.c | 6 +++--- gdb/jit.c | 2 +- gdb/linespec.c | 4 ++-- gdb/mdebugread.c | 2 +- gdb/mi/mi-cmd-stack.c | 2 +- gdb/python/py-block.c | 2 +- gdb/python/py-frame.c | 6 +++--- gdb/stack.c | 2 +- gdb/symmisc.c | 8 ++++---- gdb/symtab.c | 18 +++++++++--------- gdb/tracepoint.c | 2 +- 24 files changed, 74 insertions(+), 69 deletions(-) diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c index bb9a16f8fe0..dfcaf12104a 100644 --- a/gdb/ada-lang.c +++ b/gdb/ada-lang.c @@ -5331,7 +5331,7 @@ ada_add_local_symbols (std::vector &result, /* If we found a non-function match, assume that's the one. We only check this when finding a function boundary, so that we can accumulate all results from intervening blocks first. */ - if (BLOCK_FUNCTION (block) !=3D nullptr && is_nonfunction (result)) + if (block->function () !=3D nullptr && is_nonfunction (result)) return; =20 block =3D BLOCK_SUPERBLOCK (block); @@ -13038,7 +13038,7 @@ ada_add_exceptions_from_frame (compiled_regex *preg, } } } - if (BLOCK_FUNCTION (block) !=3D NULL) + if (block->function () !=3D NULL) break; block =3D BLOCK_SUPERBLOCK (block); } diff --git a/gdb/block.c b/gdb/block.c index a4678ca6a84..b70b8e22a91 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -47,8 +47,8 @@ block_objfile (const struct block *block) { const struct global_block *global_block; =20 - if (BLOCK_FUNCTION (block) !=3D NULL) - return BLOCK_FUNCTION (block)->objfile (); + if (block->function () !=3D nullptr) + return block->function ()->objfile (); =20 global_block =3D (struct global_block *) block_global_block (block); return global_block->compunit_symtab->objfile (); @@ -59,8 +59,8 @@ block_objfile (const struct block *block) struct gdbarch * block_gdbarch (const struct block *block) { - if (BLOCK_FUNCTION (block) !=3D NULL) - return BLOCK_FUNCTION (block)->arch (); + if (block->function () !=3D nullptr) + return block->function ()->arch (); =20 return block_objfile (block)->arch (); } @@ -80,7 +80,7 @@ contained_in (const struct block *a, const struct block *= b, return true; /* If A is a function block, then A cannot be contained in B, except if A was inlined. */ - if (!allow_nested && BLOCK_FUNCTION (a) !=3D NULL && !block_inlined_= p (a)) + if (!allow_nested && a->function () !=3D NULL && !block_inlined_p (a= )) return false; a =3D BLOCK_SUPERBLOCK (a); } @@ -98,11 +98,11 @@ contained_in (const struct block *a, const struct block= *b, struct symbol * block_linkage_function (const struct block *bl) { - while ((BLOCK_FUNCTION (bl) =3D=3D NULL || block_inlined_p (bl)) + while ((bl->function () =3D=3D NULL || block_inlined_p (bl)) && BLOCK_SUPERBLOCK (bl) !=3D NULL) bl =3D BLOCK_SUPERBLOCK (bl); =20 - return BLOCK_FUNCTION (bl); + return bl->function (); } =20 /* Return the symbol for the function which contains a specified @@ -113,10 +113,10 @@ block_linkage_function (const struct block *bl) struct symbol * block_containing_function (const struct block *bl) { - while (BLOCK_FUNCTION (bl) =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NUL= L) + while (bl->function () =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NULL) bl =3D BLOCK_SUPERBLOCK (bl); =20 - return BLOCK_FUNCTION (bl); + return bl->function (); } =20 /* Return one if BL represents an inlined function. */ @@ -124,7 +124,7 @@ block_containing_function (const struct block *bl) int block_inlined_p (const struct block *bl) { - return BLOCK_FUNCTION (bl) !=3D NULL && BLOCK_FUNCTION (bl)->is_inlined = (); + return bl->function () !=3D NULL && bl->function ()->is_inlined (); } =20 /* A helper function that checks whether PC is in the blockvector BL. @@ -433,7 +433,7 @@ block_static_link (const struct block *block) =20 /* Only objfile-owned blocks that materialize top function scopes can ha= ve static links. */ - if (objfile =3D=3D NULL || BLOCK_FUNCTION (block) =3D=3D NULL) + if (objfile =3D=3D NULL || block->function () =3D=3D NULL) return NULL; =20 return (struct dynamic_prop *) objfile_lookup_static_link (objfile, bloc= k); @@ -714,7 +714,7 @@ block_lookup_symbol (const struct block *block, const c= har *name, =20 lookup_name_info lookup_name (name, match_type); =20 - if (!BLOCK_FUNCTION (block)) + if (!block->function ()) { struct symbol *other =3D NULL; =20 diff --git a/gdb/block.h b/gdb/block.h index 7fe982407f8..0330b6de4d2 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -106,6 +106,14 @@ struct block void set_end (CORE_ADDR end) { m_end =3D end; } =20 + /* Return this block's function symbol. */ + symbol *function () const + { return m_function; } + + /* Set this block's function symbol. */ + void set_function (symbol *function) + { m_function =3D function; } + /* Addresses in the executable code that are in this block. */ =20 CORE_ADDR m_start; @@ -114,7 +122,7 @@ struct block /* The symbol that names this block, if the block is the body of a function (real or inlined); otherwise, zero. */ =20 - struct symbol *function; + struct symbol *m_function; =20 /* The `struct block' for the containing block, or 0 if none. =20 @@ -154,7 +162,6 @@ struct global_block struct compunit_symtab *compunit_symtab; }; =20 -#define BLOCK_FUNCTION(bl) (bl)->function #define BLOCK_SUPERBLOCK(bl) (bl)->superblock #define BLOCK_MULTIDICT(bl) (bl)->multidict #define BLOCK_NAMESPACE(bl) (bl)->namespace_info diff --git a/gdb/blockframe.c b/gdb/blockframe.c index fec7f053057..aaf76953648 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -122,10 +122,10 @@ get_frame_function (struct frame_info *frame) if (bl =3D=3D NULL) return NULL; =20 - while (BLOCK_FUNCTION (bl) =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NUL= L) + while (bl->function () =3D=3D NULL && BLOCK_SUPERBLOCK (bl) !=3D NULL) bl =3D BLOCK_SUPERBLOCK (bl); =20 - return BLOCK_FUNCTION (bl); + return bl->function (); } =0C =20 diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 7db9f344177..f761444fff4 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -244,7 +244,7 @@ buildsym_compunit::finish_block_internal struct type *ftype =3D symbol->type (); struct mdict_iterator miter; symbol->set_value_block (block); - BLOCK_FUNCTION (block) =3D symbol; + block->set_function (symbol); =20 if (ftype->num_fields () <=3D 0) { @@ -287,9 +287,7 @@ buildsym_compunit::finish_block_internal } } else - { - BLOCK_FUNCTION (block) =3D NULL; - } + block->set_function (nullptr); =20 if (static_link !=3D NULL) objfile_register_static_link (m_objfile, block, static_link); @@ -342,7 +340,7 @@ buildsym_compunit::finish_block_internal Skip blocks which correspond to a function; they're not physically nested inside this other blocks, only lexically nested. */ - if (BLOCK_FUNCTION (pblock->block) =3D=3D NULL + if (pblock->block->function () =3D=3D NULL && (pblock->block->start () < block->start () || pblock->block->end () > block->end ())) { @@ -1008,9 +1006,9 @@ buildsym_compunit::end_compunit_symtab_with_blockvect= or =20 /* Inlined functions may have symbols not in the global or static symbol lists. */ - if (BLOCK_FUNCTION (block) !=3D NULL) - if (BLOCK_FUNCTION (block)->symtab () =3D=3D NULL) - BLOCK_FUNCTION (block)->set_symtab (symtab); + if (block->function () !=3D nullptr + && block->function ()->symtab () =3D=3D nullptr) + block->function ()->set_symtab (symtab); =20 /* Note that we only want to fix up symbols from the local blocks, not blocks coming from included symtabs. That is why diff --git a/gdb/compile/compile-c-symbols.c b/gdb/compile/compile-c-symbol= s.c index d49ecdab92f..9e13d7650dd 100644 --- a/gdb/compile/compile-c-symbols.c +++ b/gdb/compile/compile-c-symbols.c @@ -645,7 +645,7 @@ generate_c_for_variable_locations (compile_instance *co= mpiler, =20 /* If we just finished the outermost block of a function, we're done. */ - if (BLOCK_FUNCTION (block) !=3D NULL) + if (block->function () !=3D NULL) break; block =3D BLOCK_SUPERBLOCK (block); } diff --git a/gdb/compile/compile-object-load.c b/gdb/compile/compile-object= -load.c index 2303381b49a..89a47859c22 100644 --- a/gdb/compile/compile-object-load.c +++ b/gdb/compile/compile-object-load.c @@ -431,7 +431,7 @@ get_out_value_type (struct symbol *func_sym, struct obj= file *objfile, const struct block *function_block; =20 block =3D BLOCKVECTOR_BLOCK (bv, block_loop); - if (BLOCK_FUNCTION (block) !=3D NULL) + if (block->function () !=3D NULL) continue; gdb_val_sym =3D block_lookup_symbol (block, COMPILE_I_EXPR_VAL, @@ -445,7 +445,7 @@ get_out_value_type (struct symbol *func_sym, struct obj= file *objfile, && function_block !=3D BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) { function_block =3D BLOCK_SUPERBLOCK (function_block); - function =3D BLOCK_FUNCTION (function_block); + function =3D function_block->function (); if (function !=3D NULL) break; } diff --git a/gdb/cp-namespace.c b/gdb/cp-namespace.c index b0fa33705ee..d84486e8bf7 100644 --- a/gdb/cp-namespace.c +++ b/gdb/cp-namespace.c @@ -504,7 +504,7 @@ cp_lookup_symbol_imports_or_template (const char *scope, const struct block *block, const domain_enum domain) { - struct symbol *function =3D BLOCK_FUNCTION (block); + struct symbol *function =3D block->function (); struct block_symbol result; =20 if (symbol_lookup_debug) diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c index 4f95b224d73..f977d8cad96 100644 --- a/gdb/f-valprint.c +++ b/gdb/f-valprint.c @@ -688,7 +688,7 @@ info_common_command (const char *comname, int from_tty) info_common_command_for_block (block, comname, &values_printed); /* After handling the function's top-level block, stop. Don't continue to its superblock, the block of per-file symbols. */ - if (BLOCK_FUNCTION (block)) + if (block->function ()) break; block =3D BLOCK_SUPERBLOCK (block); } diff --git a/gdb/findvar.c b/gdb/findvar.c index 067fb3f6757..2e2b10bb625 100644 --- a/gdb/findvar.c +++ b/gdb/findvar.c @@ -534,7 +534,7 @@ get_hosting_frame (struct symbol *var, const struct blo= ck *var_block, /* Assuming we have a block for this frame: if we are at the function level, the immediate upper lexical block is in an outer function: follow the static link. */ - else if (BLOCK_FUNCTION (frame_block)) + else if (frame_block->function ()) { const struct dynamic_prop *static_link =3D block_static_link (frame_block); @@ -571,11 +571,11 @@ get_hosting_frame (struct symbol *var, const struct b= lock *var_block, frame =3D block_innermost_frame (var_block); if (frame =3D=3D NULL) { - if (BLOCK_FUNCTION (var_block) + if (var_block->function () && !block_inlined_p (var_block) - && BLOCK_FUNCTION (var_block)->print_name ()) + && var_block->function ()->print_name ()) error (_("No frame is currently executing in block %s."), - BLOCK_FUNCTION (var_block)->print_name ()); + var_block->function ()->print_name ()); else error (_("No frame is currently executing in specified" " block")); diff --git a/gdb/go-lang.c b/gdb/go-lang.c index 74b8b214abb..b4d85b06dd9 100644 --- a/gdb/go-lang.c +++ b/gdb/go-lang.c @@ -418,7 +418,7 @@ go_block_package_name (const struct block *block) { while (block !=3D NULL) { - struct symbol *function =3D BLOCK_FUNCTION (block); + struct symbol *function =3D block->function (); =20 if (function !=3D NULL) { diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index 921225dcf47..1683ed1ac8a 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -156,8 +156,8 @@ bkscm_print_block_smob (SCM self, SCM port, scm_print_s= tate *pstate) else if (BLOCK_SUPERBLOCK (BLOCK_SUPERBLOCK (b)) =3D=3D NULL) gdbscm_printf (port, " static"); =20 - if (BLOCK_FUNCTION (b) !=3D NULL) - gdbscm_printf (port, " %s", BLOCK_FUNCTION (b)->print_name ()); + if (b->function () !=3D NULL) + gdbscm_printf (port, " %s", b->function ()->print_name ()); =20 gdbscm_printf (port, " %s-%s", hex_string (b->start ()), hex_string (b->end ())); @@ -404,7 +404,7 @@ gdbscm_block_function (SCM self) const struct block *block =3D b_smob->block; struct symbol *sym; =20 - sym =3D BLOCK_FUNCTION (block); + sym =3D block->function (); =20 if (sym !=3D NULL) return syscm_scm_from_symbol (sym); diff --git a/gdb/guile/scm-frame.c b/gdb/guile/scm-frame.c index e53c8602322..f0de7c368f9 100644 --- a/gdb/guile/scm-frame.c +++ b/gdb/guile/scm-frame.c @@ -611,11 +611,11 @@ gdbscm_frame_block (SCM self) } =20 for (fn_block =3D block; - fn_block !=3D NULL && BLOCK_FUNCTION (fn_block) =3D=3D NULL; + fn_block !=3D NULL && fn_block->function () =3D=3D NULL; fn_block =3D BLOCK_SUPERBLOCK (fn_block)) continue; =20 - if (block =3D=3D NULL || fn_block =3D=3D NULL || BLOCK_FUNCTION (fn_bloc= k) =3D=3D NULL) + if (block =3D=3D NULL || fn_block =3D=3D NULL || fn_block->function () = =3D=3D NULL) { scm_misc_error (FUNC_NAME, _("cannot find block for frame"), scm_list_1 (self)); @@ -624,7 +624,7 @@ gdbscm_frame_block (SCM self) if (block !=3D NULL) { return bkscm_scm_from_block - (block, BLOCK_FUNCTION (fn_block)->objfile ()); + (block, fn_block->function ()->objfile ()); } =20 return SCM_BOOL_F; diff --git a/gdb/inline-frame.c b/gdb/inline-frame.c index bcdf36cd067..95cc80b7a1c 100644 --- a/gdb/inline-frame.c +++ b/gdb/inline-frame.c @@ -230,7 +230,7 @@ inline_frame_sniffer (const struct frame_unwind *self, { if (block_inlined_p (cur_block)) depth++; - else if (BLOCK_FUNCTION (cur_block) !=3D NULL) + else if (cur_block->function () !=3D NULL) break; =20 cur_block =3D BLOCK_SUPERBLOCK (cur_block); @@ -372,12 +372,12 @@ skip_inline_frames (thread_info *thread, bpstat *stop= _chain) break; =20 skip_count++; - skipped_syms.push_back (BLOCK_FUNCTION (cur_block)); + skipped_syms.push_back (cur_block->function ()); } else break; } - else if (BLOCK_FUNCTION (cur_block) !=3D NULL) + else if (cur_block->function () !=3D NULL) break; =20 cur_block =3D BLOCK_SUPERBLOCK (cur_block); diff --git a/gdb/jit.c b/gdb/jit.c index 49db391f80c..17dfdd9ef24 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -596,7 +596,7 @@ finalize_symtab (struct gdb_symtab *stab, struct objfil= e *objfile) block_name->m_name =3D obstack_strdup (&objfile->objfile_obstack, gdb_block_iter.name.get ()); =20 - BLOCK_FUNCTION (new_block) =3D block_name; + new_block->set_function (block_name); =20 BLOCKVECTOR_BLOCK (bv, block_idx) =3D new_block; if (begin > new_block->start ()) diff --git a/gdb/linespec.c b/gdb/linespec.c index 61ad69dd882..90e4c813e4e 100644 --- a/gdb/linespec.c +++ b/gdb/linespec.c @@ -3967,14 +3967,14 @@ find_label_symbols (struct linespec_state *self, block =3D get_current_search_block (); =20 for (; - block && !BLOCK_FUNCTION (block); + block && !block->function (); block =3D BLOCK_SUPERBLOCK (block)) ; =20 if (!block) return {}; =20 - fn_sym =3D BLOCK_FUNCTION (block); + fn_sym =3D block->function (); =20 find_label_symbols_in_block (block, name, fn_sym, completion_mode, &result, label_funcs_ret); diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 1565a86bad0..87d2fb1d477 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -797,7 +797,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh= , int bigend, /* Create and enter a new lexical context. */ b =3D new_block (FUNCTION_BLOCK, s->language ()); s->set_value_block (b); - BLOCK_FUNCTION (b) =3D s; + b->set_function (s); b->set_start (sh->value); b->set_end (sh->value); BLOCK_SUPERBLOCK (b) =3D top_stack->cur_block; diff --git a/gdb/mi/mi-cmd-stack.c b/gdb/mi/mi-cmd-stack.c index e894411765a..9ae64f092a8 100644 --- a/gdb/mi/mi-cmd-stack.c +++ b/gdb/mi/mi-cmd-stack.c @@ -671,7 +671,7 @@ list_args_or_locals (const frame_print_options &fp_opts, } } =20 - if (BLOCK_FUNCTION (block)) + if (block->function ()) break; else block =3D BLOCK_SUPERBLOCK (block); diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index aa8f3df7af9..7ab98687387 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -130,7 +130,7 @@ blpy_get_function (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - sym =3D BLOCK_FUNCTION (block); + sym =3D block->function (); if (sym) return symbol_to_symbol_object (sym); =20 diff --git a/gdb/python/py-frame.c b/gdb/python/py-frame.c index d07158a5ec6..c4225c84aff 100644 --- a/gdb/python/py-frame.c +++ b/gdb/python/py-frame.c @@ -292,11 +292,11 @@ frapy_block (PyObject *self, PyObject *args) } =20 for (fn_block =3D block; - fn_block !=3D NULL && BLOCK_FUNCTION (fn_block) =3D=3D NULL; + fn_block !=3D NULL && fn_block->function () =3D=3D NULL; fn_block =3D BLOCK_SUPERBLOCK (fn_block)) ; =20 - if (block =3D=3D NULL || fn_block =3D=3D NULL || BLOCK_FUNCTION (fn_bloc= k) =3D=3D NULL) + if (block =3D=3D NULL || fn_block =3D=3D NULL || fn_block->function () = =3D=3D NULL) { PyErr_SetString (PyExc_RuntimeError, _("Cannot locate block for frame.")); @@ -306,7 +306,7 @@ frapy_block (PyObject *self, PyObject *args) if (block) { return block_to_block_object - (block, BLOCK_FUNCTION (fn_block)->objfile ()); + (block, fn_block->function ()->objfile ()); } =20 Py_RETURN_NONE; diff --git a/gdb/stack.c b/gdb/stack.c index 1229ee6b492..35726b71398 100644 --- a/gdb/stack.c +++ b/gdb/stack.c @@ -2273,7 +2273,7 @@ iterate_over_block_local_vars (const struct block *bl= ock, /* After handling the function's top-level block, stop. Don't continue to its superblock, the block of per-file symbols. */ - if (BLOCK_FUNCTION (block)) + if (block->function ()) break; block =3D BLOCK_SUPERBLOCK (block); } diff --git a/gdb/symmisc.c b/gdb/symmisc.c index 097dc2dd355..1dd747d5386 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -298,14 +298,14 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file = *outfile) gdb_puts (paddress (gdbarch, b->start ()), outfile); gdb_printf (outfile, ".."); gdb_puts (paddress (gdbarch, b->end ()), outfile); - if (BLOCK_FUNCTION (b)) + if (b->function ()) { gdb_printf (outfile, ", function %s", - BLOCK_FUNCTION (b)->linkage_name ()); - if (BLOCK_FUNCTION (b)->demangled_name () !=3D NULL) + b->function ()->linkage_name ()); + if (b->function ()->demangled_name () !=3D NULL) { gdb_printf (outfile, ", %s", - BLOCK_FUNCTION (b)->demangled_name ()); + b->function ()->demangled_name ()); } } gdb_printf (outfile, "\n"); diff --git a/gdb/symtab.c b/gdb/symtab.c index 993b1962c8c..58a2033f1ff 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2024,7 +2024,7 @@ lookup_language_this (const struct language_defn *lan= g, } return (struct block_symbol) {sym, block}; } - if (BLOCK_FUNCTION (block)) + if (block->function ()) break; block =3D BLOCK_SUPERBLOCK (block); } @@ -2227,7 +2227,7 @@ lookup_local_symbol (const char *name, return blocksym; } =20 - if (BLOCK_FUNCTION (block) !=3D NULL && block_inlined_p (block)) + if (block->function () !=3D NULL && block_inlined_p (block)) break; block =3D BLOCK_SUPERBLOCK (block); } @@ -4042,17 +4042,17 @@ skip_prologue_sal (struct symtab_and_line *sal) function_block =3D NULL; while (b !=3D NULL) { - if (BLOCK_FUNCTION (b) !=3D NULL && block_inlined_p (b)) + if (b->function () !=3D NULL && block_inlined_p (b)) function_block =3D b; - else if (BLOCK_FUNCTION (b) !=3D NULL) + else if (b->function () !=3D NULL) break; b =3D BLOCK_SUPERBLOCK (b); } if (function_block !=3D NULL - && BLOCK_FUNCTION (function_block)->line () !=3D 0) + && function_block->function ()->line () !=3D 0) { - sal->line =3D BLOCK_FUNCTION (function_block)->line (); - sal->symtab =3D BLOCK_FUNCTION (function_block)->symtab (); + sal->line =3D function_block->function ()->line (); + sal->symtab =3D function_block->function ()->symtab (); } } =20 @@ -4140,7 +4140,7 @@ skip_prologue_using_sal (struct gdbarch *gdbarch, COR= E_ADDR func_addr) { if (block_inlined_p (bl)) break; - if (BLOCK_FUNCTION (bl)) + if (bl->function ()) { bl =3D NULL; break; @@ -6011,7 +6011,7 @@ default_collect_symbol_completion_matches_break_on /* Stop when we encounter an enclosing function. Do not stop for non-inlined functions - the locals of the enclosing function are in scope for a nested function. */ - if (BLOCK_FUNCTION (b) !=3D NULL && block_inlined_p (b)) + if (b->function () !=3D NULL && block_inlined_p (b)) break; b =3D BLOCK_SUPERBLOCK (b); } diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 18c3803ac19..76da71df038 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -2615,7 +2615,7 @@ info_scope_command (const char *args_in, int from_tty) gdb_printf (", length %s.\n", pulongest (TYPE_LENGTH (t))); } } - if (BLOCK_FUNCTION (block)) + if (block->function ()) break; else block =3D BLOCK_SUPERBLOCK (block);