Fix dmi honoring dmm on Mac debugger

This commit is contained in:
pancake 2017-05-29 11:45:13 +02:00
parent a504ece143
commit 78ecad3d3b
3 changed files with 18 additions and 3 deletions

View File

@ -939,6 +939,13 @@ static ut64 addroflib(RCore *core, const char *libname) {
RDebugMap *map;
r_debug_map_sync (core->dbg);
// RList *list = r_debug_native_modules_get (core->dbg);
RList *list = r_debug_modules_list (core->dbg);
r_list_foreach (list, iter, map) {
if (strstr (map->name, libname)) {
return map->addr;
}
}
r_list_foreach (core->dbg->maps, iter, map) {
if (strstr (map->name, libname)) {
return map->addr;
@ -952,6 +959,12 @@ static RDebugMap *get_closest_map(RCore *core, ut64 addr) {
RDebugMap *map;
r_debug_map_sync (core->dbg);
RList *list = r_debug_modules_list (core->dbg);
r_list_foreach (list, iter, map) {
if (addr != UT64_MAX && (addr >= map->addr && addr < map->addr_end)) {
return map;
}
}
r_list_foreach (core->dbg->maps, iter, map) {
if (addr != UT64_MAX && (addr >= map->addr && addr < map->addr_end)) {
return map;
@ -1142,6 +1155,7 @@ static int cmd_debug_map(RCore *core, const char *input) {
} else {
cmd = r_str_newf ("rabin2 %s-B 0x%08"PFMT64x" -s %s", mode, baddr, file);
}
// eprintf ("CMD (%s)\n", cmd);
res = r_sys_cmd_str (cmd, NULL, NULL);
r_cons_println (res);
free (res);

View File

@ -1158,7 +1158,7 @@ static void cursor_nextrow(RCore *core, bool use_ocur) {
//int cols = r_config_get_i (core->config, "hex.cols") * 3.5;
int cols = r_config_get_i (core->config, "hex.cols") + r_config_get_i (core->config, "hex.pcols");
cols /= 2;
p->cur += cols > 0? cols: 3;
p->cur += cols > 0? cols: 0;
return;
}
if (PIDX == 2 && core->seltab == 1) {
@ -1176,7 +1176,7 @@ static void cursor_nextrow(RCore *core, bool use_ocur) {
return;
}
if (p->row_offsets != NULL) {
if (p->row_offsets) {
// FIXME: cache the current row
row = r_print_row_at_off (p, p->cur);
roff = r_print_rowoff (p, row);
@ -1213,7 +1213,7 @@ static void cursor_prevrow(RCore *core, bool use_ocur) {
if (PIDX == 7 || !strcmp ("prc", r_config_get (core->config, "cmd.visual"))) {
int cols = r_config_get_i (core->config, "hex.cols") + r_config_get_i (core->config, "hex.pcols");
cols /= 2;
p->cur -= cols > 0? cols: 3;
p->cur -= cols > 0? cols: 0;
return;
}
if (PIDX == 2 && core->seltab == 1) {

View File

@ -230,6 +230,7 @@ R_API RBreakpointItem *r_debug_bp_add(RDebug *dbg, ut64 addr, int hw, char *modu
break;
}
}
r_list_free (list);
} else {
//module holds the address
addr = (ut64)r_num_math (dbg->num, module);