diff --git a/c_emulator/riscv_sim.c b/c_emulator/riscv_sim.c index dc354f80b..f4652702b 100644 --- a/c_emulator/riscv_sim.c +++ b/c_emulator/riscv_sim.c @@ -273,7 +273,6 @@ char *process_args(int argc, char **argv) fprintf(stderr, "unable to build fast-yaml document from %s\n", optarg); exit(1); } - rv_cfg_dump_yaml_c(optarg); break; case 'u': @@ -281,7 +280,6 @@ char *process_args(int argc, char **argv) fprintf(stderr, "unable to build fast-yaml document from %s\n", optarg); exit(1); } - rv_cfg_dump_yaml_c(optarg); break; case 'a': report_arch(); diff --git a/c_emulator/rv_cfg_func.c b/c_emulator/rv_cfg_func.c index ac0461a3e..dfadd6731 100644 --- a/c_emulator/rv_cfg_func.c +++ b/c_emulator/rv_cfg_func.c @@ -180,12 +180,12 @@ rv_cfg_string_c(char * key_str) continue; } - printf("%s, %d: checking yaml file, %s\n", __FILE__, __LINE__, rv_cfg_enum2doc_a[i].filename); + //printf("%s, %d: checking yaml file, %s\n", __FILE__, __LINE__, rv_cfg_enum2doc_a[i].filename); conversion_str = " %1023s"; tmp_str = malloc(strlen(key_str) + strlen(conversion_str) + 1); strcpy(tmp_str, key_str); strcat(tmp_str, conversion_str); - printf("%s, %d: scanf string: '%s'\n", __FILE__, __LINE__, tmp_str); + //printf("%s, %d: scanf string: '%s'\n", __FILE__, __LINE__, tmp_str); count = fy_document_scanf(fyd, tmp_str, yaml_val_string); if (count == 1) @@ -195,7 +195,7 @@ rv_cfg_string_c(char * key_str) ret_str_ptr = malloc(strlen(yaml_val_string)); // TODO: where should this be freed? strcpy(ret_str_ptr, yaml_val_string); //fy_emit_document_to_fp(fyd, FYECF_DEFAULT | FYECF_SORT_KEYS, stdout); - return(yaml_val_string); + return(ret_str_ptr); } free(tmp_str); } @@ -235,7 +235,7 @@ int rv_cfg_string(sail_string **s, char * yaml_key_str) { printf("%s, %d: entering rv_cfg_string()\n", __FILE__, __LINE__); - *s = rv_cfg_string_c(yaml_key_str); + s = rv_cfg_string_c(yaml_key_str); return(1); }