File tree Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Expand file tree Collapse file tree 2 files changed +7
-8
lines changed Original file line number Diff line number Diff line change 1+ use binaryninjacore_sys:: * ;
12use core:: ffi;
23use ffi:: c_void;
34use std:: ptr:: NonNull ;
4- use log:: debug;
5- use binaryninjacore_sys:: * ;
65
76use crate :: binary_view:: BinaryView ;
87use crate :: disassembly:: { DisassemblyTextLine , InstructionTextToken } ;
@@ -42,8 +41,7 @@ pub trait CustomDataRenderer: Sized + Sync + Send + 'static {
4241 view : & BinaryView ,
4342 addr : u64 ,
4443 type_ : & Type ,
45- prefix : & InstructionTextToken ,
46- prefix_count : usize ,
44+ prefix : Vec < InstructionTextToken > ,
4745 width : usize ,
4846 types_ctx : & [ TypeContext ] ,
4947 language : & str ,
@@ -93,12 +91,14 @@ trait CustomDataRendererFFI: CustomDataRenderer {
9391 let ctxt = ctxt as * mut Self ;
9492 // SAFETY BNTypeContext and TypeContext are transparent
9593 let types = core:: slice:: from_raw_parts ( type_ctx as * mut TypeContext , ctx_count) ;
94+ let prefix = core:: slice:: from_raw_parts ( prefix, prefix_count)
95+ . iter ( ) . map ( InstructionTextToken :: from_raw)
96+ . collect :: < Vec < _ > > ( ) ;
9697 let result = ( * ctxt) . lines_for_data (
9798 & BinaryView :: from_raw ( view) ,
9899 addr,
99100 & Type :: from_raw ( type_) ,
100- & InstructionTextToken :: from_raw ( & * prefix) ,
101- prefix_count,
101+ prefix,
102102 width,
103103 types,
104104 ffi:: CStr :: from_ptr ( language) . to_str ( ) . unwrap ( ) ,
Original file line number Diff line number Diff line change @@ -28,8 +28,7 @@ fn test_data_renderer_basic() {
2828 _view : & BinaryView ,
2929 addr : u64 ,
3030 type_ : & Type ,
31- _prefix : & InstructionTextToken ,
32- _prefix_count : usize ,
31+ _prefix : Vec < InstructionTextToken > ,
3332 width : usize ,
3433 _types_ctx : & [ TypeContext ] ,
3534 _language : & str ,
You can’t perform that action at this time.
0 commit comments