core/anal: give better names to function when they have symbols

This commit is contained in:
Riccardo Schirone 2016-02-23 13:39:24 +01:00 committed by pancake
parent 490689c3ac
commit dddb490969
2 changed files with 10 additions and 6 deletions

View File

@ -361,12 +361,18 @@ static int core_anal_fcn(RCore *core, ut64 at, ut64 from, int reftype, int depth
continue;
}
}
f = r_flag_get_i (core->flags, fcn->addr);
f = r_flag_get_i2 (core->flags, fcn->addr);
free (fcn->name);
if (f && *f->name)
if (f && *f->name) {
fcn->name = strdup (f->name);
else
fcn->name = r_str_newf ("fcn.%08"PFMT64x, fcn->addr);
} else {
f = r_flag_get_i (core->flags, fcn->addr);
if (f && *f->name) {
fcn->name = strdup (f->name);
} else {
fcn->name = r_str_newf ("fcn.%08"PFMT64x, fcn->addr);
}
}
if (fcnlen == R_ANAL_RET_ERROR ||
(fcnlen == R_ANAL_RET_END && fcn->size < 1)) { /* Error analyzing function */

View File

@ -217,8 +217,6 @@ R_API RFlagItem *r_flag_get_i2(RFlag *f, ut64 off) {
if (!list) return NULL;
r_list_foreach (list, iter, item) {
// XXX: hack, because some times the hashtable is poluted by ghost values
if (item->offset != off) continue;
if (!item->name) continue;
/* catch sym. first */
if (!strncmp (item->name, "loc.", 4)) continue;