aboutsummaryrefslogtreecommitdiff
path: root/lib/std/debug.zig
diff options
context:
space:
mode:
authorLemonBoy <thatlemon@gmail.com>2020-01-29 18:40:52 +0100
committerAndrew Kelley <andrew@ziglang.org>2020-01-30 09:11:02 -0500
commite77a102e24c351a56cdda5bad5a46dcd58101c23 (patch)
treeea493333a599355f0a1941c0d13a69eae59f2a44 /lib/std/debug.zig
parent7ebc624a15c5a01d6bee8eaf9c7487b30ed1904c (diff)
downloadzig-e77a102e24c351a56cdda5bad5a46dcd58101c23.tar.gz
zig-e77a102e24c351a56cdda5bad5a46dcd58101c23.zip
Small DWARF fixups
* Clang doesn't seem to emit a DW_AT_low_pc together with DW_AT_ranges for asm files. * Keep reading the other CUs if the lookup fails.
Diffstat (limited to 'lib/std/debug.zig')
-rw-r--r--lib/std/debug.zig10
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig
index d035707a54..a5fd1a4712 100644
--- a/lib/std/debug.zig
+++ b/lib/std/debug.zig
@@ -1390,8 +1390,12 @@ pub const DwarfInfo = struct {
// All the addresses in the list are relative to the value
// specified by DW_AT_low_pc or to some other value encoded
- // in the list itself
- var base_address = try compile_unit.die.getAttrAddr(DW.AT_low_pc);
+ // in the list itself.
+ // If no starting value is specified use zero.
+ var base_address = compile_unit.die.getAttrAddr(DW.AT_low_pc) catch |err| switch (err) {
+ error.MissingDebugInfo => 0,
+ else => return err,
+ };
try s.seekable_stream.seekTo(ranges_offset);
@@ -1410,8 +1414,6 @@ pub const DwarfInfo = struct {
return compile_unit;
}
}
-
- return error.InvalidDebugInfo;
} else |err| {
if (err != error.MissingDebugInfo) return err;
continue;