Skip to content

Annotation for local variables - #17375

Merged
NirmalManoj merged 2 commits into
radareorg:decompiler-refactoringfrom
NirmalManoj:local-variables
Jul 31, 2020
Merged

Annotation for local variables#17375
NirmalManoj merged 2 commits into
radareorg:decompiler-refactoringfrom
NirmalManoj:local-variables

Conversation

@NirmalManoj

@NirmalManoj NirmalManoj commented Jul 30, 2020

Copy link
Copy Markdown
Contributor

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 requested review from ITAYC0HEN and karliss 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

XVilka commented Jul 30, 2020

Copy link
Copy Markdown
Contributor

Please add a test.

@NirmalManoj

NirmalManoj commented Jul 30, 2020

Copy link
Copy Markdown
Contributor Author

@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