Skip to content

Commit

Permalink
Remove the unused RAnal.fcnDelLocs()
Browse files Browse the repository at this point in the history
  • Loading branch information
radare authored and trufae committed Nov 15, 2023
1 parent 1fe0153 commit d573f98
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 27 deletions.
24 changes: 1 addition & 23 deletions libr/anal/fcn.c
Original file line number Diff line number Diff line change
Expand Up @@ -1082,7 +1082,7 @@ static int fcn_recurse(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut64 len, int
// if page have exec perms
ut64 da = (ut64)r_read_ble32 (dd, R_ARCH_CONFIG_IS_BIG_ENDIAN (anal->config));
if (da != UT32_MAX && da != UT64_MAX && anal->iob.is_valid_offset (anal->iob.io, da, 0)) {
/// R2_590 - this must be CODE | READ , not CODE|DATA, but raises 10 fails
/// TODO: this must be CODE | READ , not CODE|DATA, but raises 10 fails
// r_anal_xrefs_set (anal, op->addr, da, R_ANAL_REF_TYPE_CODE | R_ANAL_REF_TYPE_DATA);
r_anal_xrefs_set (anal, op->addr, da, R_ANAL_REF_TYPE_ICOD | R_ANAL_REF_TYPE_EXEC);
} else {
Expand Down Expand Up @@ -1706,28 +1706,6 @@ R_API int r_anal_function(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut64 len,
return ret;
}

#if 0
// XXX R2_590 - deprecate
R_API int r_anal_function_del_locs(RAnal *anal, ut64 addr) {
RListIter *iter, *iter2;
RAnalFunction *fcn, *f = r_anal_get_fcn_in (anal, addr, R_ANAL_FCN_TYPE_ROOT);
if (!f) {
return false;
}
r_list_foreach_safe (anal->fcns, iter, iter2, fcn) {
if (fcn->type != R_ANAL_FCN_TYPE_LOC) {
continue;
}
if (r_anal_function_contains (fcn, addr)) {
r_anal_function_delete (fcn);
break;
}
}
r_anal_function_del (anal, addr);
return true;
}
#endif

R_API int r_anal_function_del(RAnal *a, ut64 addr) {
RAnalFunction *fcn = r_anal_get_function_at (a, addr);
if (fcn) {
Expand Down
3 changes: 0 additions & 3 deletions libr/core/cmd_anal.inc.c
Original file line number Diff line number Diff line change
Expand Up @@ -4743,15 +4743,13 @@ static int cmd_af(RCore *core, const char *input) {
r_list_foreach_safe (core->anal->fcns, iter, iter2, f) {
ut64 addr = f->addr;
r_anal_del_jmprefs (core->anal, f);
// r_anal_function_del_locs (core->anal, f->addr);
// r_anal_function_del (core->anal, addr);
r_core_anal_undefine (core, addr);
}
} else {
ut64 addr = input[2]
? r_num_math (core->num, input + 2)
: core->offset;
// r_anal_function_del_locs (core->anal, addr);
// r_anal_function_del (core->anal, addr);
r_core_anal_undefine (core, addr);
}
Expand Down Expand Up @@ -5845,7 +5843,6 @@ R_API void r_core_anal_undefine(RCore *core, ut64 off) {
r_meta_del (core->anal, R_META_TYPE_ANY, r_anal_function_min_addr (f), r_anal_function_linear_size (f));
r_anal_function_del (core->anal, off);
}
//r_anal_function_del_locs (core->anal, off);
r_anal_delete_block_at (core->anal, off);
char *abcmd = r_str_newf ("ab-0x%"PFMT64x, off);
if (abcmd) {
Expand Down
1 change: 0 additions & 1 deletion libr/include/r_anal.h
Original file line number Diff line number Diff line change
Expand Up @@ -1026,7 +1026,6 @@ R_API RAnalFunction *r_anal_get_function_byname(RAnal *anal, const char *name);

R_API int r_anal_function(RAnal *anal, RAnalFunction *fcn, ut64 addr, ut64 len, int reftype);
R_API int r_anal_function_del(RAnal *anal, ut64 addr);
R_API int r_anal_function_del_locs(RAnal *anal, ut64 addr);
R_API bool r_anal_function_add_bb(RAnal *anal, RAnalFunction *fcn,
ut64 addr, ut64 size,
ut64 jump, ut64 fail, R_BORROW RAnalDiff *diff);
Expand Down

0 comments on commit d573f98

Please sign in to comment.