From: Simon Marchi Date: Sat, 20 Nov 2021 03:41:10 +0000 (-0500) Subject: gdb: remove COMPUNIT_EPILOGUE_UNWIND_VALID macro, add getter/setter X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3908b699f8d08499ad53adcb34e8a4675cf39142;p=binutils-gdb.git gdb: remove COMPUNIT_EPILOGUE_UNWIND_VALID macro, add getter/setter Add a getter and a setter for a compunit_symtab's epilogue unwind valid flag. Remove the corresponding macro and adjust all callers. Change-Id: If3b68629d987767da9be7041a95d96dc34367a9a --- diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c index 539ebe9e1c3..4444187515f 100644 --- a/gdb/amd64-tdep.c +++ b/gdb/amd64-tdep.c @@ -2901,7 +2901,7 @@ amd64_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) struct compunit_symtab *cust; cust = find_pc_compunit_symtab (pc); - if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust)) + if (cust != NULL && cust->epilogue_unwind_valid ()) return 0; if (target_read_memory (pc, &insn, 1)) diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c index a14ac22f288..fb138de86ad 100644 --- a/gdb/dwarf2/read.c +++ b/gdb/dwarf2/read.c @@ -9496,7 +9496,7 @@ process_full_comp_unit (dwarf2_cu *cu, enum language pretend_language) cust->set_locations_valid (true); if (gcc_4_minor >= 5) - cust->epilogue_unwind_valid = 1; + cust->set_epilogue_unwind_valid (true); cust->set_call_site_htab (cu->call_site_htab); } diff --git a/gdb/i386-tdep.c b/gdb/i386-tdep.c index e598a4d197b..b98f4757499 100644 --- a/gdb/i386-tdep.c +++ b/gdb/i386-tdep.c @@ -2222,7 +2222,7 @@ i386_stack_frame_destroyed_p (struct gdbarch *gdbarch, CORE_ADDR pc) struct compunit_symtab *cust; cust = find_pc_compunit_symtab (pc); - if (cust != NULL && COMPUNIT_EPILOGUE_UNWIND_VALID (cust)) + if (cust != NULL && cust->epilogue_unwind_valid ()) return 0; if (target_read_memory (pc, &insn, 1)) diff --git a/gdb/symtab.h b/gdb/symtab.h index a612e1a9b48..5419e70ced6 100644 --- a/gdb/symtab.h +++ b/gdb/symtab.h @@ -1541,6 +1541,16 @@ struct compunit_symtab m_locations_valid = locations_valid; } + bool epilogue_unwind_valid () const + { + return m_epilogue_unwind_valid; + } + + void set_epilogue_unwind_valid (bool epilogue_unwind_valid) + { + m_epilogue_unwind_valid = epilogue_unwind_valid; + } + /* Make PRIMARY_FILETAB the primary filetab of this compunit symtab. PRIMARY_FILETAB must already be a filetab of this compunit symtab. */ @@ -1607,7 +1617,7 @@ struct compunit_symtab /* DWARF unwinder for this CU is valid even for epilogues (PC at the return instruction). This is supported by GCC since 4.5.0. */ - unsigned int epilogue_unwind_valid : 1; + unsigned int m_epilogue_unwind_valid : 1; /* struct call_site entries for this compilation unit or NULL. */ htab_t m_call_site_htab; @@ -1636,7 +1646,6 @@ struct compunit_symtab using compunit_symtab_range = next_range; -#define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid) #define COMPUNIT_MACRO_TABLE(cust) ((cust)->macro_table) /* Return the language of CUST. */