diff options
Diffstat (limited to 'plugins/dwarf')
| -rw-r--r-- | plugins/dwarf/dwarf_import/src/die_handlers.rs | 16 | ||||
| -rw-r--r-- | plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs | 2 | ||||
| -rw-r--r-- | plugins/dwarf/dwarf_import/src/helpers.rs | 6 | ||||
| -rw-r--r-- | plugins/dwarf/dwarf_import/src/types.rs | 8 | ||||
| -rw-r--r-- | plugins/dwarf/shared/src/lib.rs | 7 |
5 files changed, 20 insertions, 19 deletions
diff --git a/plugins/dwarf/dwarf_import/src/die_handlers.rs b/plugins/dwarf/dwarf_import/src/die_handlers.rs index 52280320..f71fdabc 100644 --- a/plugins/dwarf/dwarf_import/src/die_handlers.rs +++ b/plugins/dwarf/dwarf_import/src/die_handlers.rs @@ -47,19 +47,19 @@ pub(crate) fn handle_base_type<R: ReaderType>( constants::DW_ATE_address => None, constants::DW_ATE_boolean => Some(Type::bool()), constants::DW_ATE_complex_float => None, - constants::DW_ATE_float => Some(Type::named_float(size, name)), - constants::DW_ATE_signed => Some(Type::named_int(size, true, name)), - constants::DW_ATE_signed_char => Some(Type::named_int(size, true, name)), - constants::DW_ATE_unsigned => Some(Type::named_int(size, false, name)), - constants::DW_ATE_unsigned_char => Some(Type::named_int(size, false, name)), + constants::DW_ATE_float => Some(Type::named_float(size, &name)), + constants::DW_ATE_signed => Some(Type::named_int(size, true, &name)), + constants::DW_ATE_signed_char => Some(Type::named_int(size, true, &name)), + constants::DW_ATE_unsigned => Some(Type::named_int(size, false, &name)), + constants::DW_ATE_unsigned_char => Some(Type::named_int(size, false, &name)), constants::DW_ATE_imaginary_float => None, constants::DW_ATE_packed_decimal => None, constants::DW_ATE_numeric_string => None, constants::DW_ATE_edited => None, constants::DW_ATE_signed_fixed => None, constants::DW_ATE_unsigned_fixed => None, - constants::DW_ATE_decimal_float => Some(Type::named_float(size, name)), - constants::DW_ATE_UTF => Some(Type::named_int(size, false, name)), // TODO : Verify + constants::DW_ATE_decimal_float => Some(Type::named_float(size, &name)), + constants::DW_ATE_UTF => Some(Type::named_int(size, false, &name)), // TODO : Verify constants::DW_ATE_UCS => None, constants::DW_ATE_ASCII => None, // Some sort of array? constants::DW_ATE_lo_user => None, @@ -114,7 +114,7 @@ pub(crate) fn handle_enum<R: ReaderType>( match &child.entry().attr(constants::DW_AT_const_value) { Ok(Some(attr)) => { if let Some(value) = get_attr_as_u64(attr) { - enumeration_builder.insert(name, value); + enumeration_builder.insert(&name, value); } else { // Somehow the child entry is not a const value. log::error!("Unhandled enum member value type for `{}`", name); diff --git a/plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs b/plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs index 017ed4be..1cedbdf2 100644 --- a/plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs +++ b/plugins/dwarf/dwarf_import/src/dwarfdebuginfo.rs @@ -546,7 +546,7 @@ impl DebugInfoBuilder { assert!(debug_info.add_data_variable( address, &self.get_type(*type_uid).unwrap().ty, - name.clone(), + name.as_deref(), &[] // TODO : Components )); } diff --git a/plugins/dwarf/dwarf_import/src/helpers.rs b/plugins/dwarf/dwarf_import/src/helpers.rs index e23eb498..f2f67170 100644 --- a/plugins/dwarf/dwarf_import/src/helpers.rs +++ b/plugins/dwarf/dwarf_import/src/helpers.rs @@ -14,7 +14,7 @@ use std::ffi::OsStr; use std::path::{Path, PathBuf}; -use std::{collections::HashMap, ops::Deref, str::FromStr, sync::mpsc}; +use std::{ops::Deref, str::FromStr, sync::mpsc}; use crate::{DebugInfoBuilderContext, ReaderType}; use binaryninja::binary_view::BinaryViewBase; @@ -450,8 +450,8 @@ pub(crate) fn download_debug_info( let result = inst .perform_custom_request( "GET", - artifact_url, - HashMap::<String, String>::new(), + &artifact_url, + vec![], DownloadInstanceInputOutputCallbacks { read: None, write: Some(Box::new(write)), diff --git a/plugins/dwarf/dwarf_import/src/types.rs b/plugins/dwarf/dwarf_import/src/types.rs index 1e9dd146..78992510 100644 --- a/plugins/dwarf/dwarf_import/src/types.rs +++ b/plugins/dwarf/dwarf_import/src/types.rs @@ -215,8 +215,8 @@ fn do_structure_parse<R: ReaderType>( }); structure_builder.insert( - child_type.as_ref(), - child_name, + &child_type, + &child_name, struct_offset, false, MemberAccess::NoAccess, // TODO : Resolve actual scopes, if possible @@ -224,8 +224,8 @@ fn do_structure_parse<R: ReaderType>( ); } else { structure_builder.append( - child_type.as_ref(), - child_name, + &child_type, + &child_name, MemberAccess::NoAccess, MemberScope::NoScope, ); diff --git a/plugins/dwarf/shared/src/lib.rs b/plugins/dwarf/shared/src/lib.rs index c4ed7937..7aa3b486 100644 --- a/plugins/dwarf/shared/src/lib.rs +++ b/plugins/dwarf/shared/src/lib.rs @@ -179,9 +179,10 @@ pub fn create_section_reader<'a, Endian: 'a + Endianity>( } } // Truncate Mach-O section names to 16 bytes - else if let Some(section) = - view.section_by_name("__".to_string() + §ion_name[1..section_name.len().min(15)]) - { + else if let Some(section) = view.section_by_name(&format!( + "__{}", + §ion_name[1..section_name.len().min(15)] + )) { Ok(EndianRcSlice::new( Rc::from(view.read_vec(section.start(), section.len()).as_slice()), endian, |
