diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-03-16 14:08:06 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2022-03-16 14:08:06 -0400 |
| commit | d4a7a9ac4cf64ef6bf0b1aed16282c3d8b47b431 (patch) | |
| tree | f0d318ae9cf8ec6ca029aa9ecf4aa3d01dcf025c /lib/std | |
| parent | 8a43d67c3bf878fa32ef4876897a32969a4b5d24 (diff) | |
| parent | 4ff7553d6b918e4eef643d10bd8f41492355f39c (diff) | |
| download | zig-d4a7a9ac4cf64ef6bf0b1aed16282c3d8b47b431.tar.gz zig-d4a7a9ac4cf64ef6bf0b1aed16282c3d8b47b431.zip | |
Merge pull request #11191 from Snektron/zig-gdb-improvements
Zig gdb improvements
Diffstat (limited to 'lib/std')
| -rw-r--r-- | lib/std/hash_map.zig | 14 | ||||
| -rw-r--r-- | lib/std/multi_array_list.zig | 14 |
2 files changed, 28 insertions, 0 deletions
diff --git a/lib/std/hash_map.zig b/lib/std/hash_map.zig index 8a29741d9e..8c4e6b2581 100644 --- a/lib/std/hash_map.zig +++ b/lib/std/hash_map.zig @@ -1,4 +1,5 @@ const std = @import("std.zig"); +const builtin = @import("builtin"); const assert = debug.assert; const autoHash = std.hash.autoHash; const debug = std.debug; @@ -1576,6 +1577,19 @@ pub fn HashMapUnmanaged( self.metadata = null; self.available = 0; } + + /// This function is used in tools/zig-gdb.py to fetch the header type to facilitate + /// fancy debug printing for this type. + fn gdbHelper(self: *Self, hdr: *Header) void { + _ = self; + _ = hdr; + } + + comptime { + if (builtin.mode == .Debug) { + _ = gdbHelper; + } + } }; } diff --git a/lib/std/multi_array_list.zig b/lib/std/multi_array_list.zig index 53eb8fa352..2af723d3a5 100644 --- a/lib/std/multi_array_list.zig +++ b/lib/std/multi_array_list.zig @@ -1,4 +1,5 @@ const std = @import("std.zig"); +const builtin = @import("builtin"); const assert = std.debug.assert; const meta = std.meta; const mem = std.mem; @@ -433,6 +434,19 @@ pub fn MultiArrayList(comptime S: type) type { fn FieldType(field: Field) type { return meta.fieldInfo(S, field).field_type; } + + /// This function is used in tools/zig-gdb.py to fetch the child type to facilitate + /// fancy debug printing for this type. + fn gdbHelper(self: *Self, child: *S) void { + _ = self; + _ = child; + } + + comptime { + if (builtin.mode == .Debug) { + _ = gdbHelper; + } + } }; } |
