Skip to content
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

Add alternative view for variables summary #9306

Conversation

giuscri
Copy link
Contributor

@giuscri giuscri commented Feb 3, 2018

See #9239 . Note that no colors are printed, unlike what's proposed in the issue.

[0x00000410]> e asm.varsum 
true
[0x00000410]> pdf
            ;-- section..text:
            ;-- eip:
╭ (fcn) entry0 49
│ bp: 0 (vars 0, args 0)
│ sp: 0 (vars 0, args 0)
│ rg: 0 (vars 0, args 0)
...
[0x00000410]> e asm.varsum=1
[0x00000410]> pdf
            ;-- section..text:
            ;-- eip:
╭ (fcn) entry0 49
│ bp: 0 (vars 0, args 0)
│ sp: 0 (vars 0, args 0)
│ rg: 0 (vars 0, args 0)
...
[0x00000410]> e asm.varsum=2
[0x00000410]> pdf
            ;-- section..text:
            ;-- eip:
╭ (fcn) entry0 49
│ vars: 0 0 0
│ args: 0 0 0
...
[0x00000410]> 

[0x565d254d]> e asm.varsum.altern=true
[0x565d254d]> pdf|head -n6
╭ (fcn) sym.fn 30
│ vars: 1 0 0
│ args: 1 0 0
│ 0x565d254d 55 push ebp
│ 0x565d254e 89e5 mov ebp, esp
│ 0x565d2550 83ec10 sub esp, 0x10
[0x565d254d]>
[0x565d254d]>
[0x565d254d]>
[0x565d254d]> e asm.varsum.altern=false
[0x565d254d]> pdf|head -n6
╭ (fcn) sym.fn 30
│ bp: 2 (vars 1, args 1)
│ sp: 0 (vars 0, args 0)
│ rg: 0 (vars 0, args 0)
│ 0x565d254d 55 push ebp
│ 0x565d254e 89e5 mov ebp, esp

@giuscri giuscri force-pushed the improve-the-list-of-local-variables-and-arguments branch from 4fdfe37 to 2d9a0c5 Compare February 3, 2018 23:40
@radare
Copy link
Collaborator

radare commented Feb 4, 2018

what about making varsum an int instead of bool and show different format depending on value?

also, there are conflicts in disasm.c can you rebase?

@giuscri giuscri force-pushed the improve-the-list-of-local-variables-and-arguments branch 3 times, most recently from b578adc to 67894bf Compare February 4, 2018 12:29
@giuscri
Copy link
Contributor Author

giuscri commented Feb 4, 2018

Rebased.

@radare, you mean something like asm.varsum=0 for no summary, asm.varsum=1 for current variables summary and asm.varsum=2 for the view proposed in #9239?

Doesn't that have the disadvantage of breaking current radare2rc's?

@giuscri giuscri force-pushed the improve-the-list-of-local-variables-and-arguments branch from 67894bf to 064c2f1 Compare February 5, 2018 10:44
This should _not_ break .radare2rc's that
use a boolean for `asm.varsum`.
@giuscri giuscri force-pushed the improve-the-list-of-local-variables-and-arguments branch from 064c2f1 to 31ddd36 Compare February 6, 2018 01:10
@giuscri
Copy link
Contributor Author

giuscri commented Feb 6, 2018

Added colored output.

Removed asm.varsum.altern, changed varsum into an integer (0, 1, 2).

Also this should not break .radare2rc's that use a boolean for asm.varsum, as asm.varsum=false|true will be interpreted respectively as 0 and 1.

@radare radare merged commit 8336816 into radareorg:master Feb 6, 2018
@radare
Copy link
Collaborator

radare commented Feb 6, 2018

Thanks!

@giuscri giuscri deleted the improve-the-list-of-local-variables-and-arguments branch February 7, 2018 14:19
SakiiR pushed a commit to SakiiR/radare2 that referenced this pull request Jul 1, 2019
This should _not_ break .radare2rc's that
use a boolean for `asm.varsum`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants