@@ -56,7 +56,7 @@ fn symbol_hover_ui(ui: &mut Ui, symbol: &ObjSymbol) {
5656fn symbol_ui (
5757 ui : & mut Ui ,
5858 symbol : & ObjSymbol ,
59- section : Option < ( usize , & ObjSection ) > ,
59+ section : Option < & ObjSection > ,
6060 highlighted_symbol : & mut Option < String > ,
6161 selected_symbol : & mut Option < SymbolReference > ,
6262 current_view : & mut View ,
@@ -97,14 +97,18 @@ fn symbol_ui(
9797 . context_menu ( |ui| symbol_context_menu_ui ( ui, symbol) )
9898 . on_hover_ui_at_pointer ( |ui| symbol_hover_ui ( ui, symbol) ) ;
9999 if response. clicked ( ) {
100- if let Some ( ( section_index , section) ) = section {
100+ if let Some ( section) = section {
101101 if section. kind == ObjSectionKind :: Code {
102- * selected_symbol =
103- Some ( SymbolReference { symbol_name : symbol. name . clone ( ) , section_index } ) ;
102+ * selected_symbol = Some ( SymbolReference {
103+ symbol_name : symbol. name . clone ( ) ,
104+ section_name : section. name . clone ( ) ,
105+ } ) ;
104106 * current_view = View :: FunctionDiff ;
105107 } else if section. kind == ObjSectionKind :: Data {
106- * selected_symbol =
107- Some ( SymbolReference { symbol_name : section. name . clone ( ) , section_index } ) ;
108+ * selected_symbol = Some ( SymbolReference {
109+ symbol_name : section. name . clone ( ) ,
110+ section_name : section. name . clone ( ) ,
111+ } ) ;
108112 * current_view = View :: DataDiff ;
109113 }
110114 }
@@ -158,19 +162,19 @@ fn symbol_list_ui(
158162 } ) ;
159163 }
160164
161- for ( section_index , section) in obj. sections . iter ( ) . enumerate ( ) {
165+ for section in & obj. sections {
162166 CollapsingHeader :: new ( format ! ( "{} ({:x})" , section. name, section. size) )
163167 . default_open ( true )
164168 . show ( ui, |ui| {
165- if section. name == ".text" && reverse_function_order {
169+ if section. kind == ObjSectionKind :: Code && reverse_function_order {
166170 for symbol in section. symbols . iter ( ) . rev ( ) {
167171 if !symbol_matches_search ( symbol, & lower_search) {
168172 continue ;
169173 }
170174 symbol_ui (
171175 ui,
172176 symbol,
173- Some ( ( section_index , section) ) ,
177+ Some ( section) ,
174178 highlighted_symbol,
175179 selected_symbol,
176180 current_view,
@@ -185,7 +189,7 @@ fn symbol_list_ui(
185189 symbol_ui (
186190 ui,
187191 symbol,
188- Some ( ( section_index , section) ) ,
192+ Some ( section) ,
189193 highlighted_symbol,
190194 selected_symbol,
191195 current_view,
0 commit comments