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

Extracting types handling into RzType (librz/type) #896

Merged
merged 25 commits into from
Apr 6, 2021

Conversation

XVilka
Copy link
Member

@XVilka XVilka commented Mar 24, 2021

SQUASH ME

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 rizin book with the relevant information (if needed)

Detailed description

Extracting RzType as a separate module in librz/type from various places like RzAnalysis and RzUtil.

The only dependency is RzUtil. (It also has RzIOBind for printing formats)

I also moved type-related stuff from librz/util/format.c into librz/type/format.c but without proper refactoring (the old code is complete mess and will require a separate enormous effort to clean up, ignore that part)

Apart from few places in librz/core/ctypes.c the direct access to the SDB with types information is removed.

Test plan

All is green

Closing issues

Closes #369

@XVilka XVilka marked this pull request as draft March 24, 2021 06:49
@@ -1718,34 +1720,6 @@ RZ_API void rz_core_autocomplete(RZ_NULLABLE RzCore *core, RzLineCompletion *com
}
}
rz_list_free(vars);
} else if (!strncmp(buf->data, "t ", 2) || !strncmp(buf->data, "t- ", 3)) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I removed that type and pf autocompletion code since we are switching to the newshell anyway.

librz/include/rz_type.h Outdated Show resolved Hide resolved
librz/include/rz_parse.h Show resolved Hide resolved
@XVilka XVilka force-pushed the rztypes branch 13 times, most recently from 44c9bdf to 6aeb397 Compare March 30, 2021 07:35
@XVilka XVilka added this to the 0.3.0 milestone Mar 30, 2021
@XVilka XVilka force-pushed the rztypes branch 3 times, most recently from bd687bb to e05ec1b Compare March 31, 2021 10:15
@XVilka XVilka force-pushed the rztypes branch 7 times, most recently from e298517 to 45c1772 Compare April 6, 2021 08:32
@github-actions github-actions bot added the RzCore label Apr 6, 2021
@XVilka

This comment has been minimized.

test/unit/meson.build Outdated Show resolved Hide resolved
test/unit/meson.build Outdated Show resolved Hide resolved
test/unit/test_serialize_analysis.c Show resolved Hide resolved
@thestr4ng3r
Copy link
Member

Dead declarations in rz_analysis.h:

/* type.c */
RZ_API void rz_analysis_remove_parsed_type(RzAnalysis *analysis, const char *name);
RZ_API void rz_analysis_save_parsed_type(RzAnalysis *analysis, const char *parsed);

@XVilka XVilka merged commit 788fdb3 into rizinorg:dev Apr 6, 2021
@XVilka XVilka deleted the rztypes branch April 6, 2021 10:04
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.

Bundle all types functionality in a new module RzTypes
4 participants