@@ -27,7 +27,6 @@ struct annotate_browser {
27
27
struct rb_node * curr_hot ;
28
28
struct annotation_line * selection ;
29
29
struct arch * arch ;
30
- struct annotation_options * opts ;
31
30
bool searching_backwards ;
32
31
char search_bf [128 ];
33
32
};
@@ -97,7 +96,7 @@ static void annotate_browser__write(struct ui_browser *browser, void *entry, int
97
96
struct annotation_write_ops ops = {
98
97
.first_line = row == 0 ,
99
98
.current_entry = is_current_entry ,
100
- .change_color = (!notes -> options -> hide_src_code &&
99
+ .change_color = (!annotate_opts . hide_src_code &&
101
100
(!is_current_entry ||
102
101
(browser -> use_navkeypressed &&
103
102
!browser -> navkeypressed ))),
@@ -128,7 +127,7 @@ static int is_fused(struct annotate_browser *ab, struct disasm_line *cursor)
128
127
129
128
while (pos && pos -> al .offset == -1 ) {
130
129
pos = list_prev_entry (pos , al .node );
131
- if (!ab -> opts -> hide_src_code )
130
+ if (!annotate_opts . hide_src_code )
132
131
diff ++ ;
133
132
}
134
133
@@ -195,7 +194,7 @@ static void annotate_browser__draw_current_jump(struct ui_browser *browser)
195
194
return ;
196
195
}
197
196
198
- if (notes -> options -> hide_src_code ) {
197
+ if (annotate_opts . hide_src_code ) {
199
198
from = cursor -> al .idx_asm ;
200
199
to = target -> idx_asm ;
201
200
} else {
@@ -224,7 +223,7 @@ static unsigned int annotate_browser__refresh(struct ui_browser *browser)
224
223
int ret = ui_browser__list_head_refresh (browser );
225
224
int pcnt_width = annotation__pcnt_width (notes );
226
225
227
- if (notes -> options -> jump_arrows )
226
+ if (annotate_opts . jump_arrows )
228
227
annotate_browser__draw_current_jump (browser );
229
228
230
229
ui_browser__set_color (browser , HE_COLORSET_NORMAL );
@@ -258,7 +257,7 @@ static void disasm_rb_tree__insert(struct annotate_browser *browser,
258
257
parent = * p ;
259
258
l = rb_entry (parent , struct annotation_line , rb_node );
260
259
261
- if (disasm__cmp (al , l , browser -> opts -> percent_type ) < 0 )
260
+ if (disasm__cmp (al , l , annotate_opts . percent_type ) < 0 )
262
261
p = & (* p )-> rb_left ;
263
262
else
264
263
p = & (* p )-> rb_right ;
@@ -294,11 +293,10 @@ static void annotate_browser__set_top(struct annotate_browser *browser,
294
293
static void annotate_browser__set_rb_top (struct annotate_browser * browser ,
295
294
struct rb_node * nd )
296
295
{
297
- struct annotation * notes = browser__annotation (& browser -> b );
298
296
struct annotation_line * pos = rb_entry (nd , struct annotation_line , rb_node );
299
297
u32 idx = pos -> idx ;
300
298
301
- if (notes -> options -> hide_src_code )
299
+ if (annotate_opts . hide_src_code )
302
300
idx = pos -> idx_asm ;
303
301
annotate_browser__set_top (browser , pos , idx );
304
302
browser -> curr_hot = nd ;
@@ -331,7 +329,7 @@ static void annotate_browser__calc_percent(struct annotate_browser *browser,
331
329
double percent ;
332
330
333
331
percent = annotation_data__percent (& pos -> al .data [i ],
334
- browser -> opts -> percent_type );
332
+ annotate_opts . percent_type );
335
333
336
334
if (max_percent < percent )
337
335
max_percent = percent ;
@@ -380,12 +378,12 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser)
380
378
browser -> b .seek (& browser -> b , offset , SEEK_CUR );
381
379
al = list_entry (browser -> b .top , struct annotation_line , node );
382
380
383
- if (notes -> options -> hide_src_code ) {
381
+ if (annotate_opts . hide_src_code ) {
384
382
if (al -> idx_asm < offset )
385
383
offset = al -> idx ;
386
384
387
385
browser -> b .nr_entries = notes -> src -> nr_entries ;
388
- notes -> options -> hide_src_code = false;
386
+ annotate_opts . hide_src_code = false;
389
387
browser -> b .seek (& browser -> b , - offset , SEEK_CUR );
390
388
browser -> b .top_idx = al -> idx - offset ;
391
389
browser -> b .index = al -> idx ;
@@ -403,7 +401,7 @@ static bool annotate_browser__toggle_source(struct annotate_browser *browser)
403
401
offset = al -> idx_asm ;
404
402
405
403
browser -> b .nr_entries = notes -> src -> nr_asm_entries ;
406
- notes -> options -> hide_src_code = true;
404
+ annotate_opts . hide_src_code = true;
407
405
browser -> b .seek (& browser -> b , - offset , SEEK_CUR );
408
406
browser -> b .top_idx = al -> idx_asm - offset ;
409
407
browser -> b .index = al -> idx_asm ;
@@ -483,8 +481,8 @@ static bool annotate_browser__callq(struct annotate_browser *browser,
483
481
target_ms .map = ms -> map ;
484
482
target_ms .sym = dl -> ops .target .sym ;
485
483
annotation__unlock (notes );
486
- symbol__tui_annotate (& target_ms , evsel , hbt , browser -> opts );
487
- sym_title (ms -> sym , ms -> map , title , sizeof (title ), browser -> opts -> percent_type );
484
+ symbol__tui_annotate (& target_ms , evsel , hbt );
485
+ sym_title (ms -> sym , ms -> map , title , sizeof (title ), annotate_opts . percent_type );
488
486
ui_browser__show_title (& browser -> b , title );
489
487
return true;
490
488
}
@@ -659,15 +657,14 @@ bool annotate_browser__continue_search_reverse(struct annotate_browser *browser,
659
657
660
658
static int annotate_browser__show (struct ui_browser * browser , char * title , const char * help )
661
659
{
662
- struct annotate_browser * ab = container_of (browser , struct annotate_browser , b );
663
660
struct map_symbol * ms = browser -> priv ;
664
661
struct symbol * sym = ms -> sym ;
665
662
char symbol_dso [SYM_TITLE_MAX_SIZE ];
666
663
667
664
if (ui_browser__show (browser , title , help ) < 0 )
668
665
return -1 ;
669
666
670
- sym_title (sym , ms -> map , symbol_dso , sizeof (symbol_dso ), ab -> opts -> percent_type );
667
+ sym_title (sym , ms -> map , symbol_dso , sizeof (symbol_dso ), annotate_opts . percent_type );
671
668
672
669
ui_browser__gotorc_title (browser , 0 , 0 );
673
670
ui_browser__set_color (browser , HE_COLORSET_ROOT );
@@ -809,7 +806,7 @@ static int annotate_browser__run(struct annotate_browser *browser,
809
806
annotate_browser__show (& browser -> b , title , help );
810
807
continue ;
811
808
case 'k' :
812
- notes -> options -> show_linenr = !notes -> options -> show_linenr ;
809
+ annotate_opts . show_linenr = !annotate_opts . show_linenr ;
813
810
continue ;
814
811
case 'l' :
815
812
annotate_browser__show_full_location (& browser -> b );
@@ -822,18 +819,18 @@ static int annotate_browser__run(struct annotate_browser *browser,
822
819
ui_helpline__puts (help );
823
820
continue ;
824
821
case 'o' :
825
- notes -> options -> use_offset = !notes -> options -> use_offset ;
822
+ annotate_opts . use_offset = !annotate_opts . use_offset ;
826
823
annotation__update_column_widths (notes );
827
824
continue ;
828
825
case 'O' :
829
- if (++ notes -> options -> offset_level > ANNOTATION__MAX_OFFSET_LEVEL )
830
- notes -> options -> offset_level = ANNOTATION__MIN_OFFSET_LEVEL ;
826
+ if (++ annotate_opts . offset_level > ANNOTATION__MAX_OFFSET_LEVEL )
827
+ annotate_opts . offset_level = ANNOTATION__MIN_OFFSET_LEVEL ;
831
828
continue ;
832
829
case 'j' :
833
- notes -> options -> jump_arrows = !notes -> options -> jump_arrows ;
830
+ annotate_opts . jump_arrows = !annotate_opts . jump_arrows ;
834
831
continue ;
835
832
case 'J' :
836
- notes -> options -> show_nr_jumps = !notes -> options -> show_nr_jumps ;
833
+ annotate_opts . show_nr_jumps = !annotate_opts . show_nr_jumps ;
837
834
annotation__update_column_widths (notes );
838
835
continue ;
839
836
case '/' :
@@ -897,15 +894,15 @@ static int annotate_browser__run(struct annotate_browser *browser,
897
894
annotation__update_column_widths (notes );
898
895
continue ;
899
896
case 'c' :
900
- if (notes -> options -> show_minmax_cycle )
901
- notes -> options -> show_minmax_cycle = false;
897
+ if (annotate_opts . show_minmax_cycle )
898
+ annotate_opts . show_minmax_cycle = false;
902
899
else
903
- notes -> options -> show_minmax_cycle = true;
900
+ annotate_opts . show_minmax_cycle = true;
904
901
annotation__update_column_widths (notes );
905
902
continue ;
906
903
case 'p' :
907
904
case 'b' :
908
- switch_percent_type (browser -> opts , key == 'b' );
905
+ switch_percent_type (& annotate_opts , key == 'b' );
909
906
hists__scnprintf_title (hists , title , sizeof (title ));
910
907
annotate_browser__show (& browser -> b , title , help );
911
908
continue ;
@@ -932,26 +929,23 @@ static int annotate_browser__run(struct annotate_browser *browser,
932
929
}
933
930
934
931
int map_symbol__tui_annotate (struct map_symbol * ms , struct evsel * evsel ,
935
- struct hist_browser_timer * hbt ,
936
- struct annotation_options * opts )
932
+ struct hist_browser_timer * hbt )
937
933
{
938
- return symbol__tui_annotate (ms , evsel , hbt , opts );
934
+ return symbol__tui_annotate (ms , evsel , hbt );
939
935
}
940
936
941
937
int hist_entry__tui_annotate (struct hist_entry * he , struct evsel * evsel ,
942
- struct hist_browser_timer * hbt ,
943
- struct annotation_options * opts )
938
+ struct hist_browser_timer * hbt )
944
939
{
945
940
/* reset abort key so that it can get Ctrl-C as a key */
946
941
SLang_reset_tty ();
947
942
SLang_init_tty (0 , 0 , 0 );
948
943
949
- return map_symbol__tui_annotate (& he -> ms , evsel , hbt , opts );
944
+ return map_symbol__tui_annotate (& he -> ms , evsel , hbt );
950
945
}
951
946
952
947
int symbol__tui_annotate (struct map_symbol * ms , struct evsel * evsel ,
953
- struct hist_browser_timer * hbt ,
954
- struct annotation_options * opts )
948
+ struct hist_browser_timer * hbt )
955
949
{
956
950
struct symbol * sym = ms -> sym ;
957
951
struct annotation * notes = symbol__annotation (sym );
@@ -965,7 +959,6 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
965
959
.priv = ms ,
966
960
.use_navkeypressed = true,
967
961
},
968
- .opts = opts ,
969
962
};
970
963
struct dso * dso ;
971
964
int ret = -1 , err ;
@@ -996,7 +989,7 @@ int symbol__tui_annotate(struct map_symbol *ms, struct evsel *evsel,
996
989
browser .b .entries = & notes -> src -> source ,
997
990
browser .b .width += 18 ; /* Percentage */
998
991
999
- if (notes -> options -> hide_src_code )
992
+ if (annotate_opts . hide_src_code )
1000
993
ui_browser__init_asm_mode (& browser .b );
1001
994
1002
995
ret = annotate_browser__run (& browser , evsel , hbt );
0 commit comments