public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] gcc: Adjust gdbhooks.py VecPrinter for vec layout changes
@ 2023-03-03 16:44 Jonathan Wakely
  2023-03-03 16:45 ` Jakub Jelinek
  0 siblings, 1 reply; 6+ messages in thread
From: Jonathan Wakely @ 2023-03-03 16:44 UTC (permalink / raw)
  To: gcc-patches

OK for trunk?

gcc/ChangeLog:

	* gdbhooks.py (VecPrinter): Adjust for new vec layout.
---
 gcc/gdbhooks.py | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index c9dea9bf828..78e6c97c30d 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -461,7 +461,11 @@ class VecPrinter:
             return
         m_vecpfx = self.gdbval['m_vecpfx']
         m_num = m_vecpfx['m_num']
-        m_vecdata = self.gdbval['m_vecdata']
+        typ = self.gdbval.type
+        if typ.code == gdb.TYPE_CODE_PTR:
+            typ = typ.target()
+        typ = typ.template_argument(0) # the type T
+        m_vecdata = (self.gdbval.address + 1).cast(typ.pointer())
         for i in range(m_num):
             yield ('[%d]' % i, m_vecdata[i])
 
-- 
2.39.2


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-03-03 18:12 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-03 16:44 [PATCH] gcc: Adjust gdbhooks.py VecPrinter for vec layout changes Jonathan Wakely
2023-03-03 16:45 ` Jakub Jelinek
2023-03-03 17:01   ` Jakub Jelinek
2023-03-03 17:52     ` Jonathan Wakely
2023-03-03 18:07       ` [PATCH] gcc: Fix gdbhooks.py VecPrinter for vec<> as well as vec<>* [PR109006] Jonathan Wakely
2023-03-03 18:12         ` Jakub Jelinek

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).