mirror of
https://github.com/radareorg/radare2.git
synced 2025-02-02 19:55:14 +00:00
Add asm.slow
eval config var to speedup disasm
- Useful for slow io backends
This commit is contained in:
parent
53189dd87a
commit
1efa0f2f7e
@ -2569,6 +2569,7 @@ static int cmd_debug(void *data, const char *input) {
|
||||
break;
|
||||
case 's':
|
||||
// r_debug_desc_seek()
|
||||
// TODO: handle read, readwrite, append
|
||||
break;
|
||||
case 'd':
|
||||
// r_debug_desc_dup()
|
||||
|
@ -1093,6 +1093,7 @@ R_API int r_core_config_init(RCore *core) {
|
||||
SETI("asm.cmtcol", 70, "Align comments at column 60");
|
||||
SETPREF("asm.calls", "true", "Show calling convention calls as comments in disasm");
|
||||
SETPREF("asm.comments", "true", "Show comments in disassembly view");
|
||||
SETPREF("asm.slow", "true", "Perform slow analysis operations in disasm");
|
||||
SETPREF("asm.decode", "false", "Use code analysis as a disassembler");
|
||||
SETPREF("asm.indent", "false", "Indent disassembly based on reflines depth");
|
||||
SETI("asm.indentspace", 2, "How many spaces to indent the code");
|
||||
|
@ -70,6 +70,7 @@ typedef struct r_disam_options_t {
|
||||
int show_bytes;
|
||||
int show_reloff;
|
||||
int show_comments;
|
||||
int show_slow;
|
||||
int cmtcol;
|
||||
int show_fcnlines;
|
||||
int show_calls;
|
||||
@ -308,6 +309,7 @@ static RDisasmState * handle_init_ds (RCore * core) {
|
||||
ds->show_reloff = r_config_get_i (core->config, "asm.reloff");
|
||||
ds->show_fcnlines = r_config_get_i (core->config, "asm.fcnlines");
|
||||
ds->show_comments = r_config_get_i (core->config, "asm.comments");
|
||||
ds->show_slow = r_config_get_i (core->config, "asm.slow");
|
||||
ds->show_calls = r_config_get_i (core->config, "asm.calls");
|
||||
ds->cmtcol = r_config_get_i (core->config, "asm.cmtcol");
|
||||
ds->show_cmtflgrefs = r_config_get_i (core->config, "asm.cmtflgrefs");
|
||||
@ -1914,6 +1916,9 @@ static void handle_print_ptr (RCore *core, RDisasmState *ds, int len, int idx) {
|
||||
#define DOALIGN() if (!aligned) { handle_comment_align (core, ds); aligned = 1; }
|
||||
if (!ds->show_comments)
|
||||
return;
|
||||
if (!ds->show_slow) {
|
||||
return;
|
||||
}
|
||||
if (p == UT64_MAX) {
|
||||
/* do nothing */
|
||||
} else if (((st64)p)>0) {
|
||||
|
@ -263,8 +263,6 @@ static int fork_and_ptraceme(RIO *io, int bits, const char *cmd) {
|
||||
// r_str_argv_free (argv);
|
||||
exit (1);
|
||||
} else {
|
||||
// TODO: Add support to redirect filedescriptors
|
||||
// TODO: Configure process environment
|
||||
char *_cmd = strdup (cmd);
|
||||
argv = r_str_argv (_cmd, NULL);
|
||||
if (!argv) {
|
||||
@ -352,7 +350,7 @@ static int fork_and_ptraceme(RIO *io, int bits, const char *cmd) {
|
||||
return -1;
|
||||
if (ret != pid)
|
||||
eprintf ("Wait event received by different pid %d\n", ret);
|
||||
} while (ret!=pid);
|
||||
} while (ret != pid);
|
||||
if (WIFSTOPPED (status))
|
||||
eprintf ("Process with PID %d started...\n", (int)pid);
|
||||
if (WEXITSTATUS (status) == MAGIC_EXIT)
|
||||
|
Loading…
x
Reference in New Issue
Block a user