diff options
Diffstat (limited to 'monitor.c')
-rw-r--r-- | monitor.c | 38 |
1 files changed, 0 insertions, 38 deletions
@@ -1370,44 +1370,6 @@ static void do_print(Monitor *mon, const QDict *qdict) monitor_printf(mon, "\n"); } -static int do_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data) -{ - FILE *f; - uint32_t size = qdict_get_int(qdict, "size"); - const char *filename = qdict_get_str(qdict, "filename"); - target_long addr = qdict_get_int(qdict, "val"); - uint32_t l; - CPUState *env; - uint8_t buf[1024]; - int ret = -1; - - env = mon_get_cpu(); - - f = fopen(filename, "wb"); - if (!f) { - qerror_report(QERR_OPEN_FILE_FAILED, filename); - return -1; - } - while (size != 0) { - l = sizeof(buf); - if (l > size) - l = size; - cpu_memory_rw_debug(env, addr, buf, l, 0); - if (fwrite(buf, 1, l, f) != l) { - monitor_printf(mon, "fwrite() error in do_memory_save\n"); - goto exit; - } - addr += l; - size -= l; - } - - ret = 0; - -exit: - fclose(f); - return ret; -} - static int do_physical_memory_save(Monitor *mon, const QDict *qdict, QObject **ret_data) { |