diff options
| author | Josh Ferrell <josh@vector35.com> | 2024-08-04 20:38:33 -0400 |
|---|---|---|
| committer | Josh Ferrell <josh@vector35.com> | 2024-08-07 16:25:48 -0400 |
| commit | 264a5cf77a2562ac07d67a9e71babb6a5a14e31c (patch) | |
| tree | ada32ec3d9a839c7c74c2a2c9931bb6800f91185 /rust/examples/dwarf/dwarf_import/src/functions.rs | |
| parent | 102c3b87334c8f8a3e3c570eb9aeaa33746f38d9 (diff) | |
Change error when applying function without name from dwarf info to debug
Diffstat (limited to 'rust/examples/dwarf/dwarf_import/src/functions.rs')
| -rw-r--r-- | rust/examples/dwarf/dwarf_import/src/functions.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/functions.rs b/rust/examples/dwarf/dwarf_import/src/functions.rs index ea6aba4d..9ca01a2c 100644 --- a/rust/examples/dwarf/dwarf_import/src/functions.rs +++ b/rust/examples/dwarf/dwarf_import/src/functions.rs @@ -21,6 +21,7 @@ use crate::types::get_type; use binaryninja::templatesimplifier::simplify_str_to_str; use cpp_demangle::DemangleOptions; use gimli::{constants, DebuggingInformationEntry, Dwarf, Unit}; +use log::debug; use regex::Regex; fn get_parameters<R: ReaderType>( @@ -117,5 +118,13 @@ pub(crate) fn parse_function_entry<R: ReaderType>( full_name = debug_info_builder_context.get_name(dwarf, unit, entry) } + if raw_name.is_none() && full_name.is_none() { + debug!( + "Function entry in DWARF without full or raw name: .debug_info offset {:?}", + entry.offset().to_debug_info_offset(&unit.header) + ); + return None; + } + debug_info_builder.insert_function(full_name, raw_name, return_type, address, ¶meters, variable_arguments) } |
