Skip to content

Commit 264a5cf

Browse files
committed
Change error when applying function without name from dwarf info to debug
1 parent 102c3b8 commit 264a5cf

File tree

2 files changed

+11
-4
lines changed

2 files changed

+11
-4
lines changed

rust/examples/dwarf/dwarf_import/src/dwarfdebuginfo.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,6 @@ impl DebugInfoBuilder {
260260
return Some(*idx);
261261
}
262262
}
263-
264263
else if let Some(ident) = &full_name {
265264
// check if we already know about this full name's index
266265
// if we do, and the raw name will change, remove the known raw index if it exists
@@ -282,9 +281,8 @@ impl DebugInfoBuilder {
282281
return Some(*idx);
283282
}
284283
}
285-
286-
if raw_name.is_none() && full_name.is_none() {
287-
error!("Function entry in DWARF without full or raw name. Please report this issue.");
284+
else {
285+
debug!("Function entry in DWARF without full or raw name.");
288286
return None;
289287
}
290288

rust/examples/dwarf/dwarf_import/src/functions.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ use crate::types::get_type;
2121
use binaryninja::templatesimplifier::simplify_str_to_str;
2222
use cpp_demangle::DemangleOptions;
2323
use gimli::{constants, DebuggingInformationEntry, Dwarf, Unit};
24+
use log::debug;
2425
use regex::Regex;
2526

2627
fn get_parameters<R: ReaderType>(
@@ -117,5 +118,13 @@ pub(crate) fn parse_function_entry<R: ReaderType>(
117118
full_name = debug_info_builder_context.get_name(dwarf, unit, entry)
118119
}
119120

121+
if raw_name.is_none() && full_name.is_none() {
122+
debug!(
123+
"Function entry in DWARF without full or raw name: .debug_info offset {:?}",
124+
entry.offset().to_debug_info_offset(&unit.header)
125+
);
126+
return None;
127+
}
128+
120129
debug_info_builder.insert_function(full_name, raw_name, return_type, address, &parameters, variable_arguments)
121130
}

0 commit comments

Comments
 (0)