@@ -56,7 +56,7 @@ fn symbol_hover_ui(ui: &mut Ui, symbol: &ObjSymbol) {
56
56
fn symbol_ui (
57
57
ui : & mut Ui ,
58
58
symbol : & ObjSymbol ,
59
- section : Option < ( usize , & ObjSection ) > ,
59
+ section : Option < & ObjSection > ,
60
60
highlighted_symbol : & mut Option < String > ,
61
61
selected_symbol : & mut Option < SymbolReference > ,
62
62
current_view : & mut View ,
@@ -97,14 +97,18 @@ fn symbol_ui(
97
97
. context_menu ( |ui| symbol_context_menu_ui ( ui, symbol) )
98
98
. on_hover_ui_at_pointer ( |ui| symbol_hover_ui ( ui, symbol) ) ;
99
99
if response. clicked ( ) {
100
- if let Some ( ( section_index , section) ) = section {
100
+ if let Some ( section) = section {
101
101
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
+ } ) ;
104
106
* current_view = View :: FunctionDiff ;
105
107
} 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
+ } ) ;
108
112
* current_view = View :: DataDiff ;
109
113
}
110
114
}
@@ -158,19 +162,19 @@ fn symbol_list_ui(
158
162
} ) ;
159
163
}
160
164
161
- for ( section_index , section) in obj. sections . iter ( ) . enumerate ( ) {
165
+ for section in & obj. sections {
162
166
CollapsingHeader :: new ( format ! ( "{} ({:x})" , section. name, section. size) )
163
167
. default_open ( true )
164
168
. show ( ui, |ui| {
165
- if section. name == ".text" && reverse_function_order {
169
+ if section. kind == ObjSectionKind :: Code && reverse_function_order {
166
170
for symbol in section. symbols . iter ( ) . rev ( ) {
167
171
if !symbol_matches_search ( symbol, & lower_search) {
168
172
continue ;
169
173
}
170
174
symbol_ui (
171
175
ui,
172
176
symbol,
173
- Some ( ( section_index , section) ) ,
177
+ Some ( section) ,
174
178
highlighted_symbol,
175
179
selected_symbol,
176
180
current_view,
@@ -185,7 +189,7 @@ fn symbol_list_ui(
185
189
symbol_ui (
186
190
ui,
187
191
symbol,
188
- Some ( ( section_index , section) ) ,
192
+ Some ( section) ,
189
193
highlighted_symbol,
190
194
selected_symbol,
191
195
current_view,
0 commit comments