diff options
| author | Mason Reed <mason@vector35.com> | 2026-02-22 17:08:21 -0800 |
|---|---|---|
| committer | Mason Reed <35282038+emesare@users.noreply.github.com> | 2026-02-23 00:09:44 -0800 |
| commit | b18bdad6c94a8e234108d531f0c480c7104abebe (patch) | |
| tree | b0edb86cfae52c37635ef0b5cac491220bc3ef24 /plugins/warp | |
| parent | dbd54d67a6d523f64615f653d82d8224cd09870a (diff) | |
[Rust] Misc documentation and cleanup
Diffstat (limited to 'plugins/warp')
| -rw-r--r-- | plugins/warp/src/processor.rs | 7 | ||||
| -rw-r--r-- | plugins/warp/tests/matcher.rs | 5 |
2 files changed, 8 insertions, 4 deletions
diff --git a/plugins/warp/src/processor.rs b/plugins/warp/src/processor.rs index e21a2efd..12403ed2 100644 --- a/plugins/warp/src/processor.rs +++ b/plugins/warp/src/processor.rs @@ -29,6 +29,7 @@ use binaryninja::rc::{Guard, Ref}; use crate::cache::cached_type_references; use crate::convert::platform_to_target; use crate::{build_function, INCLUDE_TAG_ICON, INCLUDE_TAG_NAME}; +use binaryninja::file_metadata::{SaveOption, SaveSettings}; use warp::chunk::{Chunk, ChunkKind, CompressionType}; use warp::r#type::chunk::TypeChunk; use warp::signature::chunk::SignatureChunk; @@ -645,7 +646,11 @@ impl WarpFileProcessor { if !view.file().is_database_backed() { // Update the cache. tracing::debug!("Saving analysis database to {:?}", file_cache_path); - if !view.file().create_database(&file_cache_path) { + let save_settings = SaveSettings::new().with_option(SaveOption::RemoveUndoData); + if !view + .file() + .create_database(&file_cache_path, &save_settings) + { // TODO: We might want to error here... tracing::warn!("Failed to save analysis database to {:?}", file_cache_path); } diff --git a/plugins/warp/tests/matcher.rs b/plugins/warp/tests/matcher.rs index 880112d0..d2d7a960 100644 --- a/plugins/warp/tests/matcher.rs +++ b/plugins/warp/tests/matcher.rs @@ -33,8 +33,7 @@ const MOCK_FUNCTION_BYTES: &[u8] = &[ fn create_mock_bn_function(_session: &Session) -> Ref<BNFunction> { let file = FileMetadata::new(); - let view = - BinaryView::from_data(&file, MOCK_FUNCTION_BYTES).expect("Failed to create mock view"); + let view = BinaryView::from_data(&file, MOCK_FUNCTION_BYTES); let platform = Platform::by_name("x86").unwrap(); // Add the constraint symbol so that the matcher picks it up, so we can test constraint matching. let constraint_symbol = @@ -160,7 +159,7 @@ fn test_add_type_to_view() { let _session = Session::new().expect("Failed to create session"); let file = FileMetadata::new(); - let view = BinaryView::from_data(&file, &[]).expect("Failed to create view"); + let view = BinaryView::from_data(&file, &[]); let arch = CoreArchitecture::by_name("x86").expect("Failed to get architecture"); // Try and add a NTR to the view, this should also add the referenced struct type. |
