Skip to content

Commit

Permalink
Merge updated gdb pretty-printer
Browse files Browse the repository at this point in the history
Fixing the array size member name after #1400 changed it.

Related PR: #1500
  • Loading branch information
upsj authored Dec 7, 2023
2 parents 457ed4c + 8ae98d3 commit c67dc10
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions dev_tools/scripts/gdb-ginkgo.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@ def __next__(self):

def __init__(self, val):
self.val = val
self.size = int(self.val['size_'])
self.execname = str(
self.val['exec_']['_M_ptr']
.dereference()
Expand All @@ -206,12 +207,12 @@ def __init__(self, val):
def children(self):
return self._iterator(self.execname,
self.pointer,
self.val['num_elems_'])
self.size)

def to_string(self):
return ('{} of length {} on {} ({})'
.format(str(self.val.type),
int(self.val['num_elems_']),
self.size,
self.execname,
self.pointer))

Expand All @@ -223,7 +224,7 @@ def lookup_type(val):
if not str(val.type.unqualified()).startswith('gko::'):
return None
suffix = str(val.type.unqualified())[5:]
if suffix.startswith('array'):
if suffix.startswith('array<') and val.type.code == gdb.TYPE_CODE_STRUCT:
return GkoArrayPrinter(val)
return None

Expand Down

0 comments on commit c67dc10

Please sign in to comment.