Update asm.cpu after asm.arch

This commit is contained in:
pancake 2016-11-16 01:25:26 +01:00
parent c7fa3429a1
commit 3e3f098413
2 changed files with 17 additions and 3 deletions

View File

@ -815,9 +815,8 @@ static int bin_dwarf(RCore *core, int mode) {
}
// TODO: implement internal : if ((mode & R_CORE_BIN_SET))
if ((mode & R_CORE_BIN_SET)) {
char *cmt = r_str_newf ("%s:%d %s", row->file, row->line, line?line:"");
r_meta_set_string (core->anal, R_META_TYPE_COMMENT,
row->address, cmt);
char *cmt = r_str_newf ("%s:%d %s", row->file, (int)row->line, line? line: "");
r_meta_set_string (core->anal, R_META_TYPE_COMMENT, row->address, cmt);
free (cmt);
} else {
r_cons_printf ("\"CC %s:%d %s\"@0x%"PFMT64x"\n",

View File

@ -267,6 +267,21 @@ static int cb_asmarch(void *user, void *data) {
eprintf ("asm.arch: cannot find (%s)\n", node->value);
return false;
}
if (core->assembler->cur) {
const char *newAsmCPU = core->assembler->cur->cpus;
if (newAsmCPU) {
if (*newAsmCPU) {
char *nac = strdup (newAsmCPU);
char *comma = strchr (nac, ',');
if (comma) {
*comma = 0;
r_config_set (core->config, "asm.cpu", nac);
}
} else {
r_config_set (core->config, "asm.cpu", "");
}
}
}
if (core->assembler && core->assembler->cur) {
bits = core->assembler->cur->bits;
if (8 & bits) {