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/multi_array_list.zig | |
| 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/multi_array_list.zig')
| -rw-r--r-- | lib/std/multi_array_list.zig | 14 |
1 files changed, 14 insertions, 0 deletions
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; + } + } }; } |
