diff --git a/libr/anal/var.c b/libr/anal/var.c index e272a11d95..06458cff99 100644 --- a/libr/anal/var.c +++ b/libr/anal/var.c @@ -674,7 +674,7 @@ R_API void extract_rarg(RAnal *anal, RAnalOp *op, RAnalFunction *fcn, int *reg_s r_return_if_fail (anal && op && fcn); if (!fcn->cc) { - R_LOG_INFO ("No cc information for function at %" PFMT64x " to extract register arguments\n", fcn->addr); + R_LOG_DEBUG ("No calling convention for function '%s' to extract register arguments\n", fcn->name); return; } diff --git a/libr/core/anal_tp.c b/libr/core/anal_tp.c index ae6a97ec4c..96781eebaf 100644 --- a/libr/core/anal_tp.c +++ b/libr/core/anal_tp.c @@ -669,7 +669,6 @@ R_API void r_core_anal_type_match(RCore *core, RAnalFunction *fcn) { } } - const char *place = r_anal_cc_arg (anal, fcn->cc, 1); // Type propgation for register based args RList *list = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_REG); RAnalVar *rvar, *bp_var; @@ -707,21 +706,26 @@ R_API void r_core_anal_type_match(RCore *core, RAnalFunction *fcn) { free (type); r_anal_var_free (lvar); } + r_list_free (list); // Type propgation from caller to callee function for stack based arguments - if (place && !strncmp (place, "stack", 5)) { - RList *list2 = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_BPV); - r_list_foreach (list2, iter2, bp_var) { - if (bp_var->isarg) { - const char *query = sdb_fmt ("fcn.0x%08"PFMT64x".arg.%d", fcn->addr, (bp_var->delta - 8)); - char *type = (char *) sdb_const_get (anal->sdb_fcns, query, NULL); - if (type) { - var_retype (anal, bp_var, NULL, type, fcn->addr, false, false); + if (fcn->cc) { + const char *place = r_anal_cc_arg (anal, fcn->cc, 1); + if (place && !strncmp (place, "stack", 5)) { + RList *list2 = r_anal_var_list (anal, fcn, R_ANAL_VAR_KIND_BPV); + r_list_foreach (list2, iter2, bp_var) { + if (bp_var->isarg) { + const char *query = sdb_fmt ("fcn.0x%08" PFMT64x ".arg.%d", fcn->addr, (bp_var->delta - 8)); + char *type = (char *)sdb_const_get (anal->sdb_fcns, query, NULL); + if (type) { + var_retype (anal, bp_var, NULL, type, fcn->addr, false, false); + } } } + r_list_free (list2); } - r_list_free (list2); + } else { + R_LOG_DEBUG ("No calling convention set for function '%s'\n", fcn->name); } - r_list_free (list); out_function: free (buf); r_cons_break_pop(); diff --git a/libr/core/cconfig.c b/libr/core/cconfig.c index b5d15ec70e..92c82c79b8 100644 --- a/libr/core/cconfig.c +++ b/libr/core/cconfig.c @@ -2721,7 +2721,7 @@ R_API int r_core_config_init(RCore *core) { // R2_LOGLEVEL / cfg.log.level p = r_sys_getenv ("R2_LOGLEVEL"); SETICB ("cfg.log.level", p ? atoi(p) : R_DEFAULT_LOGLVL, cb_log_config_level, "Target log level/severity"\ - " (0:SILLY, 1:VERBOSE, 2:DEBUG, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)" + " (0:SILLY, 1:DEBUG, 2:VERBOSE, 3:INFO, 4:WARN, 5:ERROR, 6:FATAL)" ); free (p); // R2_LOGTRAP_LEVEL / cfg.log.traplevel