Improve debug message when misleading a function name ##anal

This commit is contained in:
pancake 2021-11-02 11:48:28 +01:00 committed by GitHub
parent 5be4f6c092
commit f209fcb903
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -39,7 +39,9 @@ static bool __fcn_exists(RAnal *anal, const char *name, ut64 addr) {
}
RAnalFunction *f = ht_pp_find (anal->ht_name_fun, name, &found);
if (f && found) {
eprintf ("Invalid function name '%s' at 0x%08"PFMT64x"\n", name, addr);
if (f->addr != addr) {
eprintf ("Invalid function name '%s' at 0x%08"PFMT64x" (function at 0x%08"PFMT64x")\n", name, addr, f->addr);
}
return true;
}
// check if there's a function already in the given address

View File

@ -368,9 +368,7 @@ EXPECT=<<EOF
0x00001337 0 0 func
EOF
EXPECT_ERR=<<EOF
Invalid function name 'func' at 0x00001337
Cannot add function (duplicated)
Invalid function name 'func' at 0x00001337
Cannot add function (duplicated)
EOF
RUN