From af39c5c8749757724a0f62dcb51be59cf3ecc678 Mon Sep 17 00:00:00 2001 From: Simon Marchi Date: Fri, 19 Nov 2021 22:25:23 -0500 Subject: gdb: remove COMPUNIT_BLOCKVECTOR macro, add getter/setter Add a getter and a setter for a compunit_symtab's blockvector. Remove the corresponding macro and adjust all callers. Change-Id: I99484c6619dcbbea7c5d89c72aa660316ca62f64 --- gdb/symtab.h | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) (limited to 'gdb/symtab.h') diff --git a/gdb/symtab.h b/gdb/symtab.h index b72abab..f9318ff 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1409,7 +1409,7 @@ using symtab_range = next_range; #define SYMTAB_LINETABLE(symtab) ((symtab)->linetable) #define SYMTAB_LANGUAGE(symtab) ((symtab)->language) #define SYMTAB_BLOCKVECTOR(symtab) \ - COMPUNIT_BLOCKVECTOR (SYMTAB_COMPUNIT (symtab)) + (SYMTAB_COMPUNIT (symtab)->blockvector ()) #define SYMTAB_OBJFILE(symtab) \ (SYMTAB_COMPUNIT (symtab)->objfile ()) #define SYMTAB_PSPACE(symtab) (SYMTAB_OBJFILE (symtab)->pspace) @@ -1511,6 +1511,16 @@ struct compunit_symtab m_dirname = dirname; } + const struct blockvector *blockvector () const + { + return m_blockvector; + } + + void set_blockvector (const struct blockvector *blockvector) + { + m_blockvector = blockvector; + } + /* Make PRIMARY_FILETAB the primary filetab of this compunit symtab. PRIMARY_FILETAB must already be a filetab of this compunit symtab. */ @@ -1564,7 +1574,7 @@ struct compunit_symtab /* List of all symbol scope blocks for this symtab. It is shared among all symtabs in a given compilation unit. */ - const struct blockvector *blockvector; + const struct blockvector *m_blockvector; /* Section in objfile->section_offsets for the blockvector and the linetable. Probably always SECT_OFF_TEXT. */ @@ -1606,7 +1616,6 @@ struct compunit_symtab using compunit_symtab_range = next_range; -#define COMPUNIT_BLOCKVECTOR(cust) ((cust)->blockvector) #define COMPUNIT_BLOCK_LINE_SECTION(cust) ((cust)->block_line_section) #define COMPUNIT_LOCATIONS_VALID(cust) ((cust)->locations_valid) #define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid) -- cgit v1.1