@@ -2,10 +2,10 @@ use egui::{Id, Layout, RichText, ScrollArea, TextEdit, Ui, Widget, text::LayoutJ
2
2
use objdiff_core:: {
3
3
build:: BuildStatus ,
4
4
diff:: {
5
- DiffObjConfig , ObjectDiff , SectionDiff , SymbolDiff ,
5
+ DiffObjConfig , ObjectDiff , SymbolDiff ,
6
6
display:: { ContextItem , HoverItem , HoverItemColor , SymbolFilter , SymbolNavigationKind } ,
7
7
} ,
8
- obj:: { Object , Section , Symbol } ,
8
+ obj:: { Object , Symbol } ,
9
9
} ;
10
10
use time:: format_description;
11
11
@@ -34,7 +34,6 @@ enum SelectedSymbol {
34
34
struct DiffColumnContext < ' a > {
35
35
status : & ' a BuildStatus ,
36
36
obj : Option < & ' a ( Object , ObjectDiff ) > ,
37
- section : Option < ( & ' a Section , & ' a SectionDiff , usize ) > ,
38
37
symbol : Option < ( & ' a Symbol , & ' a SymbolDiff , usize ) > ,
39
38
}
40
39
@@ -54,30 +53,21 @@ impl<'a> DiffColumnContext<'a> {
54
53
_ => None ,
55
54
} ,
56
55
} ;
57
- let ( section , symbol) = match ( obj, selected_symbol) {
56
+ let symbol = match ( obj, selected_symbol) {
58
57
( Some ( ( obj, obj_diff) ) , Some ( SelectedSymbol :: Symbol ( symbol_ref) ) ) => {
59
58
let symbol = & obj. symbols [ symbol_ref] ;
60
- (
61
- symbol. section . map ( |section_idx| {
62
- ( & obj. sections [ section_idx] , & obj_diff. sections [ section_idx] , section_idx)
63
- } ) ,
64
- Some ( ( symbol, & obj_diff. symbols [ symbol_ref] , symbol_ref) ) ,
65
- )
59
+ Some ( ( symbol, & obj_diff. symbols [ symbol_ref] , symbol_ref) )
66
60
}
67
- _ => ( None , None ) ,
61
+ _ => None ,
68
62
} ;
69
- Self { status, obj, section , symbol }
63
+ Self { status, obj, symbol }
70
64
}
71
65
72
66
#[ inline]
73
- pub fn has_symbol ( & self ) -> bool { self . section . is_some ( ) || self . symbol . is_some ( ) }
67
+ pub fn has_symbol ( & self ) -> bool { self . symbol . is_some ( ) }
74
68
75
69
#[ inline]
76
- pub fn id ( & self ) -> Option < & str > {
77
- self . symbol
78
- . map ( |( symbol, _, _) | symbol. name . as_str ( ) )
79
- . or_else ( || self . section . map ( |( section, _, _) | section. name . as_str ( ) ) )
80
- }
70
+ pub fn id ( & self ) -> Option < & str > { self . symbol . map ( |( symbol, _, _) | symbol. name . as_str ( ) ) }
81
71
}
82
72
83
73
#[ must_use]
@@ -122,10 +112,7 @@ pub fn diff_view_ui(
122
112
{
123
113
navigation. right_symbol = Some ( target_symbol_ref) ;
124
114
}
125
- } else if navigation. left_symbol . is_some ( )
126
- && left_ctx. obj . is_some ( )
127
- && left_ctx. section . is_none ( )
128
- {
115
+ } else if navigation. left_symbol . is_some ( ) && left_ctx. obj . is_some ( ) {
129
116
// Clear selection if symbol goes missing
130
117
navigation. left_symbol = None ;
131
118
}
@@ -136,10 +123,7 @@ pub fn diff_view_ui(
136
123
{
137
124
navigation. left_symbol = Some ( target_symbol_ref) ;
138
125
}
139
- } else if navigation. right_symbol . is_some ( )
140
- && right_ctx. obj . is_some ( )
141
- && right_ctx. section . is_none ( )
142
- {
126
+ } else if navigation. right_symbol . is_some ( ) && right_ctx. obj . is_some ( ) {
143
127
// Clear selection if symbol goes missing
144
128
navigation. right_symbol = None ;
145
129
}
@@ -214,12 +198,6 @@ pub fn diff_view_ui(
214
198
{
215
199
ret = Some ( action) ;
216
200
}
217
- } else if let Some ( ( section, _, _) ) = left_ctx. section {
218
- ui. label (
219
- RichText :: new ( section. name . clone ( ) )
220
- . font ( appearance. code_font . clone ( ) )
221
- . color ( appearance. highlight_color ) ,
222
- ) ;
223
201
} else if right_ctx. has_symbol ( ) {
224
202
ui. label (
225
203
RichText :: new ( "Choose target symbol" )
@@ -352,12 +330,6 @@ pub fn diff_view_ui(
352
330
{
353
331
ret = Some ( action) ;
354
332
}
355
- } else if let Some ( ( section, _, _) ) = right_ctx. section {
356
- ui. label (
357
- RichText :: new ( section. name . clone ( ) )
358
- . font ( appearance. code_font . clone ( ) )
359
- . color ( appearance. highlight_color ) ,
360
- ) ;
361
333
} else if left_ctx. has_symbol ( ) {
362
334
ui. label (
363
335
RichText :: new ( "Choose base symbol" )
@@ -707,31 +679,6 @@ fn diff_col_ui(
707
679
} ,
708
680
) ;
709
681
}
710
- } else if let Some ( ( _section, section_diff, _section_idx) ) = ctx. section {
711
- // Unused code for diffing an entire data section.
712
- hotkeys:: check_scroll_hotkeys ( ui, false ) ;
713
- let total_bytes =
714
- section_diff. data_diff . iter ( ) . fold ( 0usize , |accum, item| accum + item. len ) ;
715
- if total_bytes == 0 {
716
- return ret;
717
- }
718
- let total_rows = ( total_bytes - 1 ) / BYTES_PER_ROW + 1 ;
719
- let address = 0 ;
720
- let diffs = split_diffs ( & section_diff. data_diff , & section_diff. reloc_diff , address) ;
721
- render_table (
722
- ui,
723
- available_width / 2.0 ,
724
- 1 ,
725
- appearance. code_font . size ,
726
- total_rows,
727
- |row, _column| {
728
- let i = row. index ( ) ;
729
- let address = i * BYTES_PER_ROW ;
730
- row. col ( |ui| {
731
- data_row_ui ( ui, Some ( obj) , address, & diffs[ i] , appearance, column) ;
732
- } ) ;
733
- } ,
734
- ) ;
735
682
} else if let Some ( ( _other_symbol, _other_symbol_diff, other_symbol_idx) ) = other_ctx. symbol
736
683
{
737
684
if let Some ( action) = symbol_list_ui (
0 commit comments