mirror of
https://github.com/radareorg/radare2.git
synced 2025-01-19 12:22:43 +00:00
core/disasm: change cursor when in the middle of an instruction
fix #3748
This commit is contained in:
parent
3989c94c5a
commit
fce421b0f0
@ -700,17 +700,25 @@ static void handle_atabs_option(RCore *core, RDisasmState *ds) {
|
||||
}
|
||||
|
||||
static void handle_print_show_cursor (RCore *core, RDisasmState *ds) {
|
||||
char res[] = " ";
|
||||
char res[] = " ";
|
||||
void *p;
|
||||
int q;
|
||||
if (!core || !ds || !ds->show_marks)
|
||||
return;
|
||||
q = core->print->cur_enabled &&
|
||||
ds->cursor >= ds->index &&
|
||||
ds->cursor < (ds->index+ds->asmop.size);
|
||||
ds->cursor < (ds->index + ds->asmop.size);
|
||||
p = r_bp_get_at (core->dbg->bp, ds->at);
|
||||
if (p) res[0] = 'b';
|
||||
if (q) res[1] = '*';
|
||||
if (q) {
|
||||
if (ds->cursor == ds->index) {
|
||||
res[1] = '*';
|
||||
} else {
|
||||
int i = 1, diff = ds->cursor - ds->index;
|
||||
if (diff > 9) res[i++] = '0' + (diff / 10);
|
||||
res[i] = '0' + (diff % 10);
|
||||
}
|
||||
}
|
||||
r_cons_strcat (res);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user