From 00a11421e60e3dd94c2ba5d8be8bbc49e3c919af Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Tue, 21 Apr 2026 21:01:06 -0700 Subject: [PATCH] remove stage1 debug helpers python code --- tools/stage1_gdb_pretty_printers.py | 37 ----------------------------- 1 file changed, 37 deletions(-) delete mode 100644 tools/stage1_gdb_pretty_printers.py diff --git a/tools/stage1_gdb_pretty_printers.py b/tools/stage1_gdb_pretty_printers.py deleted file mode 100644 index 64eb27f25e..0000000000 --- a/tools/stage1_gdb_pretty_printers.py +++ /dev/null @@ -1,37 +0,0 @@ -# pretty printing for stage1. -# put "source /path/to/stage1_gdb_pretty_printers.py" in ~/.gdbinit to load it automatically. -import gdb.printing - -class ZigListPrinter: - def __init__(self, val): - self.val = val - - def to_string(self): - return '%s of length %d, capacity %d' % (self.val.type.name, int(self.val['length']), int(self.val['capacity'])) - - def children(self): - def it(ziglist): - for i in range(int(ziglist.val['length'])): - item = ziglist.val['items'] + i - yield ('[%d]' % i, item.dereference()) - return it(self) - - def display_hint(self): - return 'array' - -# handle both Buf and ZigList because Buf* doesn't work otherwise (gdb bug?) -class BufPrinter: - def __init__(self, val): - self.val = val['list'] if val.type.name == 'Buf' else val - - def to_string(self): - return self.val['items'].string(length=int(self.val['length'])) - - def display_hint(self): - return 'string' - -pp = gdb.printing.RegexpCollectionPrettyPrinter('Zig stage1 compiler') -pp.add_printer('Buf', '^Buf$', BufPrinter) -pp.add_printer('ZigList', '^ZigList$', BufPrinter) -pp.add_printer('ZigList', '^ZigList<.*>$', ZigListPrinter) -gdb.printing.register_pretty_printer(gdb.current_objfile(), pp)