File tree Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Expand file tree Collapse file tree 2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -115,7 +115,8 @@ fn get_hover_item_color_for_diff_kind(diff_kind: DataDiffKind) -> HoverItemColor
115
115
pub ( crate ) fn data_row_ui (
116
116
ui : & mut egui:: Ui ,
117
117
obj : Option < & Object > ,
118
- address : usize ,
118
+ base_address : usize ,
119
+ row_address : usize ,
119
120
diffs : & [ ( DataDiff , Vec < DataRelocationDiff > ) ] ,
120
121
appearance : & Appearance ,
121
122
column : usize ,
@@ -127,15 +128,15 @@ pub(crate) fn data_row_ui(
127
128
}
128
129
let mut job = LayoutJob :: default ( ) ;
129
130
write_text (
130
- format ! ( "{address :08x}: " ) . as_str ( ) ,
131
+ format ! ( "{row_address :08x}: " ) . as_str ( ) ,
131
132
appearance. text_color ,
132
133
& mut job,
133
134
appearance. code_font . clone ( ) ,
134
135
) ;
135
136
// The offset shown on the side of the GUI, shifted by insertions/deletions.
136
137
let mut cur_addr = 0usize ;
137
138
// The offset into the actual bytes of the section on this side, ignoring differences.
138
- let mut cur_addr_actual = address ;
139
+ let mut cur_addr_actual = base_address + row_address ;
139
140
for ( diff, reloc_diffs) in diffs {
140
141
let base_color = get_color_for_diff_kind ( diff. kind , appearance) ;
141
142
if diff. data . is_empty ( ) {
Original file line number Diff line number Diff line change @@ -507,13 +507,14 @@ pub fn diff_view_ui(
507
507
total_rows,
508
508
|row, column| {
509
509
let i = row. index ( ) ;
510
- let address = i * BYTES_PER_ROW ;
510
+ let row_offset = i * BYTES_PER_ROW ;
511
511
row. col ( |ui| {
512
512
if column == 0 {
513
513
data_row_ui (
514
514
ui,
515
515
Some ( left_obj) ,
516
- address + left_symbol. address as usize ,
516
+ left_symbol. address as usize ,
517
+ row_offset,
517
518
& left_diffs[ i] ,
518
519
appearance,
519
520
column,
@@ -522,7 +523,8 @@ pub fn diff_view_ui(
522
523
data_row_ui (
523
524
ui,
524
525
Some ( right_obj) ,
525
- address + right_symbol. address as usize ,
526
+ right_symbol. address as usize ,
527
+ row_offset,
526
528
& right_diffs[ i] ,
527
529
appearance,
528
530
column,
@@ -642,12 +644,13 @@ fn diff_col_ui(
642
644
total_rows,
643
645
|row, _column| {
644
646
let i = row. index ( ) ;
645
- let address = i * BYTES_PER_ROW ;
647
+ let row_offset = i * BYTES_PER_ROW ;
646
648
row. col ( |ui| {
647
649
data_row_ui (
648
650
ui,
649
651
Some ( obj) ,
650
- address + symbol. address as usize ,
652
+ symbol. address as usize ,
653
+ row_offset,
651
654
& diffs[ i] ,
652
655
appearance,
653
656
column,
You can’t perform that action at this time.
0 commit comments