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

Demangle flags symbols #3915

Merged
merged 4 commits into from
Oct 20, 2023
Merged

Demangle flags symbols #3915

merged 4 commits into from
Oct 20, 2023

Conversation

ret2libc
Copy link
Member

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • I've added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the rizin book with the relevant information (if needed)

Detailed description

I'd like to have asm.flags.real=true by default, however one of the problems with having that enabled is that the users cannot easily know what is the flag name they should use to reference the symbol.

For example:

call  std::vector<int, std::allocator<int> >::vector()

It is not immediately clear that the flag name (which should be used in commands like s) is method.std::vector_int__std::allocator_int___.vector.

The idea is that we want the flag name to be displayed as comment (but only when the real names are displayed!):

-> asm.flags.real=true

call  std::vector<int, std::allocator<int> >::vector() ; method.std::vector_int__std::allocator_int___.vector
-> asm.flags.real=false
call  method.std::vector_int__std::allocator_int___.vector

These comments are not displayed in visual mode because the user can easily use the "jumpkeys"(the numbers near the calls e.g. [1]) to move between functions.

Test plan

See attached test.
Moreover, ensure that in visual mode the comments are not displayed.

Closing issues

...

@XVilka
Copy link
Member

XVilka commented Oct 13, 2023

See also these related bugs: #3656 and #3543

Just fix the test, because the pseudo code seems wrong as well as the
disassembly. `sym.printf` should already be present in the instruction,
thus the flag is redudant.
@ret2libc ret2libc force-pushed the demangle-flags-symbols branch from d1c5501 to 98f9449 Compare October 19, 2023 13:15
@ret2libc
Copy link
Member Author

@XVilka about the test, please see 98f9449 . Also, i shared some concern in mattermost, but i don't know anything about RISCV.

@ret2libc ret2libc merged commit 913a0a4 into dev Oct 20, 2023
43 of 44 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants