| ... | @@ -478,6 +478,24 @@ class InternPool_Index_SynthProvider: | ... | @@ -478,6 +478,24 @@ class InternPool_Index_SynthProvider: |
| 478 | except: return -1 | 478 | except: return -1 |
| 479 | def get_child_at_index(self, index): return (self.tag, self.data, self.trailing)[index] if index in range(3) else None | 479 | def get_child_at_index(self, index): return (self.tag, self.data, self.trailing)[index] if index in range(3) else None |
| 480 | | 480 | |
| | 481 | def InternPool_NullTerminatedString_SummaryProvider(value, _=None): |
| | 482 | try: |
| | 483 | ip = InternPool_Find(value.thread) |
| | 484 | if not ip: return |
| | 485 | items = ip.GetChildMemberWithName('string_bytes').GetChildMemberWithName('items') |
| | 486 | b = bytearray() |
| | 487 | i = 0 |
| | 488 | while True: |
| | 489 | x = items.GetChildAtIndex(value.unsigned + i).GetValueAsUnsigned() |
| | 490 | if x == 0: break |
| | 491 | b.append(x) |
| | 492 | i += 1 |
| | 493 | s = b.decode(encoding='utf8', errors='backslashreplace') |
| | 494 | s1 = s if s.isprintable() else ''.join((c if c.isprintable() else '\\x%02x' % ord(c) for c in s)) |
| | 495 | return '"%s"' % s1 |
| | 496 | except: |
| | 497 | pass |
| | 498 | |
| 481 | def type_Type_pointer(payload): | 499 | def type_Type_pointer(payload): |
| 482 | pointee_type = payload.GetChildMemberWithName('pointee_type') | 500 | pointee_type = payload.GetChildMemberWithName('pointee_type') |
| 483 | sentinel = payload.GetChildMemberWithName('sentinel').GetChildMemberWithName('child') | 501 | sentinel = payload.GetChildMemberWithName('sentinel').GetChildMemberWithName('child') |
| ... | @@ -690,6 +708,7 @@ def __lldb_init_module(debugger, _=None): | ... | @@ -690,6 +708,7 @@ def __lldb_init_module(debugger, _=None): |
| 690 | add(debugger, category='zig.stage2', type='Module.Decl::Module.Decl.Index', synth=True) | 708 | add(debugger, category='zig.stage2', type='Module.Decl::Module.Decl.Index', synth=True) |
| 691 | add(debugger, category='zig.stage2', type='Module.LazySrcLoc', identifier='zig_TaggedUnion', synth=True) | 709 | add(debugger, category='zig.stage2', type='Module.LazySrcLoc', identifier='zig_TaggedUnion', synth=True) |
| 692 | add(debugger, category='zig.stage2', type='InternPool.Index', synth=True) | 710 | add(debugger, category='zig.stage2', type='InternPool.Index', synth=True) |
| | 711 | add(debugger, category='zig.stage2', type='InternPool.NullTerminatedString', summary=True) |
| 693 | add(debugger, category='zig.stage2', type='InternPool.Key', identifier='zig_TaggedUnion', synth=True) | 712 | add(debugger, category='zig.stage2', type='InternPool.Key', identifier='zig_TaggedUnion', synth=True) |
| 694 | add(debugger, category='zig.stage2', type='InternPool.Key.Int.Storage', identifier='zig_TaggedUnion', synth=True) | 713 | add(debugger, category='zig.stage2', type='InternPool.Key.Int.Storage', identifier='zig_TaggedUnion', synth=True) |
| 695 | add(debugger, category='zig.stage2', type='InternPool.Key.ErrorUnion.Value', identifier='zig_TaggedUnion', synth=True) | 714 | add(debugger, category='zig.stage2', type='InternPool.Key.ErrorUnion.Value', identifier='zig_TaggedUnion', synth=True) |