Commit d354daf143

Jacob Young <jacobly0@users.noreply.github.com>
2024-09-11 22:20:56
lldb: disable pretty printers on self-hosted backends
1 parent 65f6623
Changed files (1)
tools/lldb_pretty_printers.py
@@ -1,7 +1,7 @@
 # pretty printing for the zig language, zig standard library, and zig stage 2 compiler.
 # put commands in ~/.lldbinit to run them automatically when starting lldb
 # `command script import /path/to/zig/tools/lldb_pretty_printers.py` to import this file
-# `type category enable zig` to enable pretty printing for the zig language
+# `type category enable zig.lang` to enable pretty printing for the zig language
 # `type category enable zig.std` to enable pretty printing for the zig standard library
 # `type category enable zig.stage2` to enable pretty printing for the zig stage 2 compiler
 import lldb
@@ -688,11 +688,14 @@ def add(debugger, *, category, regex=False, type, identifier=None, synth=False,
 def MultiArrayList_Entry(type): return '^multi_array_list\\.MultiArrayList\\(%s\\)\\.Entry__struct_[1-9][0-9]*$' % type
 
 def __lldb_init_module(debugger, _=None):
+    # Initialize Zig Categories
+    debugger.HandleCommand('type category define --language c99 zig.lang zig.std')
+
     # Initialize Zig Language
-    add(debugger, category='zig', regex=True, type='^\\[\\]', identifier='zig_Slice', synth=True, expand=True, summary='len=${svar%#}')
-    add(debugger, category='zig', type='[]u8', identifier='zig_String', summary=True)
-    add(debugger, category='zig', regex=True, type='^\\?', identifier='zig_Optional', synth=True, summary=True)
-    add(debugger, category='zig', regex=True, type='^(error{.*}|anyerror)!', identifier='zig_ErrorUnion', synth=True, inline_children=True, summary=True)
+    add(debugger, category='zig.lang', regex=True, type='^\\[\\]', identifier='zig_Slice', synth=True, expand=True, summary='len=${svar%#}')
+    add(debugger, category='zig.lang', type='[]u8', identifier='zig_String', summary=True)
+    add(debugger, category='zig.lang', regex=True, type='^\\?', identifier='zig_Optional', synth=True, summary=True)
+    add(debugger, category='zig.lang', regex=True, type='^(error{.*}|anyerror)!', identifier='zig_ErrorUnion', synth=True, inline_children=True, summary=True)
 
     # Initialize Zig Standard Library
     add(debugger, category='zig.std', type='mem.Allocator', summary='${var.ptr}')