File tree Expand file tree Collapse file tree 3 files changed +9
-3
lines changed
Expand file tree Collapse file tree 3 files changed +9
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ fn main() {
3434 println! (" Function count: {}" , bv . functions (). len ());
3535
3636 for func in & bv . functions () {
37- println! (" {}:" , func . symbol () . full_name ());
37+ println! (" {}: {} " , func . start (), func . symbol ());
3838 }
3939}
4040```
Original file line number Diff line number Diff line change @@ -17,7 +17,7 @@ fn main() {
1717 println ! ( "Function count: {}" , bv. functions( ) . len( ) ) ;
1818
1919 for func in & bv. functions ( ) {
20- println ! ( "{:? }:" , func. symbol( ) . full_name ( ) ) ;
20+ println ! ( "{}:" , func. symbol( ) ) ;
2121 for basic_block in & func. basic_blocks ( ) {
2222 // TODO : This is intended to be refactored to be more nice to work with soon(TM)
2323 for addr in basic_block. as_ref ( ) {
Original file line number Diff line number Diff line change 1515//! Interfaces for the various kinds of symbols in a binary.
1616
1717use std:: fmt;
18- use std:: fmt:: Debug ;
18+ use std:: fmt:: { Debug , Display , Formatter } ;
1919use std:: hash:: { Hash , Hasher } ;
2020use std:: ptr;
2121
@@ -349,3 +349,9 @@ impl PartialEq for Symbol {
349349 self . handle == other. handle
350350 }
351351}
352+
353+ impl Display for Symbol {
354+ fn fmt ( & self , f : & mut Formatter < ' _ > ) -> fmt:: Result {
355+ f. write_str ( & self . short_name ( ) . to_string_lossy ( ) )
356+ }
357+ }
You can’t perform that action at this time.
0 commit comments