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

Annotation for local variables #17375

Merged

Conversation

NirmalManoj
Copy link
Contributor

@NirmalManoj NirmalManoj commented Jul 30, 2020

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 added tests that prove my fix is effective or that my feature works (if possible)
  • I've updated the documentation and the radare2 book with the relevant information (if needed)

Detailed description
This PR adds annotation for local variables and function parameters. The data we have for each variable is the location of the variable in the code and the name of the variable. This will suffice for implementing retype local variables action in the decompiler widget in Cutter.

...

Test plan

  1. Compile this PR.
  2. Fetch PR #128 from r2ghidra-dec and compile it.
  3. Follow the test plan in the PR linked in step 2.
  4. Check code.

...

Closing issues

...

@NirmalManoj NirmalManoj marked this pull request as ready for review July 30, 2020 05:15
@NirmalManoj NirmalManoj self-assigned this Jul 30, 2020
@github-actions github-actions bot added the API New API requests, changes, removal label Jul 30, 2020
@XVilka
Copy link
Contributor

XVilka commented Jul 30, 2020

Please add a test.

@NirmalManoj
Copy link
Contributor Author

NirmalManoj commented Jul 30, 2020

@XVilka This is a PR to the decompiler-refactoring branch. We have to add tests for all the new types of annotations

R_CODE_ANNOTATION_TYPE_FUNCTION_NAME,
R_CODE_ANNOTATION_TYPE_GLOBAL_VARIABLE,
R_CODE_ANNOTATION_TYPE_CONSTANT_VARIABLE,
R_CODE_ANNOTATION_TYPE_LOCAL_VARIABLE,
R_CODE_ANNOTATION_TYPE_FUNCTION_PARAMETER,

I will do it in a PR later which will implement unit tests for all of these. I want to get this merged as soon as possible so that the CI will work in r2ghidra-dec PRs and in Cutter PRs.

@NirmalManoj NirmalManoj merged commit cee691d into radareorg:decompiler-refactoring Jul 31, 2020
NirmalManoj added a commit to NirmalManoj/radare2 that referenced this pull request Aug 6, 2020
* function variable annotation added (includes local variable and function parameter)
NirmalManoj added a commit that referenced this pull request Aug 9, 2020
* function variable annotation added (includes local variable and function parameter)
ITAYC0HEN pushed a commit that referenced this pull request Aug 10, 2020
…edCode (#17429)

* Annotation for function name (#17204)
* Annotations for Constant Variables and Global Variables for the decompiler (#17281)
* Annotation For Function Variables (#17375)
* function variable annotation added (includes local variable and function parameter)
* API for checking if an annotation is a reference or function variable. (#17386)
* Update docs in annotate code API  (#17397)
* Unit tests for annotated code API (#17403)
ret2libc pushed a commit to ret2libc/radare2 that referenced this pull request Sep 1, 2020
…edCode (radareorg#17429)

* Annotation for function name (radareorg#17204)
* Annotations for Constant Variables and Global Variables for the decompiler (radareorg#17281)
* Annotation For Function Variables (radareorg#17375)
* function variable annotation added (includes local variable and function parameter)
* API for checking if an annotation is a reference or function variable. (radareorg#17386)
* Update docs in annotate code API  (radareorg#17397)
* Unit tests for annotated code API (radareorg#17403)
ret2libc pushed a commit that referenced this pull request Sep 2, 2020
…edCode (#17429)

* Annotation for function name (#17204)
* Annotations for Constant Variables and Global Variables for the decompiler (#17281)
* Annotation For Function Variables (#17375)
* function variable annotation added (includes local variable and function parameter)
* API for checking if an annotation is a reference or function variable. (#17386)
* Update docs in annotate code API  (#17397)
* Unit tests for annotated code API (#17403)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API New API requests, changes, removal test-required
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants