dtc now uses r_cons_printf
This commit is contained in:
parent
ab32c7bb95
commit
b45f07a39a
|
@ -761,6 +761,8 @@ static int cmd_debug(void *data, const char *input) {
|
|||
if (r_cons_singleton ()->breaked)
|
||||
break;
|
||||
r_debug_step (core->dbg, 1);
|
||||
if (r_debug_is_dead (core->dbg))
|
||||
break;
|
||||
if (checkbpcallback (core)) {
|
||||
eprintf ("Interrupted by a breakpoint\n");
|
||||
break;
|
||||
|
|
|
@ -502,6 +502,8 @@ R_API int r_core_init(RCore *core) {
|
|||
r_core_cmd_init (core);
|
||||
core->flags = r_flag_new ();
|
||||
core->dbg = r_debug_new (R_TRUE);
|
||||
core->dbg->graph->printf = (PrintfCallback)r_cons_printf;
|
||||
core->dbg->printf = (PrintfCallback)r_cons_printf;
|
||||
core->dbg->anal = core->anal; // XXX: dupped instance.. can cause lost pointerz
|
||||
//r_debug_use (core->dbg, "native");
|
||||
r_reg_arena_push (core->dbg->reg); // create a 2 level register state stack
|
||||
|
|
|
@ -197,6 +197,7 @@ typedef struct r_graph_t {
|
|||
RList *roots; // <RGraphNode>
|
||||
RListIter *cur; // ->data = RGraphNode*
|
||||
RList *nodes; // <RGraphNode>
|
||||
PrintfCallback printf;
|
||||
int level;
|
||||
} RGraph;
|
||||
|
||||
|
|
|
@ -44,13 +44,13 @@ static void walk_children (RGraph *t, RGraphNode *tn, int level) {
|
|||
return;
|
||||
}
|
||||
for (i=0; i<level; i++)
|
||||
eprintf (" ");
|
||||
eprintf ("%d: 0x%08"PFMT64x" refs %d\n",
|
||||
level, tn->addr, tn->refs);
|
||||
t->printf (" ");
|
||||
t->printf (" 0x%08"PFMT64x" refs %d\n",
|
||||
tn->addr, tn->refs);
|
||||
r_list_foreach (tn->parents, iter, n) {
|
||||
for (i=0; i<level; i++)
|
||||
eprintf (" ");
|
||||
eprintf (" ^ 0x%08"PFMT64x"\n", n->addr);
|
||||
t->printf (" ");
|
||||
t->printf (" |_ 0x%08"PFMT64x"\n", n->addr);
|
||||
}
|
||||
r_list_push (t->path, tn);
|
||||
r_list_foreach (tn->children, iter, n) {
|
||||
|
@ -73,6 +73,7 @@ R_API void r_graph_traverse(RGraph *t) {
|
|||
|
||||
R_API RGraph * r_graph_new () {
|
||||
RGraph *t = R_NEW0 (RGraph);
|
||||
t->printf = printf;
|
||||
t->path = r_list_new ();
|
||||
t->nodes = r_list_new ();
|
||||
t->roots = r_list_new ();
|
||||
|
|
Loading…
Reference in New Issue