Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion cpp/gdb_arrow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1843,6 +1843,7 @@ def to_string(self):
"nonstd::sv_lite::basic_string_view": StringViewPrinter,
}


def arrow_pretty_print(val):
name = val.type.strip_typedefs().name
if name is None:
Expand Down Expand Up @@ -1891,4 +1892,17 @@ def arrow_pretty_print(val):
return ScalarPrinter(val)


gdb.pretty_printers.append(arrow_pretty_print)
def main():
# This pattern allows for two modes of use:
# - manual loading using `source gdb-arrow.py`: current_objfile()
# will be None;
# - automatic loading from the GDB `scripts-directory`: current_objfile()
# will be tied to the inferior being debugged.
objfile = gdb.current_objfile()
if objfile is None:
objfile = gdb

objfile.pretty_printers.append(arrow_pretty_print)


main()