/* Simulator memory option handling.
- Copyright (C) 1996-2022 Free Software Foundation, Inc.
+ Copyright (C) 1996-2023 Free Software Foundation, Inc.
Contributed by Cygnus Support.
This file is part of GDB, the GNU debugger.
#endif
#include <stdlib.h>
#include <string.h>
-#ifdef HAVE_UNISTD_H
#include <unistd.h>
-#endif
#ifdef HAVE_SYS_MMAN_H
#include <sys/mman.h>
#endif
#include "sim-options.h"
/* Memory fill byte. */
-static unsigned8 fill_byte_value;
+static uint8_t fill_byte_value;
static int fill_byte_flag = 0;
/* Memory mapping; see OPTION_MEMORY_MAPFILE. */
{
/* Allocate new well-aligned buffer, just as sim_core_attach(). */
void *aligned_buffer;
- int padding = (addr % sizeof (unsigned64));
+ int padding = (addr % sizeof (uint64_t));
unsigned long bytes;
#ifdef HAVE_MMAP
case OPTION_MEMORY_CLEAR:
{
- fill_byte_value = (unsigned8) 0;
+ fill_byte_value = (uint8_t) 0;
fill_byte_flag = 1;
return SIM_RC_OK;
break;
sim_io_eprintf (sd, "Missing fill value between 0 and 255\n");
return SIM_RC_FAIL;
}
- fill_byte_value = (unsigned8) fill_value;
+ fill_byte_value = (uint8_t) fill_value;
fill_byte_flag = 1;
return SIM_RC_OK;
break;
}
}
+void sim_dump_memory (SIM_DESC sd);
+
+/* Convenience function for use when debugging the simulator, to be
+ called from within e.g. gdb. */
+
+void
+sim_dump_memory (SIM_DESC sd)
+{
+ memory_option_handler (sd, NULL, OPTION_MEMORY_INFO, NULL, 0);
+ memory_option_handler (sd, NULL, OPTION_MAP_INFO, NULL, 0);
+}
static SIM_RC
sim_memory_init (SIM_DESC sd)