Fix #5160 - make afbj great again

This commit is contained in:
pancake 2016-06-25 04:17:31 +02:00
parent 7e4cb2749e
commit 6ace96c3a5

View File

@ -612,7 +612,30 @@ static int anal_fcn_list_bb(RCore *core, const char *input) {
r_cons_printf ("0x%08" PFMT64x "\n", b->addr);
break;
case 'j':
r_cons_printf ("%" PFMT64d "%s", b->addr, iter->n? ",": "");
//r_cons_printf ("%" PFMT64d "%s", b->addr, iter->n? ",": "");
{
RListIter *iter2;
RAnalBlock *b2;
int inputs = 0;
int outputs = 0;
r_list_foreach (fcn->bbs, iter2, b2) {
if (b2->jump == b->addr) {
inputs++;
}
if (b2->fail == b->addr) {
inputs++;
}
}
if (b->jump != UT64_MAX) {
outputs ++;
}
if (b->fail != UT64_MAX) {
outputs ++;
}
r_cons_printf ("{\"addr\":%" PFMT64d ",\"size\":%d,\"inputs\":%d,\"outputs\":%d,\"ninstr\":%d,\"traced\":%s}%s",
b->addr, b->size, inputs, outputs, b->ninstr, r_str_bool (b->traced), iter->n? ",":"");
//%s", b->addr, iter->n? ",": "");
}
break;
default:
tp = r_debug_trace_get (core->dbg, b->addr);