-
-
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
Refactor dm
#1182
Refactor dm
#1182
Conversation
I suggest to port that JSON PR on top of this one once it's finished. |
@XVilka I found |
@PulakIIIT for
Moreover, I checked the code of
Thus, I suggest to do the following:
|
@XVilka I have moved the function |
Please add, you will need it for Cutter anyway. |
e2fc3cf
to
0feca77
Compare
Please also rebase on top of the latest dev to resolve the conflicts. |
3d7e227
to
1ef881e
Compare
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.
Overall looks good, there are some minor changes required though before being ready to merge.
/* TODO: do not spawn. use RzBin API */ | ||
if (sectname) { | ||
char *sect = rz_str_escape(sectname); | ||
res = rz_sys_cmd_strf("env RZ_BIN_PREFIX=\"%s\" rz-bin %s-B 0x%08" PFMT64x " -S \"%s\" | grep \"%s\"", name, mode, baddr, filesc, sect); |
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.
@thestr4ng3r could you please suggest a proper API as a substitute for this command?
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.
this is not ok.
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.
but we can change this in another PR
fa1af3d
to
d199448
Compare
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.
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.
Is this still "WIP"? Looks ready to me.
@@ -1443,376 +1357,462 @@ static bool get_bin_info(RzCore *core, const char *file, ut64 baseaddr, PJ *pj, | |||
return true; | |||
} | |||
|
|||
static int cmd_debug_map(RzCore *core, const char *input) { | |||
// dm |
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.
I'm tempted to remove these comments... They will likely become wrong at some point. I'd prefer to focus on #691 to correctly find the right handler.
rz_debug_map_sync(core->dbg); // update process memory maps | ||
RzList *list = rz_debug_modules_list(core->dbg); | ||
rz_list_foreach (list, iter, map) { | ||
if ((!libname || |
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.
very very long if
. Not sure if it comes from old code, but a separate function with a meaningful name or something else would be better
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.
Yeah this if
comes from the old code indeed
Overall looks good anyway! Great work ;) |
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 looks good to me, but since you are touching a lot of debug code (which is not tested too much) please do a round of manual testing with a debugging session. I did it already a couple of versions ago, but better be sure ;)
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.
I am a bit late for this review so I'll just leave the comment regarding the API for a future PR. LGTM other than that.
RZ_API RzList *rz_heap_heap_chunks_list_32(RzCore *core, MallocState *main_arena, ut32 m_arena, ut32 m_state); | ||
RZ_API bool rz_heap_resolve_main_arena_32(RzCore *core, ut32 *m_arena); | ||
RZ_API bool rz_heap_update_main_arena_32(RzCore *core, ut32 m_arena, MallocState *main_arena); | ||
RZ_API RzList *rz_heap_tcache_list_32(RzCore *core, ut32 m_arena, MallocState *main_arena, bool main_thread_only); |
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.
Since we are planning to use the API here for Cutter's HeapWidget frontend the _32/_64 variations in the API should be made internal and replaced with wrapper functions that will use a bool/bitness var to differentiate architectures.
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.
@PulakIIIT I think this can be done in a separate PR. Let's merge this one.
Your checklist for this pull request
Detailed description
Plan:
Currently:
Test plan
CI is green
...
Closing issues
...