summaryrefslogtreecommitdiff
path: root/rust/examples/dwarf/dwarf_import/src/lib.rs
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-06-06 21:48:58 -0400
committerJosh Ferrell <josh@vector35.com>2024-06-06 21:48:58 -0400
commit7a521850cfce3f0b879210a34907380642c3b220 (patch)
tree1579d60fc5e110cd3dfc958fb29923723bb28256 /rust/examples/dwarf/dwarf_import/src/lib.rs
parent783a3cb0f4c2f2943653293937010b3de1aaf900 (diff)
Fix DWARF parser reporting as valid for any binary with a build id
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src/lib.rs')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/lib.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/lib.rs b/rust/examples/dwarf/dwarf_import/src/lib.rs
index 1f4fce4d..71367bfc 100644
--- a/rust/examples/dwarf/dwarf_import/src/lib.rs
+++ b/rust/examples/dwarf/dwarf_import/src/lib.rs
@@ -271,8 +271,8 @@ struct DWARFParser;
impl CustomDebugInfoParser for DWARFParser {
fn is_valid(&self, view: &BinaryView) -> bool {
dwarfreader::is_valid(view) ||
- dwarfreader::can_use_build_id(view) ||
- dwarfreader::can_use_debuginfod(view)
+ dwarfreader::can_use_debuginfod(view) ||
+ (dwarfreader::has_build_id_section(view) && helpers::find_local_debug_file(view).is_some())
}
fn parse_info(
@@ -283,7 +283,7 @@ impl CustomDebugInfoParser for DWARFParser {
progress: Box<dyn Fn(usize, usize) -> Result<(), ()>>,
) -> bool {
let external_file = if !dwarfreader::is_valid(bv) {
- if dwarfreader::can_use_build_id(bv) {
+ if dwarfreader::has_build_id_section(bv) {
if let Ok(Some(debug_view)) = helpers::load_debug_info_for_build_id(bv) {
Some(debug_view)
}