summaryrefslogtreecommitdiff
path: root/rust/examples
diff options
context:
space:
mode:
Diffstat (limited to 'rust/examples')
-rw-r--r--rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs6
-rw-r--r--rust/examples/dwarf/dwarf_import/src/functions.rs9
2 files changed, 11 insertions, 4 deletions
diff --git a/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs b/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs
index 408b373f..3e5cc1bf 100644
--- a/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs
+++ b/rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs
@@ -260,7 +260,6 @@ impl DebugInfoBuilder {
return Some(*idx);
}
}
-
else if let Some(ident) = &full_name {
// check if we already know about this full name's index
// if we do, and the raw name will change, remove the known raw index if it exists
@@ -282,9 +281,8 @@ impl DebugInfoBuilder {
return Some(*idx);
}
}
-
- if raw_name.is_none() && full_name.is_none() {
- error!("Function entry in DWARF without full or raw name. Please report this issue.");
+ else {
+ debug!("Function entry in DWARF without full or raw name.");
return None;
}
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, &parameters, variable_arguments)
}