mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
std.debug.Dwarf: fix names of inlined functions
This commit is contained in:
parent
a12ce28224
commit
cedd9de64f
1 changed files with 7 additions and 1 deletions
|
|
@ -348,7 +348,13 @@ pub fn deinit(di: *Dwarf, gpa: Allocator) void {
|
|||
}
|
||||
|
||||
pub fn getSymbolName(di: *Dwarf, address: u64) ?[]const u8 {
|
||||
for (di.func_list.items) |*func| {
|
||||
// Iterate the function list backwards so that we see child DIEs before their parents. This is
|
||||
// important because `DW_TAG_inlined_subroutine` DIEs will have a range which is a sub-range of
|
||||
// their caller, and we want to return the callee's name, not the caller's.
|
||||
var i: usize = di.func_list.items.len;
|
||||
while (i > 0) {
|
||||
i -= 1;
|
||||
const func = &di.func_list.items[i];
|
||||
if (func.pc_range) |range| {
|
||||
if (address >= range.start and address < range.end) {
|
||||
return func.name;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue