diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-05-31 16:17:01 -0400 |
|---|---|---|
| committer | Josh F <negasora@users.noreply.github.com> | 2024-05-31 18:31:12 -0400 |
| commit | 5c7ab961657c6bcfc58c84cf93f850bdb102a425 (patch) | |
| tree | 4504372bf06fd286fe869f7281d17cfbce5a59fc /rust/examples/dwarf/shared/src | |
| parent | 725d4450e850eb64d4c3fcda7ae567750f4c741f (diff) | |
Add debuginfod support to dwarf_import
Diffstat (limited to 'rust/examples/dwarf/shared/src')
| -rw-r--r-- | rust/examples/dwarf/shared/src/lib.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/rust/examples/dwarf/shared/src/lib.rs b/rust/examples/dwarf/shared/src/lib.rs index 7712ff3b..76c903e4 100644 --- a/rust/examples/dwarf/shared/src/lib.rs +++ b/rust/examples/dwarf/shared/src/lib.rs @@ -20,6 +20,7 @@ use binaryninja::{ binaryview::{BinaryView, BinaryViewBase, BinaryViewExt}, databuffer::DataBuffer, Endianness, + settings::Settings, }; use std::{ffi::CString, rc::Rc}; @@ -52,6 +53,15 @@ pub fn is_raw_dwo_dwarf(view: &BinaryView) -> bool { } } +pub fn can_use_debuginfod(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); + } + } + false +} + pub fn is_valid(view: &BinaryView) -> bool { is_non_dwo_dwarf(view) || is_raw_non_dwo_dwarf(view) |
