New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix #6576 aai percentage issue #7002
Conversation
libr/core/cmd_anal.c
Outdated
@@ -4945,8 +4945,12 @@ static int compute_coverage(RCore *core) { | |||
RListIter *iter; | |||
RAnalFunction *fcn; | |||
int cov = 0; | |||
ut64 section_begin = r_num_get (core->num, "$S"); | |||
ut64 section_end = r_num_get (core->num, "$SS") + section_begin; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will make that aai only show percentage in the current section.
mac:r2 alvaro_fe$ r2 /bin/ls
-- Change the size of the file with the 'r' (resize) command
[0x100001174]> aa
[x] Analyze all flags starting with sym. and entry0 (aa)
[0x100001174]> aai
fcns 39
xrefs 684
calls 0
strings 86
symbols 114
imports 76
covrage 12109
codesz 13721
percent 88%
[0x100001174]> S~DATA
[06] . 0x00005000 mrw- va=0x100005000 sz=0x0028 vsz=0x0028 6.__DATA.__got
[07] . 0x00005028 mrw- va=0x100005028 sz=0x0010 vsz=0x0010 7.__DATA.__nl_symbol_ptr
[08] . 0x00005038 mrw- va=0x100005038 sz=0x0260 vsz=0x0260 8.__DATA.__la_symbol_ptr
[09] . 0x000052a0 mrw- va=0x1000052a0 sz=0x0228 vsz=0x0228 9.__DATA.__const
[10] . 0x000054d0 mrw- va=0x1000054d0 sz=0x0028 vsz=0x0028 10.__DATA.__data
[11] . 0x00000000 mrw- va=0x100005500 sz=0x00c0 vsz=0x00c0 11.__DATA.__bss
[12] . 0x00000000 mrw- va=0x1000055c0 sz=0x008c vsz=0x008c 12.__DATA.__common
[0x100001174]> s 0x100005500
[0x100005500]> aai
fcns 39
xrefs 684
calls 0
strings 86
symbols 114
imports 76
covrage 0
codesz 192
percent 0%
[0x100005500]> S
[00] . 0x00000e94 mr-x va=0x100000e94 sz=0x3599 vsz=0x3599 0.__TEXT.__text
[01] . 0x0000442e mr-x va=0x10000442e sz=0x01c8 vsz=0x01c8 1.__TEXT.__stubs
[02] . 0x000045f8 mr-x va=0x1000045f8 sz=0x0308 vsz=0x0308 2.__TEXT.__stub_helper
[03] . 0x00004900 mr-x va=0x100004900 sz=0x01f0 vsz=0x01f0 3.__TEXT.__const
[04] . 0x00004af0 mr-x va=0x100004af0 sz=0x0479 vsz=0x0479 4.__TEXT.__cstring
[05] . 0x00004f6c mr-x va=0x100004f6c sz=0x0094 vsz=0x0094 5.__TEXT.__unwind_info
[06] . 0x00005000 mrw- va=0x100005000 sz=0x0028 vsz=0x0028 6.__DATA.__got
[07] . 0x00005028 mrw- va=0x100005028 sz=0x0010 vsz=0x0010 7.__DATA.__nl_symbol_ptr
[08] . 0x00005038 mrw- va=0x100005038 sz=0x0260 vsz=0x0260 8.__DATA.__la_symbol_ptr
[09] . 0x000052a0 mrw- va=0x1000052a0 sz=0x0228 vsz=0x0228 9.__DATA.__const
[10] . 0x000054d0 mrw- va=0x1000054d0 sz=0x0028 vsz=0x0028 10.__DATA.__data
[11] * 0x00000000 mrw- va=0x100005500 sz=0x00c0 vsz=0x00c0 11.__DATA.__bss
[12] * 0x00000000 mrw- va=0x1000055c0 sz=0x008c vsz=0x008c 12.__DATA.__common
[0x100005500]> s 0x10000442e
[0x10000442e]> aai
fcns 39
xrefs 684
calls 0
strings 86
symbols 114
imports 76
covrage 972
codesz 456
percent 213%
I think this should be independently in which section you are and still show wrong output like 213%
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should consider all the sections with x
to calculate the coverage.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok this make sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yep
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for the debugger, this must use the debugmaps instead of sections
Need @radare here^ |
libr/core/cmd_anal.c
Outdated
@@ -4945,8 +4945,12 @@ static int compute_coverage(RCore *core) { | |||
RListIter *iter; | |||
RAnalFunction *fcn; | |||
int cov = 0; | |||
ut64 section_begin = r_num_get (core->num, "$S"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i would prefer not to depend on current section and therefor not use $S or $SS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok so as suggested by @alvarofe we should then consider only the sections with x
bit to calculate the coverage.
No description provided.