1+ use core:: any:: Any ;
2+
13use egui:: ScrollArea ;
2- use objdiff_core:: {
3- arch:: ppc:: ExceptionInfo ,
4- obj:: { Object , Symbol } ,
5- } ;
4+ use objdiff_core:: { arch:: ppc:: ExceptionInfo , obj:: Object } ;
65
76use crate :: views:: { appearance:: Appearance , function_diff:: FunctionDiffContext } ;
87
@@ -26,19 +25,19 @@ fn decode_extab(extab: &ExceptionInfo) -> String {
2625 text
2726}
2827
29- fn find_extab_entry < ' a > ( _obj : & ' a Object , _symbol : & Symbol ) -> Option < & ' a ExceptionInfo > {
30- // TODO
31- // obj. arch. ppc().and_then(|ppc| ppc.extab_for_symbol(symbol) )
32- None
28+ fn find_extab_entry ( obj : & Object , symbol_index : usize ) -> Option < & ExceptionInfo > {
29+ ( obj . arch . as_ref ( ) as & dyn Any )
30+ . downcast_ref :: < objdiff_core :: arch:: ppc:: ArchPpc > ( )
31+ . and_then ( |ppc| ppc . extab_for_symbol ( symbol_index ) )
3332}
3433
3534fn extab_text_ui (
3635 ui : & mut egui:: Ui ,
3736 ctx : FunctionDiffContext < ' _ > ,
38- symbol : & Symbol ,
37+ symbol_index : usize ,
3938 appearance : & Appearance ,
4039) -> Option < ( ) > {
41- if let Some ( extab_entry) = find_extab_entry ( ctx. obj , symbol ) {
40+ if let Some ( extab_entry) = find_extab_entry ( ctx. obj , symbol_index ) {
4241 let text = decode_extab ( extab_entry) ;
4342 ui. colored_label ( appearance. replace_color , & text) ;
4443 return Some ( ( ) ) ;
@@ -58,10 +57,8 @@ pub(crate) fn extab_ui(
5857 ui. style_mut ( ) . override_text_style = Some ( egui:: TextStyle :: Monospace ) ;
5958 ui. style_mut ( ) . wrap_mode = Some ( egui:: TextWrapMode :: Extend ) ;
6059
61- if let Some ( symbol) =
62- ctx. symbol_ref . and_then ( |symbol_ref| ctx. obj . symbols . get ( symbol_ref) )
63- {
64- extab_text_ui ( ui, ctx, symbol, appearance) ;
60+ if let Some ( symbol_index) = ctx. symbol_ref {
61+ extab_text_ui ( ui, ctx, symbol_index, appearance) ;
6562 }
6663 } ) ;
6764 } ) ;
0 commit comments