From feb8981a95988434506bad9864498e2ff1ff9243 Mon Sep 17 00:00:00 2001 From: Robin Voetter Date: Wed, 16 Mar 2022 15:38:30 +0100 Subject: gdb: add slice, multi array list, and array hash map printers --- lib/std/multi_array_list.zig | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'lib/std/multi_array_list.zig') 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; + } + } }; } -- cgit v1.2.3