diff options
| author | Mason Reed <35282038+emesare@users.noreply.github.com> | 2025-12-15 19:41:38 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-12-15 19:41:38 -0500 |
| commit | 2e5b893b79e053dbacd8a72cc900d1af1d825041 (patch) | |
| tree | 4f44f4332f2453492fd747725a4ce8546e116754 /rust/src/variable.rs | |
| parent | 8e409a0854292eb7e61420b7bfc904a1156b4a68 (diff) | |
[Rust] Return Array in more debug info functions (#7744)
Diffstat (limited to 'rust/src/variable.rs')
| -rw-r--r-- | rust/src/variable.rs | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/rust/src/variable.rs b/rust/src/variable.rs index d224a45b..fe833f97 100644 --- a/rust/src/variable.rs +++ b/rust/src/variable.rs @@ -8,13 +8,13 @@ use crate::string::{raw_to_string, BnString}; use crate::types::Type; use binaryninjacore_sys::{ BNDataVariable, BNDataVariableAndName, BNFreeDataVariableAndName, BNFreeDataVariables, - BNFreeILInstructionList, BNFreeIndirectBranchList, BNFreeMergedVariableList, - BNFreePossibleValueSet, BNFreeStackVariableReferenceList, BNFreeUserVariableValues, - BNFreeVariableList, BNFreeVariableNameAndTypeList, BNFromVariableIdentifier, - BNIndirectBranchInfo, BNLookupTableEntry, BNMergedVariable, BNPossibleValueSet, - BNRegisterValue, BNRegisterValueType, BNStackVariableReference, BNToVariableIdentifier, - BNTypeWithConfidence, BNUserVariableValue, BNValueRange, BNVariable, BNVariableNameAndType, - BNVariableSourceType, + BNFreeDataVariablesAndName, BNFreeILInstructionList, BNFreeIndirectBranchList, + BNFreeMergedVariableList, BNFreePossibleValueSet, BNFreeStackVariableReferenceList, + BNFreeUserVariableValues, BNFreeVariableList, BNFreeVariableNameAndTypeList, + BNFromVariableIdentifier, BNIndirectBranchInfo, BNLookupTableEntry, BNMergedVariable, + BNPossibleValueSet, BNRegisterValue, BNRegisterValueType, BNStackVariableReference, + BNToVariableIdentifier, BNTypeWithConfidence, BNUserVariableValue, BNValueRange, BNVariable, + BNVariableNameAndType, BNVariableSourceType, }; use std::collections::HashSet; @@ -147,6 +147,22 @@ impl NamedDataVariableWithType { } } +impl CoreArrayProvider for NamedDataVariableWithType { + type Raw = BNDataVariableAndName; + type Context = (); + type Wrapped<'a> = NamedDataVariableWithType; +} + +unsafe impl CoreArrayProviderInner for NamedDataVariableWithType { + unsafe fn free(raw: *mut Self::Raw, count: usize, _context: &Self::Context) { + BNFreeDataVariablesAndName(raw, count) + } + + unsafe fn wrap_raw<'a>(raw: &'a Self::Raw, _context: &'a Self::Context) -> Self::Wrapped<'a> { + Self::from_raw(raw) + } +} + #[derive(Debug, Clone, Hash, PartialEq, Eq)] pub struct NamedVariableWithType { pub variable: Variable, |
