public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Simon Marchi <simon.marchi@polymtl.ca>
To: gdb-patches@sourceware.org
Cc: Simon Marchi <simon.marchi@efficios.com>
Subject: [PATCH 14/33] gdb: remove COMPUNIT_EPILOGUE_UNWIND_VALID macro, add getter/setter
Date: Fri, 28 Jan 2022 07:45:12 -0500	[thread overview]
Message-ID: <20220128124531.2302941-15-simon.marchi@polymtl.ca> (raw)
In-Reply-To: <20220128124531.2302941-1-simon.marchi@polymtl.ca>

From: Simon Marchi <simon.marchi@efficios.com>

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
---
 gdb/amd64-tdep.c  |  2 +-
 gdb/dwarf2/read.c |  2 +-
 gdb/i386-tdep.c   |  2 +-
 gdb/symtab.h      | 13 +++++++++++--
 4 files changed, 14 insertions(+), 5 deletions(-)

diff --git a/gdb/amd64-tdep.c b/gdb/amd64-tdep.c
index 539ebe9e1c36..4444187515fb 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 a14ac22f2882..fb138de86adc 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 e598a4d197b8..b98f47574998 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 a612e1a9b483..5419e70ced6a 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<compunit_symtab>;
 
-#define COMPUNIT_EPILOGUE_UNWIND_VALID(cust) ((cust)->epilogue_unwind_valid)
 #define COMPUNIT_MACRO_TABLE(cust) ((cust)->macro_table)
 
 /* Return the language of CUST.  */
-- 
2.34.1


  parent reply	other threads:[~2022-01-28 12:47 UTC|newest]

Thread overview: 36+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 12:44 [PATCH 00/33] Remove some more accessor macros Simon Marchi
2022-01-28 12:44 ` [PATCH 01/33] gdb: add getter/setter for compunit_symtab::objfile Simon Marchi
2022-01-28 12:45 ` [PATCH 02/33] gdb: remove COMPUNIT_OBJFILE macro Simon Marchi
2022-01-28 12:45 ` [PATCH 03/33] gdb: rename compunit_primary_filetab to compunit_symtab::primary_filetab Simon Marchi
2022-01-28 12:45 ` [PATCH 04/33] gdb: add compunit_symtab::add_filetab method Simon Marchi
2022-01-28 12:45 ` [PATCH 05/33] gdb: add compunit_symtab::set_primary_filetab method Simon Marchi
2022-01-28 12:45 ` [PATCH 06/33] gdb: move compunit_filetabs to compunit_symtab::filetabs Simon Marchi
2022-01-28 12:45 ` [PATCH 07/33] gdb: remove COMPUNIT_FILETABS macro Simon Marchi
2022-01-28 12:45 ` [PATCH 08/33] gdb: remove COMPUNIT_DEBUGFORMAT macro, add getter/setter Simon Marchi
2022-01-28 12:45 ` [PATCH 09/33] gdb: remove COMPUNIT_PRODUCER " Simon Marchi
2022-01-28 12:45 ` [PATCH 10/33] gdb: remove COMPUNIT_DIRNAME " Simon Marchi
2022-01-28 12:45 ` [PATCH 11/33] gdb: remove COMPUNIT_BLOCKVECTOR " Simon Marchi
2022-01-28 12:45 ` [PATCH 12/33] gdb: remove COMPUNIT_BLOCK_LINE_SECTION " Simon Marchi
2022-01-28 12:45 ` [PATCH 13/33] gdb: remove COMPUNIT_LOCATIONS_VALID " Simon Marchi
2022-01-28 12:45 ` Simon Marchi [this message]
2022-01-28 12:45 ` [PATCH 15/33] gdb: remove COMPUNIT_MACRO_TABLE " Simon Marchi
2022-01-28 12:45 ` [PATCH 16/33] gdb: remove SYMTAB_COMPUNIT " Simon Marchi
2022-01-28 12:45 ` [PATCH 17/33] gdb: remove SYMTAB_LINETABLE " Simon Marchi
2022-01-28 12:45 ` [PATCH 18/33] gdb: remove SYMTAB_LANGUAGE " Simon Marchi
2022-01-28 12:45 ` [PATCH 19/33] gdb: remove SYMTAB_BLOCKVECTOR macro Simon Marchi
2022-01-28 12:45 ` [PATCH 20/33] gdb: remove SYMTAB_OBJFILE macro Simon Marchi
2022-01-28 12:45 ` [PATCH 21/33] gdb: remove SYMTAB_PSPACE macro Simon Marchi
2022-01-28 12:45 ` [PATCH 22/33] gdb: remove SYMTAB_DIRNAME macro Simon Marchi
2022-01-28 12:45 ` [PATCH 23/33] gdb: remove SYMBOL_MATCHES_SEARCH_NAME Simon Marchi
2022-01-28 12:45 ` [PATCH 24/33] gdb: remove SYMBOL_ACLASS_INDEX macro, add getter/setter Simon Marchi
2022-01-28 12:45 ` [PATCH 25/33] gdb: remove SYMBOL_IMPL macro, add method Simon Marchi
2022-01-28 12:45 ` [PATCH 26/33] gdb: remove SYMBOL_CLASS macro, add getter Simon Marchi
2022-01-28 12:45 ` [PATCH 27/33] gdb: remove SYMBOL_DOMAIN macro Simon Marchi
2022-01-28 12:45 ` [PATCH 28/33] gdb: remove SYMBOL_OBJFILE_OWNED macro Simon Marchi
2022-01-28 12:45 ` [PATCH 29/33] gdb: remove SYMBOL_IS_ARGUMENT macro Simon Marchi
2022-01-28 12:45 ` [PATCH 30/33] gdb: remove SYMBOL_INLINED macro Simon Marchi
2022-01-28 12:45 ` [PATCH 31/33] gdb: remote SYMBOL_IS_CPLUS_TEMPLATE_FUNCTION macro Simon Marchi
2022-01-28 12:45 ` [PATCH 32/33] gdb: remove SYMBOL_TYPE macro Simon Marchi
2022-01-28 12:45 ` [PATCH 33/33] gdb: remove SYMBOL_LINE macro Simon Marchi
2022-02-06 15:22 ` [PATCH 00/33] Remove some more accessor macros Joel Brobecker
2022-02-06 21:07   ` Simon Marchi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220128124531.2302941-15-simon.marchi@polymtl.ca \
    --to=simon.marchi@polymtl.ca \
    --cc=gdb-patches@sourceware.org \
    --cc=simon.marchi@efficios.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).