summaryrefslogtreecommitdiff
path: root/rust/examples/dwarf/shared/src
diff options
context:
space:
mode:
authorJosh Ferrell <josh@vector35.com>2024-06-06 15:41:48 -0400
committerJosh Ferrell <josh@vector35.com>2024-06-06 15:41:48 -0400
commit783a3cb0f4c2f2943653293937010b3de1aaf900 (patch)
treefb9090dd138d4058b24b3e286d3647a95a651b13 /rust/examples/dwarf/shared/src
parent7dd6f311b81460478b2ffc2726bfd3cb0e62c9ed (diff)
Support for local debug directories
Diffstat (limited to 'rust/examples/dwarf/shared/src')
-rw-r--r--rust/examples/dwarf/shared/src/lib.rs10
1 files changed, 7 insertions, 3 deletions
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
}