@@ -192,11 +192,6 @@ pub trait BinaryViewExt: BinaryViewBase {
192
192
}
193
193
}
194
194
195
- fn type_name ( & self ) -> String {
196
- let ptr: * mut c_char = unsafe { BNGetViewType ( self . as_ref ( ) . handle ) } ;
197
- unsafe { BnString :: into_string ( ptr) }
198
- }
199
-
200
195
fn parent_view ( & self ) -> Option < Ref < BinaryView > > {
201
196
let raw_view_ptr = unsafe { BNGetParentView ( self . as_ref ( ) . handle ) } ;
202
197
match raw_view_ptr. is_null ( ) {
@@ -284,18 +279,46 @@ pub trait BinaryViewExt: BinaryViewBase {
284
279
unsafe { BNSetAnalysisHold ( self . as_ref ( ) . handle , enable) }
285
280
}
286
281
282
+ /// Runs the analysis pipeline, analyzing any data that has been marked for updates.
283
+ ///
284
+ /// You can explicitly mark a function to be updated with:
285
+ /// - [`Function::mark_updates_required`]
286
+ /// - [`Function::mark_caller_updates_required`]
287
+ ///
288
+ /// NOTE: This is a **non-blocking** call, use [`BinaryViewExt::update_analysis_and_wait`] if you
289
+ /// require analysis to have completed before moving on.
287
290
fn update_analysis ( & self ) {
288
291
unsafe {
289
292
BNUpdateAnalysis ( self . as_ref ( ) . handle ) ;
290
293
}
291
294
}
292
295
296
+ /// Runs the analysis pipeline, analyzing any data that has been marked for updates.
297
+ ///
298
+ /// You can explicitly mark a function to be updated with:
299
+ /// - [`Function::mark_updates_required`]
300
+ /// - [`Function::mark_caller_updates_required`]
301
+ ///
302
+ /// NOTE: This is a **blocking** call, use [`BinaryViewExt::update_analysis`] if you do not
303
+ /// need to wait for the analysis update to finish.
293
304
fn update_analysis_and_wait ( & self ) {
294
305
unsafe {
295
306
BNUpdateAnalysisAndWait ( self . as_ref ( ) . handle ) ;
296
307
}
297
308
}
298
309
310
+ /// Causes **all** functions to be reanalyzed.
311
+ ///
312
+ /// Use [`BinaryViewExt::update_analysis`] or [`BinaryViewExt::update_analysis_and_wait`] instead
313
+ /// if you want to incrementally update analysis.
314
+ ///
315
+ /// NOTE: This function does not wait for the analysis to finish.
316
+ fn reanalyze ( & self ) {
317
+ unsafe {
318
+ BNReanalyzeAllFunctions ( self . as_ref ( ) . handle ) ;
319
+ }
320
+ }
321
+
299
322
fn abort_analysis ( & self ) {
300
323
unsafe { BNAbortAnalysis ( self . as_ref ( ) . handle ) }
301
324
}
@@ -570,7 +593,7 @@ pub trait BinaryViewExt: BinaryViewBase {
570
593
}
571
594
}
572
595
573
- /// You likely would also like to call [`Self ::define_user_symbol`] to bind this data variable with a name
596
+ /// You likely would also like to call [`BinaryViewExt ::define_user_symbol`] to bind this data variable with a name
574
597
fn define_user_data_var < ' a , T : Into < Conf < & ' a Type > > > ( & self , addr : u64 , ty : T ) {
575
598
let mut owned_raw_ty = Conf :: < & Type > :: into_raw ( ty. into ( ) ) ;
576
599
unsafe {
@@ -2034,7 +2057,7 @@ unsafe impl Sync for BinaryView {}
2034
2057
impl std:: fmt:: Debug for BinaryView {
2035
2058
fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
2036
2059
f. debug_struct ( "BinaryView" )
2037
- . field ( "type_name " , & self . type_name ( ) )
2060
+ . field ( "view_type " , & self . view_type ( ) )
2038
2061
. field ( "file" , & self . file ( ) )
2039
2062
. field ( "original_image_base" , & self . original_image_base ( ) )
2040
2063
. field ( "start" , & self . start ( ) )
0 commit comments