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

New annotations and API functions for the decompiler #17429

Merged
merged 8 commits into from Aug 10, 2020

Conversation

NirmalManoj
Copy link
Contributor

@NirmalManoj NirmalManoj commented Aug 9, 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
As part of the Improving Decompiler Widget project, many new types of annotations and new API functions have been implemented by the following PRs to the decompiler-refactoring branch. This PR is for merging these to the master.

  1. Annotation for function name #17204 - Annotation for function name
  2. Annotations for Constant Variables and Global Variables for the decompiler #17281 - Annotations for Constant Variables and Global Variables for the decompiler
  3. Annotation for local variables #17375 - Annotation for local variables
  4. API for checking if an annotation is a reference or function variable. #17386 - API for checking if an annotation is a reference or function variable
  5. Update docs in annotate code API  #17397 - Update docs in annotate code API
  6. Unit tests for annotated code API #17403 - Unit tests for annotated code API

...

Test plan

  1. Go through the linked PRs in order to get an idea of what has been done.
  2. Compile, and make sure it compiles properly.
  3. Run unit tests. New unit tests are testing all the new API functions and annotations already.
  4. Fetch decompiler-refactoring branch from the r2ghidra-dec and use the command pdgj for the JSON output. See if it's working as expected.

...

Closing issues

...

@NirmalManoj NirmalManoj requested review from karliss and ITAYC0HEN Aug 9, 2020
@NirmalManoj NirmalManoj self-assigned this Aug 9, 2020
@github-actions github-actions bot added API New API requests, changes, removal r2r Regression tests labels Aug 9, 2020
}

R_API bool r_annotation_is_reference(RCodeAnnotation *annotation) {
return (annotation->type == R_CODE_ANNOTATION_TYPE_GLOBAL_VARIABLE || annotation->type == R_CODE_ANNOTATION_TYPE_CONSTANT_VARIABLE || annotation->type == R_CODE_ANNOTATION_TYPE_FUNCTION_NAME);
Copy link
Contributor

@ITAYC0HEN ITAYC0HEN Aug 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you make this LOC shorter by splitting the conditions in new lines? Had to enable line-wrap here

Copy link
Contributor Author

@NirmalManoj NirmalManoj Aug 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@ITAYC0HEN Can you tell me how I can do that? When I tried it earlier, the coding style checker was telling me to not split it into multiple lines.

Copy link
Contributor

@ITAYC0HEN ITAYC0HEN Aug 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then I have no idea :)
That's only a small nice-to-have, if it causes a problem then no worries, you can skip this request

@NirmalManoj
Copy link
Contributor Author

NirmalManoj commented Aug 9, 2020

I think openbsd.yml build is failing due to an unrelated error. Is this the case?

@XVilka
Copy link
Contributor

XVilka commented Aug 10, 2020

@NirmalManoj yes, it's #17395. You can ignore this particular one.

XVilka
XVilka approved these changes Aug 10, 2020
@ITAYC0HEN
Copy link
Contributor

ITAYC0HEN commented Aug 10, 2020

Thank you Nirmal! Fantastic work <3

@ITAYC0HEN ITAYC0HEN merged commit b4677b4 into master Aug 10, 2020
15 of 16 checks passed
@NirmalManoj NirmalManoj moved this from In progress to Done in Improving Decompiler Widget (GSoC) Aug 10, 2020
ret2libc added a commit to ret2libc/radare2 that referenced this pull request Aug 31, 2020
ret2libc added a commit to ret2libc/radare2 that referenced this pull request Aug 31, 2020
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 ret2libc deleted the decompiler-refactoring branch Sep 2, 2020
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 r2r Regression tests
Projects
No open projects
Development

Successfully merging this pull request may close these issues.

None yet

4 participants