aboutsummaryrefslogtreecommitdiff
path: root/gcc/gdbhooks.py
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2023-03-03 16:41:29 +0000
committerJonathan Wakely <jwakely@redhat.com>2023-03-03 18:14:51 +0000
commit59a576f274b9093fd4b25eb6be556b40c2424478 (patch)
tree0a2dbb514c15269b7b95168111d57831a94db1ec /gcc/gdbhooks.py
parentce1c99f1ccd7b1229a4f8531d6b6de6cf571a9ef (diff)
downloadgcc-59a576f274b9093fd4b25eb6be556b40c2424478.zip
gcc-59a576f274b9093fd4b25eb6be556b40c2424478.tar.gz
gcc-59a576f274b9093fd4b25eb6be556b40c2424478.tar.bz2
gcc: Fix gdbhooks.py VecPrinter for vec<> as well as vec<>* [PR109006]
gcc/ChangeLog: PR middle-end/109006 * gdbhooks.py (VecPrinter): Handle vec<T> as well as vec<T>*.
Diffstat (limited to 'gcc/gdbhooks.py')
-rw-r--r--gcc/gdbhooks.py11
1 files changed, 7 insertions, 4 deletions
diff --git a/gcc/gdbhooks.py b/gcc/gdbhooks.py
index 78e6c97..e29bd45 100644
--- a/gcc/gdbhooks.py
+++ b/gcc/gdbhooks.py
@@ -461,13 +461,16 @@ class VecPrinter:
return
m_vecpfx = self.gdbval['m_vecpfx']
m_num = m_vecpfx['m_num']
- typ = self.gdbval.type
+ val = self.gdbval
+ typ = val.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())
+ else:
+ val = val.address
+ typ_T = typ.template_argument(0) # the type T
+ vecdata = (val + 1).cast(typ_T.pointer())
for i in range(m_num):
- yield ('[%d]' % i, m_vecdata[i])
+ yield ('[%d]' % i, vecdata[i])
######################################################################