From 783a3cb0f4c2f2943653293937010b3de1aaf900 Mon Sep 17 00:00:00 2001 From: Josh Ferrell Date: Thu, 6 Jun 2024 15:41:48 -0400 Subject: Support for local debug directories --- rust/examples/dwarf/shared/src/lib.rs | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'rust/examples/dwarf/shared/src') diff --git a/rust/examples/dwarf/shared/src/lib.rs b/rust/examples/dwarf/shared/src/lib.rs index 76c903e4..e3d1315d 100644 --- a/rust/examples/dwarf/shared/src/lib.rs +++ b/rust/examples/dwarf/shared/src/lib.rs @@ -54,10 +54,14 @@ pub fn is_raw_dwo_dwarf(view: &BinaryView) -> bool { } pub fn can_use_debuginfod(view: &BinaryView) -> bool { + can_use_build_id(view) && + Settings::new("") + .get_bool("network.enableDebuginfod", Some(view), None) +} + +pub fn can_use_build_id(view: &BinaryView) -> bool { if let Ok(raw_view) = view.raw_view() { - if raw_view.section_by_name(".note.gnu.build-id").is_ok() { - return Settings::new("").get_bool("network.enableDebuginfod", Some(view), None); - } + return raw_view.section_by_name(".note.gnu.build-id").is_ok() } false } -- cgit v1.3.1