Print marks on flags if asm.offset=false (#11773)

This commit is contained in:
Luca Di Bartolomeo 2018-10-15 13:48:59 +02:00 committed by radare
parent 24ff3e276e
commit 3bf4288577

View File

@ -439,17 +439,6 @@ static void ds_comment_lineup(RDisasmState *ds) {
_ALIGN;
}
static void ds_begin_comment(RDisasmState *ds) {
if (ds->show_comment_right) {
_ALIGN;
} else {
if (ds->use_json) {
ds_begin_json_line (ds);
}
ds_pre_xrefs (ds, false);
}
}
static void ds_comment_(RDisasmState *ds, bool align, bool nl, const char *format, va_list ap) {
if (ds->show_comments) {
if (ds->show_comment_right && align) {
@ -1099,18 +1088,6 @@ static void ds_newline(RDisasmState *ds) {
}
}
static void ds_pre_xrefs(RDisasmState *ds, bool no_fcnlines) {
ds_setup_pre (ds, false, false);
if (ds->pre != DS_PRE_NONE && ds->pre != DS_PRE_EMPTY) {
ds->pre = no_fcnlines ? DS_PRE_EMPTY : DS_PRE_FCN_MIDDLE;
}
ds_print_pre (ds);
char *tmp = ds->line;
ds->line = ds->refline2;
ds_print_lines_left (ds);
ds->line = tmp;
}
static void ds_show_refs(RDisasmState *ds) {
RAnalRef *ref;
RListIter *iter;
@ -1405,6 +1382,32 @@ static void ds_print_show_cursor(RDisasmState *ds) {
r_cons_strcat (res);
}
static void ds_pre_xrefs(RDisasmState *ds, bool no_fcnlines) {
ds_setup_pre (ds, false, false);
if (ds->pre != DS_PRE_NONE && ds->pre != DS_PRE_EMPTY) {
ds->pre = no_fcnlines ? DS_PRE_EMPTY : DS_PRE_FCN_MIDDLE;
}
ds_print_pre (ds);
char *tmp = ds->line;
ds->line = ds->refline2;
ds_print_lines_left (ds);
if (!ds->show_offset && ds->show_marks) {
ds_print_show_cursor (ds);
}
ds->line = tmp;
}
static void ds_begin_comment(RDisasmState *ds) {
if (ds->show_comment_right) {
_ALIGN;
} else {
if (ds->use_json) {
ds_begin_json_line (ds);
}
ds_pre_xrefs (ds, false);
}
}
static int var_comparator(const RAnalVar *a, const RAnalVar *b){
if (a && b) {
return a->delta > b->delta;
@ -1703,11 +1706,10 @@ beach:
idx = 0;
}
spaces[idx] = 0;
ds_setup_print_pre (ds, false, true);
ds_pre_xrefs (ds, false);
tmp = ds->line;
ds->line = ds->refline2;
ds_print_lines_left (ds);
ds->line = tmp;
if (ds->show_flgoff) {
@ -1901,12 +1903,8 @@ static void ds_show_comments_right(RDisasmState *ds) {
r_cons_strcat (" ; [z] unfold");
}
free (p);
} else {
if (ds->show_comment_right) {
_ALIGN;
} else {
ds_pre_xrefs (ds, false);
}
if (ds->show_color) {
r_cons_strcat (ds->color_usrcmt);
}
@ -1983,10 +1981,14 @@ static void ds_show_flags(RDisasmState *ds) {
}
ds_begin_json_line (ds);
bool fake_flag_marks = (!ds->show_offset && ds->show_marks);
if (ds->show_flgoff) {
ds_beginline (ds);
ds_print_offset (ds);
if (!fake_flag_marks) {
r_cons_printf (" ");
}
} else {
bool no_fcn_lines = (f && f->addr == flag->offset);
ds_pre_xrefs (ds, no_fcn_lines);
@ -2008,7 +2010,7 @@ static void ds_show_flags(RDisasmState *ds) {
}
}
if (!ds->show_flgoff) {
if (!ds->show_flgoff || fake_flag_marks) {
r_cons_printf (";-- ");
}