Optimize RFlag.get_at, enhancing fd and honor flagspaces
This commit is contained in:
parent
c3bb9e5edf
commit
0446e283ad
1 changed files with 18 additions and 0 deletions
|
|
@ -374,12 +374,30 @@ R_API RFlagItem *r_flag_get_i2(RFlag *f, ut64 off) {
|
|||
R_API RFlagItem *r_flag_get_at(RFlag *f, ut64 off, bool closest) {
|
||||
RFlagItem *item, *nice = NULL;
|
||||
RListIter *iter;
|
||||
const RList* flags = r_flag_get_list (f, off);
|
||||
if (flags) {
|
||||
r_list_foreach (flags, iter, item) {
|
||||
if (f->space_idx != -1 && item->space != f->space_idx) {
|
||||
continue;
|
||||
}
|
||||
if (nice) {
|
||||
char *n = nice->name;
|
||||
if (!strncmp (n, "sym.func.", 9) || !strncmp (n, "func.", 5) || !strncmp (n, "fcn.0", 5)) {
|
||||
nice = item;
|
||||
}
|
||||
} else {
|
||||
nice = item;
|
||||
}
|
||||
}
|
||||
return nice;
|
||||
}
|
||||
|
||||
r_list_foreach (f->flags, iter, item) {
|
||||
if (f->space_strict && IS_IN_SPACE (f, item)) {
|
||||
continue;
|
||||
}
|
||||
if (item->offset == off) {
|
||||
eprintf ("XXX Should never happend\n");
|
||||
return evalFlag (f, item);
|
||||
}
|
||||
if (closest && off > item->offset) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue