-
-
Notifications
You must be signed in to change notification settings - Fork 367
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
Refactoring rizin type system: introduce type scope. #4464
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You will need to extract CU/scope from PDB too
@@ -39,6 +39,11 @@ typedef struct rz_type_db_t { | |||
RzIOBind iob; // for RzIO in formats | |||
} RzTypeDB; | |||
|
|||
|
|||
typedef struct rz_type_scope_t { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add Doxygen
…pe_by_offset, base_types_by_name
rz_vector_foreach (&dw->info->units, unit) { | ||
debug_info->type_by_offset = ht_up_new(NULL, (HtUPFreeValue)rz_type_free); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's a bit awkward here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Kind of. But there is no need to have it until the rizin shuts down.
- it is not used anywhere except
dwarf_process.c
. - we have copy of all types in
typedb->types
.
so it just takes RAM for nothing.
The same for debug_info->base_type_by_offset
and debug_info->base_types_by_name
.
The way scope is defined right now is wrong. Firstly, it uses the Secondly, we want the |
Addresses #4421 .
RzTypeScope
.*_by_offset
hashtables indwarf_process.c
being attached to 1 compilation unit: allocate at the beginning, free before the end of processing current CU.Introduce
RzTypeScope
Should be a tree-like independent structure like this:
Change API implementation of "by name" type requests.
rz_type_db_get_base_type
rz_type_db_get_compound_type
rz_type_db_save_base_type
rz_type_db_update_base_type
rz_type_db_delete_base_type
rz_type_db_get_base_types_of_kind
rz_type_db_get_base_types
rz_type_db_edit_base_type
rz_type_db_base_type_unwrap_typedef
Refactor API usage of "by name" type requests.
typedb->types
usage:base.c
serialize_types.c
type.c
typeclass.c
c_cpp_parser.c
test_type.c
rz_type_db.*base_type
usage:dwarf_process.c
pdb_process.c
cpdb.c
ctypes.c
base.c
format.c
helpers.c
path.c
type.c
typeclass.c
test_dwarf_integration.c
test_pdb.c
test_project_migrate.c
test_analysis_function.c
test_serialize_types.c
test_type.c
Additional API
Your checklist for this pull request
Detailed description
...
Test plan
...
Closing issues
...