| ... | ... | @@ -17,11 +17,11 @@ pub fn main() !void { |
| 17 | 17 | |
| 18 | 18 | const module = try debug_info.getModuleForAddress(add_addr); |
| 19 | 19 | const symbol = try module.getSymbolAtAddress(allocator, add_addr); |
| 20 | | defer symbol.deinit(allocator); |
| 20 | defer if (symbol.source_location) |sl| allocator.free(sl.file_name); |
| 21 | 21 | |
| 22 | | try testing.expectEqualStrings("add", symbol.symbol_name); |
| 23 | | try testing.expect(symbol.line_info != null); |
| 24 | | try testing.expectEqualStrings("shared_lib.c", std.fs.path.basename(symbol.line_info.?.file_name)); |
| 25 | | try testing.expectEqual(@as(u64, 3), symbol.line_info.?.line); |
| 26 | | try testing.expectEqual(@as(u64, 0), symbol.line_info.?.column); |
| 22 | try testing.expectEqualStrings("add", symbol.name); |
| 23 | try testing.expect(symbol.source_location != null); |
| 24 | try testing.expectEqualStrings("shared_lib.c", std.fs.path.basename(symbol.source_location.?.file_name)); |
| 25 | try testing.expectEqual(@as(u64, 3), symbol.source_location.?.line); |
| 26 | try testing.expectEqual(@as(u64, 0), symbol.source_location.?.column); |
| 27 | 27 | } |