From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 1879) id C95373858D1E; Thu, 28 Apr 2022 02:39:07 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org C95373858D1E 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_{START,END} macros X-Act-Checkin: binutils-gdb X-Git-Author: Simon Marchi X-Git-Refname: refs/heads/master X-Git-Oldrev: dfb138f9344ca671e7e16fffe36779d38d18c490 X-Git-Newrev: 4b8791e10e574d3279e6783b58556893b0c92853 Message-Id: <20220428023907.C95373858D1E@sourceware.org> Date: Thu, 28 Apr 2022 02:39:07 +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:07 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dbinutils-gdb.git;h=3D4b8791e10e57= 4d3279e6783b58556893b0c92853 commit 4b8791e10e574d3279e6783b58556893b0c92853 Author: Simon Marchi Date: Fri Jan 28 10:59:38 2022 -0500 gdb: remove BLOCK_{START,END} macros =20 Replace with equivalent methods. =20 Change-Id: I10a6c8a2a86462d9d4a6a6409a3f07a6bea66310 Diff: --- gdb/alpha-mdebug-tdep.c | 2 +- gdb/block.c | 6 ++-- gdb/block.h | 23 +++++++++++---- gdb/blockframe.c | 4 +-- gdb/buildsym.c | 48 ++++++++++++++++--------------- gdb/compile/compile-cplus-symbols.c | 4 +-- gdb/compile/compile-cplus-types.c | 2 +- gdb/csky-tdep.c | 2 +- gdb/frame.c | 2 +- gdb/guile/scm-block.c | 6 ++-- gdb/infcmd.c | 4 +-- gdb/jit.c | 16 +++++------ gdb/mdebugread.c | 57 +++++++++++++++++++--------------= ---- gdb/mips-tdep.c | 4 +-- gdb/objfiles.c | 4 +-- gdb/psymtab.c | 8 +++--- gdb/python/py-block.c | 4 +-- gdb/symmisc.c | 8 +++--- gdb/symtab.c | 8 +++--- gdb/varobj.c | 4 +-- 20 files changed, 117 insertions(+), 99 deletions(-) diff --git a/gdb/alpha-mdebug-tdep.c b/gdb/alpha-mdebug-tdep.c index a8b4bcbea4a..10169c76c37 100644 --- a/gdb/alpha-mdebug-tdep.c +++ b/gdb/alpha-mdebug-tdep.c @@ -102,7 +102,7 @@ find_proc_desc (CORE_ADDR pc) CORE_ADDR startaddr; find_pc_partial_function (pc, &sh_name, &startaddr, NULL); =20 - if (startaddr > BLOCK_START (b)) + if (startaddr > b->start ()) /* This is the "pathological" case referred to in a comment in print_frame_info. It might be better to move this check into symbol reading. */ diff --git a/gdb/block.c b/gdb/block.c index bab6868bbbb..a4678ca6a84 100644 --- a/gdb/block.c +++ b/gdb/block.c @@ -155,7 +155,7 @@ find_block_in_blockvector (const struct blockvector *bl= , CORE_ADDR pc) { half =3D (top - bot + 1) >> 1; b =3D BLOCKVECTOR_BLOCK (bl, bot + half); - if (BLOCK_START (b) <=3D pc) + if (b->start () <=3D pc) bot +=3D half; else top =3D bot + half; @@ -166,9 +166,9 @@ find_block_in_blockvector (const struct blockvector *bl= , CORE_ADDR pc) while (bot >=3D STATIC_BLOCK) { b =3D BLOCKVECTOR_BLOCK (bl, bot); - if (!(BLOCK_START (b) <=3D pc)) + if (!(b->start () <=3D pc)) return NULL; - if (BLOCK_END (b) > pc) + if (b->end () > pc) return b; bot--; } diff --git a/gdb/block.h b/gdb/block.h index eedba91ac89..7fe982407f8 100644 --- a/gdb/block.h +++ b/gdb/block.h @@ -90,11 +90,26 @@ struct blockranges =20 struct block { + /* Return this block's start address. */ + CORE_ADDR start () const + { return m_start; } + + /* Set this block's start address. */ + void set_start (CORE_ADDR start) + { m_start =3D start; } + + /* Return this block's end address. */ + CORE_ADDR end () const + { return m_end; } + + /* Set this block's end address. */ + void set_end (CORE_ADDR end) + { m_end =3D end; } =20 /* Addresses in the executable code that are in this block. */ =20 - CORE_ADDR startaddr; - CORE_ADDR endaddr; + CORE_ADDR m_start; + CORE_ADDR m_end; =20 /* The symbol that names this block, if the block is the body of a function (real or inlined); otherwise, zero. */ @@ -139,8 +154,6 @@ struct global_block struct compunit_symtab *compunit_symtab; }; =20 -#define BLOCK_START(bl) (bl)->startaddr -#define BLOCK_END(bl) (bl)->endaddr #define BLOCK_FUNCTION(bl) (bl)->function #define BLOCK_SUPERBLOCK(bl) (bl)->superblock #define BLOCK_MULTIDICT(bl) (bl)->multidict @@ -186,7 +199,7 @@ struct global_block too). BLOCK_ENTRY_PC can then be redefined to be less DWARF-centric. = */ =20 #define BLOCK_ENTRY_PC(bl) (BLOCK_CONTIGUOUS_P (bl) \ - ? BLOCK_START (bl) \ + ? bl->start () \ : BLOCK_RANGE_START (bl,0)) =20 struct blockvector diff --git a/gdb/blockframe.c b/gdb/blockframe.c index df03901b6e7..fec7f053057 100644 --- a/gdb/blockframe.c +++ b/gdb/blockframe.c @@ -278,8 +278,8 @@ find_pc_partial_function_sym (CORE_ADDR pc, =20 if (BLOCK_CONTIGUOUS_P (b)) { - cache_pc_function_low =3D BLOCK_START (b); - cache_pc_function_high =3D BLOCK_END (b); + cache_pc_function_low =3D b->start (); + cache_pc_function_high =3D b->end (); } else { diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 586c0920468..7db9f344177 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -234,8 +234,8 @@ buildsym_compunit::finish_block_internal } } =20 - BLOCK_START (block) =3D start; - BLOCK_END (block) =3D end; + block->set_start (start); + block->set_end (end); =20 /* Put the block in as the value of the symbol that names it. */ =20 @@ -306,7 +306,7 @@ buildsym_compunit::finish_block_internal /* Check to be sure that the blocks have an end address that is greater than starting address. */ =20 - if (BLOCK_END (block) < BLOCK_START (block)) + if (block->end () < block->start ()) { if (symbol) { @@ -318,11 +318,11 @@ buildsym_compunit::finish_block_internal { complaint (_("block end address %s less than block " "start address %s (patched it)"), - paddress (gdbarch, BLOCK_END (block)), - paddress (gdbarch, BLOCK_START (block))); + paddress (gdbarch, block->end ()), + paddress (gdbarch, block->start ())); } /* Better than nothing. */ - BLOCK_END (block) =3D BLOCK_START (block); + block->set_end (block->start ()); } =20 /* Install this block as the superblock of all blocks made since the @@ -343,8 +343,8 @@ buildsym_compunit::finish_block_internal physically nested inside this other blocks, only lexically nested. */ if (BLOCK_FUNCTION (pblock->block) =3D=3D NULL - && (BLOCK_START (pblock->block) < BLOCK_START (block) - || BLOCK_END (pblock->block) > BLOCK_END (block))) + && (pblock->block->start () < block->start () + || pblock->block->end () > block->end ())) { if (symbol) { @@ -355,15 +355,17 @@ buildsym_compunit::finish_block_internal { complaint (_("inner block (%s-%s) not " "inside outer block (%s-%s)"), - paddress (gdbarch, BLOCK_START (pblock->block)), - paddress (gdbarch, BLOCK_END (pblock->block)), - paddress (gdbarch, BLOCK_START (block)), - paddress (gdbarch, BLOCK_END (block))); + paddress (gdbarch, pblock->block->start ()), + paddress (gdbarch, pblock->block->end ()), + paddress (gdbarch, block->start ()), + paddress (gdbarch, block->end ())); } - if (BLOCK_START (pblock->block) < BLOCK_START (block)) - BLOCK_START (pblock->block) =3D BLOCK_START (block); - if (BLOCK_END (pblock->block) > BLOCK_END (block)) - BLOCK_END (pblock->block) =3D BLOCK_END (block); + + if (pblock->block->start () < block->start ()) + pblock->block->set_start (block->start ()); + + if (pblock->block->end () > block->end ()) + pblock->block->set_end (block->end ()); } BLOCK_SUPERBLOCK (pblock->block) =3D block; } @@ -413,8 +415,8 @@ buildsym_compunit::record_block_range (struct block *bl= ock, become interesting. Note that even if this block doesn't have any "interesting" ranges, some later block might, so we still need to record this block in the addrmap. */ - if (start !=3D BLOCK_START (block) - || end_inclusive + 1 !=3D BLOCK_END (block)) + if (start !=3D block->start () + || end_inclusive + 1 !=3D block->end ()) m_pending_addrmap_interesting =3D true; =20 if (m_pending_addrmap =3D=3D nullptr) @@ -473,11 +475,11 @@ buildsym_compunit::make_blockvector () { for (i =3D 1; i < BLOCKVECTOR_NBLOCKS (blockvector); i++) { - if (BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i - 1)) - > BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i))) + if (BLOCKVECTOR_BLOCK(blockvector, i - 1)->start () + > BLOCKVECTOR_BLOCK(blockvector, i)->start ()) { CORE_ADDR start - =3D BLOCK_START (BLOCKVECTOR_BLOCK (blockvector, i)); + =3D BLOCKVECTOR_BLOCK(blockvector, i)->start (); =20 complaint (_("block at %s out of order"), hex_string ((LONGEST) start)); @@ -820,7 +822,7 @@ buildsym_compunit::end_compunit_symtab_get_static_block= (CORE_ADDR end_addr, std::stable_sort (barray.begin (), barray.end (), [] (const block *a, const block *b) { - return BLOCK_START (a) > BLOCK_START (b); + return a->start () > b->start (); }); =20 int i =3D 0; @@ -878,7 +880,7 @@ buildsym_compunit::end_compunit_symtab_with_blockvector gdb_assert (static_block !=3D NULL); gdb_assert (m_subfiles !=3D NULL); =20 - end_addr =3D BLOCK_END (static_block); + end_addr =3D static_block->end (); =20 /* Create the GLOBAL_BLOCK and build the blockvector. */ finish_block_internal (NULL, get_global_symbols (), NULL, NULL, diff --git a/gdb/compile/compile-cplus-symbols.c b/gdb/compile/compile-cplu= s-symbols.c index 95d43507c30..ef2a1f57603 100644 --- a/gdb/compile/compile-cplus-symbols.c +++ b/gdb/compile/compile-cplus-symbols.c @@ -87,7 +87,7 @@ convert_one_symbol (compile_cplus_instance *instance, case LOC_BLOCK: { kind =3D GCC_CP_SYMBOL_FUNCTION; - addr =3D BLOCK_START (sym.symbol->value_block ()); + addr =3D sym.symbol->value_block()->start (); if (is_global && sym.symbol->type ()->is_gnu_ifunc ()) addr =3D gnu_ifunc_resolve_addr (target_gdbarch (), addr); } @@ -441,7 +441,7 @@ gcc_cplus_symbol_address (void *datum, struct gcc_cp_co= ntext *gcc_context, gdb_printf (gdb_stdlog, "gcc_symbol_address \"%s\": full symbol\n", identifier); - result =3D BLOCK_START (sym->value_block ()); + result =3D sym->value_block ()->start (); if (sym->type ()->is_gnu_ifunc ()) result =3D gnu_ifunc_resolve_addr (target_gdbarch (), result); found =3D 1; diff --git a/gdb/compile/compile-cplus-types.c b/gdb/compile/compile-cplus-= types.c index ab65e47f49d..e7c940b1355 100644 --- a/gdb/compile/compile-cplus-types.c +++ b/gdb/compile/compile-cplus-types.c @@ -766,7 +766,7 @@ compile_cplus_convert_struct_or_union_methods (compile_= cplus_instance *instance, =20 const char *filename =3D sym.symbol->symtab ()->filename; unsigned int line =3D sym.symbol->line (); - CORE_ADDR address =3D BLOCK_START (sym.symbol->value_block ()); + CORE_ADDR address =3D sym.symbol->value_block()->start (); const char *kind; =20 if (TYPE_FN_FIELD_STATIC_P (methods, j)) diff --git a/gdb/csky-tdep.c b/gdb/csky-tdep.c index 105f5fccd12..a9b53916561 100644 --- a/gdb/csky-tdep.c +++ b/gdb/csky-tdep.c @@ -1839,7 +1839,7 @@ csky_frame_unwind_cache (struct frame_info *this_fram= e) /* Get the (function) symbol matching prologue_start. */ bl =3D block_for_pc (prologue_start); if (bl !=3D NULL) - func_size =3D bl->endaddr - bl->startaddr; + func_size =3D bl->end () - bl->start (); else { struct bound_minimal_symbol msymbol diff --git a/gdb/frame.c b/gdb/frame.c index 5e3c02e2029..ae45e22d613 100644 --- a/gdb/frame.c +++ b/gdb/frame.c @@ -2432,7 +2432,7 @@ inside_main_func (frame_info *this_frame) =20 const struct block *block =3D bs.symbol->value_block (); gdb_assert (block !=3D nullptr); - sym_addr =3D BLOCK_START (block); + sym_addr =3D block->start (); } else sym_addr =3D msymbol.value_address (); diff --git a/gdb/guile/scm-block.c b/gdb/guile/scm-block.c index df0ef7f0b1f..921225dcf47 100644 --- a/gdb/guile/scm-block.c +++ b/gdb/guile/scm-block.c @@ -160,7 +160,7 @@ bkscm_print_block_smob (SCM self, SCM port, scm_print_s= tate *pstate) gdbscm_printf (port, " %s", BLOCK_FUNCTION (b)->print_name ()); =20 gdbscm_printf (port, " %s-%s", - hex_string (BLOCK_START (b)), hex_string (BLOCK_END (b))); + hex_string (b->start ()), hex_string (b->end ())); =20 scm_puts (">", port); =20 @@ -379,7 +379,7 @@ gdbscm_block_start (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 gdbscm_scm_from_ulongest (BLOCK_START (block)); + return gdbscm_scm_from_ulongest (block->start ()); } =20 /* (block-end ) -> address */ @@ -391,7 +391,7 @@ gdbscm_block_end (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 gdbscm_scm_from_ulongest (BLOCK_END (block)); + return gdbscm_scm_from_ulongest (block->end ()); } =20 /* (block-function ) -> */ diff --git a/gdb/infcmd.c b/gdb/infcmd.c index c7f339a7a94..5368fcd7157 100644 --- a/gdb/infcmd.c +++ b/gdb/infcmd.c @@ -980,8 +980,8 @@ prepare_one_step (thread_info *tp, struct step_command_= fsm *sm) if (sym->aclass () =3D=3D LOC_BLOCK) { const block *block =3D sym->value_block (); - if (BLOCK_END (block) < tp->control.step_range_end) - tp->control.step_range_end =3D BLOCK_END (block); + if (block->end () < tp->control.step_range_end) + tp->control.step_range_end =3D block->end (); } } =20 diff --git a/gdb/jit.c b/gdb/jit.c index f7e25e494d4..49db391f80c 100644 --- a/gdb/jit.c +++ b/gdb/jit.c @@ -583,8 +583,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfil= e *objfile) BLOCK_MULTIDICT (new_block) =3D mdict_create_linear (&objfile->objfile_obstack, NULL); /* The address range. */ - BLOCK_START (new_block) =3D (CORE_ADDR) gdb_block_iter.begin; - BLOCK_END (new_block) =3D (CORE_ADDR) gdb_block_iter.end; + new_block->set_start (gdb_block_iter.begin); + new_block->set_end (gdb_block_iter.end); =20 /* The name. */ block_name->set_domain (VAR_DOMAIN); @@ -599,10 +599,10 @@ finalize_symtab (struct gdb_symtab *stab, struct objf= ile *objfile) BLOCK_FUNCTION (new_block) =3D block_name; =20 BLOCKVECTOR_BLOCK (bv, block_idx) =3D new_block; - if (begin > BLOCK_START (new_block)) - begin =3D BLOCK_START (new_block); - if (end < BLOCK_END (new_block)) - end =3D BLOCK_END (new_block); + if (begin > new_block->start ()) + begin =3D new_block->start (); + if (end < new_block->end ()) + end =3D new_block->end (); =20 gdb_block_iter.real_block =3D new_block; =20 @@ -623,8 +623,8 @@ finalize_symtab (struct gdb_symtab *stab, struct objfil= e *objfile) BLOCK_SUPERBLOCK (new_block) =3D block_iter; block_iter =3D new_block; =20 - BLOCK_START (new_block) =3D (CORE_ADDR) begin; - BLOCK_END (new_block) =3D (CORE_ADDR) end; + new_block->set_start (begin); + new_block->set_end (end); =20 BLOCKVECTOR_BLOCK (bv, i) =3D new_block; =20 diff --git a/gdb/mdebugread.c b/gdb/mdebugread.c index 7083beb01ed..1565a86bad0 100644 --- a/gdb/mdebugread.c +++ b/gdb/mdebugread.c @@ -798,7 +798,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_sh= , int bigend, b =3D new_block (FUNCTION_BLOCK, s->language ()); s->set_value_block (b); BLOCK_FUNCTION (b) =3D s; - BLOCK_START (b) =3D BLOCK_END (b) =3D sh->value; + b->set_start (sh->value); + b->set_end (sh->value); BLOCK_SUPERBLOCK (b) =3D top_stack->cur_block; add_block (b, top_stack->cur_st); =20 @@ -1126,7 +1127,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_= sh, int bigend, =20 top_stack->blocktype =3D stBlock; b =3D new_block (NON_FUNCTION_BLOCK, psymtab_language); - BLOCK_START (b) =3D sh->value + top_stack->procadr; + b->set_start (sh->value + top_stack->procadr); BLOCK_SUPERBLOCK (b) =3D top_stack->cur_block; top_stack->cur_block =3D b; add_block (b, top_stack->cur_st); @@ -1150,7 +1151,8 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_= sh, int bigend, struct type *ftype =3D top_stack->cur_type; int i; =20 - BLOCK_END (top_stack->cur_block) +=3D sh->value; /* size */ + top_stack->cur_block->set_end + (top_stack->cur_block->end () + sh->value); /* size */ =20 /* Make up special symbol to contain procedure specific info. */ s =3D new_symbol (MDEBUG_EFI_SYMBOL_NAME); @@ -1171,11 +1173,11 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ex= t_sh, int bigend, struct block *b_bad =3D BLOCKVECTOR_BLOCK (bv, i); =20 if (BLOCK_SUPERBLOCK (b_bad) =3D=3D cblock - && BLOCK_START (b_bad) =3D=3D top_stack->procadr - && BLOCK_END (b_bad) =3D=3D top_stack->procadr) + && b_bad->start () =3D=3D top_stack->procadr + && b_bad->end () =3D=3D top_stack->procadr) { - BLOCK_START (b_bad) =3D BLOCK_START (cblock); - BLOCK_END (b_bad) =3D BLOCK_END (cblock); + b_bad->set_start (cblock->start ()); + b_bad->set_end (cblock->end ()); } } =20 @@ -1217,7 +1219,7 @@ parse_symbol (SYMR *sh, union aux_ext *ax, char *ext_= sh, int bigend, /* End of (code) block. The value of the symbol is the displacement from the procedure`s start address of the end of this block. */ - BLOCK_END (top_stack->cur_block) =3D sh->value + top_stack->procadr; + top_stack->cur_block->set_end (sh->value + top_stack->procadr); } else if (sh->sc =3D=3D scText && top_stack->blocktype =3D=3D stNil) { @@ -2024,7 +2026,7 @@ parse_procedure (PDR *pr, struct compunit_symtab *sea= rch_symtab, e->pdr.adr is sometimes offset by a bogus value. To work around these problems, we replace e->pdr.adr with the start address of the function. */ - e->pdr.adr =3D BLOCK_START (b); + e->pdr.adr =3D b->start (); } =20 /* It would be reasonable that functions that have been compiled @@ -4099,8 +4101,8 @@ mdebug_expand_psymtab (legacy_psymtab *pst, struct ob= jfile *objfile) top_stack->cur_st =3D cust->primary_filetab (); top_stack->cur_block =3D BLOCKVECTOR_BLOCK (cust->blockvector (), STATIC_BLOCK); - BLOCK_START (top_stack->cur_block) =3D pst->text_low (objfile); - BLOCK_END (top_stack->cur_block) =3D 0; + top_stack->cur_block->set_start (pst->text_low (objfile)); + top_stack->cur_block->set_end (0); top_stack->blocktype =3D stFile; top_stack->cur_type =3D 0; top_stack->procadr =3D 0; @@ -4550,13 +4552,13 @@ add_line (struct linetable *lt, int lineno, CORE_AD= DR adr, int last) static bool block_is_less_than (const struct block *b1, const struct block *b2) { - CORE_ADDR start1 =3D BLOCK_START (b1); - CORE_ADDR start2 =3D BLOCK_START (b2); + CORE_ADDR start1 =3D b1->start (); + CORE_ADDR start2 =3D b2->start (); =20 if (start1 !=3D start2) return start1 < start2; =20 - return (BLOCK_END (b2)) < (BLOCK_END (b1)); + return (b2->end ()) < (b1->end ()); } =20 /* Sort the blocks of a symtab S. @@ -4574,10 +4576,10 @@ sort_blocks (struct symtab *s) if (BLOCKVECTOR_NBLOCKS (bv) <=3D FIRST_LOCAL_BLOCK) { /* Cosmetic */ - if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =3D=3D 0) - BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =3D 0; - if (BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =3D=3D 0) - BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =3D 0; + if (BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->end () =3D=3D 0) + BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->set_start (0); + if (BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->end () =3D=3D 0) + BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->set_start (0); return; } /* @@ -4596,18 +4598,19 @@ sort_blocks (struct symtab *s) int i, j =3D BLOCKVECTOR_NBLOCKS (bv); =20 for (i =3D FIRST_LOCAL_BLOCK; i < j; i++) - if (high < BLOCK_END (BLOCKVECTOR_BLOCK (bv, i))) - high =3D BLOCK_END (BLOCKVECTOR_BLOCK (bv, i)); - BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =3D high; + if (high < BLOCKVECTOR_BLOCK(bv, i)->end ()) + high =3D BLOCKVECTOR_BLOCK(bv, i)->end (); + BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->set_end (high); } =20 - BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)) =3D - BLOCK_START (BLOCKVECTOR_BLOCK (bv, FIRST_LOCAL_BLOCK)); + BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->set_start + (BLOCKVECTOR_BLOCK(bv, FIRST_LOCAL_BLOCK)->start ()); =20 - BLOCK_START (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =3D - BLOCK_START (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)); - BLOCK_END (BLOCKVECTOR_BLOCK (bv, STATIC_BLOCK)) =3D - BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)); + BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->set_start + (BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->start ()); + + BLOCKVECTOR_BLOCK(bv, STATIC_BLOCK)->set_end + (BLOCKVECTOR_BLOCK(bv, GLOBAL_BLOCK)->end ()); } =0C =20 diff --git a/gdb/mips-tdep.c b/gdb/mips-tdep.c index 354c2b54e07..ffed8723dce 100644 --- a/gdb/mips-tdep.c +++ b/gdb/mips-tdep.c @@ -490,11 +490,11 @@ mips_make_symbol_special (struct symbol *sym, struct = objfile *objfile) CORE_ADDR compact_block_start; struct bound_minimal_symbol msym; =20 - compact_block_start =3D BLOCK_START (block) | 1; + compact_block_start =3D block->start () | 1; msym =3D lookup_minimal_symbol_by_pc (compact_block_start); if (msym.minsym && !msymbol_is_mips (msym.minsym)) { - BLOCK_START (block) =3D compact_block_start; + block->set_start (compact_block_start); } } } diff --git a/gdb/objfiles.c b/gdb/objfiles.c index 849c6d73cab..e664bcd2da9 100644 --- a/gdb/objfiles.c +++ b/gdb/objfiles.c @@ -677,8 +677,8 @@ objfile_relocate1 (struct objfile *objfile, struct mdict_iterator miter; =20 b =3D BLOCKVECTOR_BLOCK (bv, i); - BLOCK_START (b) +=3D delta[block_line_section]; - BLOCK_END (b) +=3D delta[block_line_section]; + b->set_start (b->start () + delta[block_line_section]); + b->set_end (b->end () + delta[block_line_section]); =20 if (BLOCK_RANGES (b) !=3D nullptr) for (int j =3D 0; j < BLOCK_NRANGES (b); j++) diff --git a/gdb/psymtab.c b/gdb/psymtab.c index 5d9949bca1d..ce29e1922a1 100644 --- a/gdb/psymtab.c +++ b/gdb/psymtab.c @@ -1835,8 +1835,8 @@ maintenance_check_psymtabs (const char *ignore, int f= rom_tty) } } if (ps->raw_text_high () !=3D 0 - && (ps->text_low (objfile) < BLOCK_START (b) - || ps->text_high (objfile) > BLOCK_END (b))) + && (ps->text_low (objfile) < b->start () + || ps->text_high (objfile) > b->end ())) { gdb_printf ("Psymtab "); gdb_puts (ps->filename); @@ -1845,9 +1845,9 @@ maintenance_check_psymtabs (const char *ignore, int f= rom_tty) gdb_printf (" - "); gdb_puts (paddress (gdbarch, ps->text_high (objfile))); gdb_printf (" but symtab covers only "); - gdb_puts (paddress (gdbarch, BLOCK_START (b))); + gdb_puts (paddress (gdbarch, b->start ())); gdb_printf (" - "); - gdb_puts (paddress (gdbarch, BLOCK_END (b))); + gdb_puts (paddress (gdbarch, b->end ())); gdb_printf ("\n"); } } diff --git a/gdb/python/py-block.c b/gdb/python/py-block.c index cf543c79484..aa8f3df7af9 100644 --- a/gdb/python/py-block.c +++ b/gdb/python/py-block.c @@ -109,7 +109,7 @@ blpy_get_start (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - return gdb_py_object_from_ulongest (BLOCK_START (block)).release (); + return gdb_py_object_from_ulongest (block->start ()).release (); } =20 static PyObject * @@ -119,7 +119,7 @@ blpy_get_end (PyObject *self, void *closure) =20 BLPY_REQUIRE_VALID (self, block); =20 - return gdb_py_object_from_ulongest (BLOCK_END (block)).release (); + return gdb_py_object_from_ulongest (block->end ()).release (); } =20 static PyObject * diff --git a/gdb/symmisc.c b/gdb/symmisc.c index dee11fdf57d..097dc2dd355 100644 --- a/gdb/symmisc.c +++ b/gdb/symmisc.c @@ -295,9 +295,9 @@ dump_symtab_1 (struct symtab *symtab, struct ui_file *o= utfile) wants it. */ gdb_printf (outfile, ", %d syms/buckets in ", mdict_size (BLOCK_MULTIDICT (b))); - gdb_puts (paddress (gdbarch, BLOCK_START (b)), outfile); + gdb_puts (paddress (gdbarch, b->start ()), outfile); gdb_printf (outfile, ".."); - gdb_puts (paddress (gdbarch, BLOCK_END (b)), outfile); + gdb_puts (paddress (gdbarch, b->end ()), outfile); if (BLOCK_FUNCTION (b)) { gdb_printf (outfile, ", function %s", @@ -631,8 +631,8 @@ print_symbol (struct gdbarch *gdbarch, struct symbol *s= ymbol, gdb_printf (outfile, "block object %s, %s..%s", host_address_to_string (symbol->value_block ()), - paddress (gdbarch, BLOCK_START (symbol->value_block ())), - paddress (gdbarch, BLOCK_END (symbol->value_block ()))); + paddress (gdbarch, symbol->value_block()->start ()), + paddress (gdbarch, symbol->value_block()->end ())); if (section) gdb_printf (outfile, " section %s", bfd_section_name (section->the_bfd_section)); diff --git a/gdb/symtab.c b/gdb/symtab.c index 6926d1559b2..993b1962c8c 100644 --- a/gdb/symtab.c +++ b/gdb/symtab.c @@ -2982,8 +2982,8 @@ find_pc_sect_compunit_symtab (CORE_ADDR pc, struct ob= j_section *section) const struct blockvector *bv =3D cust->blockvector (); const struct block *global_block =3D BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK); - CORE_ADDR start =3D BLOCK_START (global_block); - CORE_ADDR end =3D BLOCK_END (global_block); + CORE_ADDR start =3D global_block->start (); + CORE_ADDR end =3D global_block->end (); bool in_range_p =3D start <=3D pc && pc < end; if (!in_range_p) continue; @@ -3406,7 +3406,7 @@ find_pc_sect_line (CORE_ADDR pc, struct obj_section *= section, int notcurrent) else if (alt) val.end =3D alt->pc; else - val.end =3D BLOCK_END (BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)); + val.end =3D BLOCKVECTOR_BLOCK (bv, GLOBAL_BLOCK)->end (); } val.section =3D section; return val; @@ -3985,7 +3985,7 @@ skip_prologue_sal (struct symtab_and_line *sal) line is still part of the same function. */ if (skip && start_sal.pc !=3D pc && (sym ? (BLOCK_ENTRY_PC (sym->value_block ()) <=3D start_sal.end - && start_sal.end < BLOCK_END (sym->value_block ())) + && start_sal.end < sym->value_block()->end ()) : (lookup_minimal_symbol_by_pc_section (start_sal.end, section).min= sym =3D=3D lookup_minimal_symbol_by_pc_section (pc, section).minsym))) { diff --git a/gdb/varobj.c b/gdb/varobj.c index 6693dacd786..741fdb6a03b 100644 --- a/gdb/varobj.c +++ b/gdb/varobj.c @@ -1939,8 +1939,8 @@ check_scope (const struct varobj *var) { CORE_ADDR pc =3D get_frame_pc (fi); =20 - if (pc < BLOCK_START (var->root->valid_block) || - pc >=3D BLOCK_END (var->root->valid_block)) + if (pc < var->root->valid_block->start () || + pc >=3D var->root->valid_block->end ()) scope =3D false; else select_frame (fi);