Skip to content

Use the symbol table if the DWARF only has line numbers #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 4, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@ jobs:
if: contains(matrix.os, 'ubuntu')
- run: cargo clean && RUSTFLAGS="-Z run-dsymutil=no" cargo test --features gimli-symbolize
if: matrix.thing == 'macos-nightly'
- run: cargo clean && RUSTFLAGS="-Z split-dwarf=split -C save-temps" cargo test --features gimli-symbolize
if: matrix.thing == 'nightly'
- run: cargo build --manifest-path crates/as-if-std/Cargo.toml

windows_arm64:
Expand Down
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ cpp_demangle = { default-features = false, version = "0.3.0", optional = true }

# Optional dependencies enabled through the `gimli-symbolize` feature, do not
# use these features directly.
addr2line = { version = "0.14.0", optional = true, default-features = false }
addr2line = { version = "0.14.1", optional = true, default-features = false }
miniz_oxide = { version = "0.4.0", optional = true, default-features = false }
[dependencies.object]
version = "0.22"
Expand Down
2 changes: 1 addition & 1 deletion crates/as-if-std/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ bench = false
cfg-if = "1.0"
rustc-demangle = "0.1.4"
libc = { version = "0.2.45", default-features = false }
addr2line = { version = "0.14.0", default-features = false }
addr2line = { version = "0.14.1", default-features = false }
miniz_oxide = { version = "0.4.0", default-features = false }

[dependencies.object]
Expand Down
6 changes: 5 additions & 1 deletion src/symbolize/gimli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -621,10 +621,14 @@ pub unsafe fn resolve(what: ResolveWhat<'_>, cb: &mut dyn FnMut(&super::Symbol))
if let Ok(mut frames) = cx.dwarf.find_frames(addr as u64) {
while let Ok(Some(frame)) = frames.next() {
any_frames = true;
let name = match frame.function {
Some(f) => Some(f.name.slice()),
None => cx.object.search_symtab(addr as u64),
};
call(Symbol::Frame {
addr: addr as *mut c_void,
location: frame.location,
name: frame.function.map(|f| f.name.slice()),
name,
});
}
}
Expand Down