diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2024-08-02 17:45:31 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2024-08-07 00:48:32 -0700 |
| commit | de47acd732dca8b4d2f2b3559307f488ccac940d (patch) | |
| tree | 06bba0e41326343b49bee8f164b03f791c8c7f21 /lib/std/debug.zig | |
| parent | 2e12b45d8b43d69e144887df4b04a2d383ff25d4 (diff) | |
| download | zig-de47acd732dca8b4d2f2b3559307f488ccac940d.tar.gz zig-de47acd732dca8b4d2f2b3559307f488ccac940d.zip | |
code coverage dumping tool basic implementation
* std.debug.Dwarf: add `sortCompileUnits` along with a field to track
the state for the purpose of assertions and correct API usage.
This makes batch lookups faster.
- in the future, findCompileUnit should be enhanced to rely on sorted
compile units as well.
* implement `std.debug.Dwarf.resolveSourceLocations` as well as
`std.debug.Info.resolveSourceLocations`. It's still pretty slow, since
it calls getLineNumberInfo for each array element, repeating a lot of
work unnecessarily.
* integrate these APIs with `std.Progress` to understand what is taking
so long.
The output I'm seeing from this tool shows a lot of missing source
locations. In particular, the main area of interest is missing for my
tokenizer fuzzing example.
Diffstat (limited to 'lib/std/debug.zig')
| -rw-r--r-- | lib/std/debug.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/std/debug.zig b/lib/std/debug.zig index 907f7711a7..6d034146c3 100644 --- a/lib/std/debug.zig +++ b/lib/std/debug.zig @@ -27,6 +27,12 @@ pub const SourceLocation = struct { line: u64, column: u64, file_name: []const u8, + + pub const invalid: SourceLocation = .{ + .line = 0, + .column = 0, + .file_name = &.{}, + }; }; pub const Symbol = struct { |
