summaryrefslogtreecommitdiff
path: root/sim
diff options
context:
space:
mode:
authorHans-Peter Nilsson <hp@axis.com>2022-02-14 23:50:18 +0100
committerHans-Peter Nilsson <hp@bitrange.com>2022-02-14 23:50:18 +0100
commit9d67b0a0978e9651db74aa667be793420e7e4817 (patch)
treee9dd361ebcf7b6ed476bf7b4acaa0dd2aa90a335 /sim
parenta532eb7277ff64fb073e209d418b0a97f686c0e3 (diff)
sim cris: Correct PRIu32 to PRIx32
In 5ee0bc23a68f "sim: clean up bfd_vma printing" there was an additional introduction of PRIx32 and PRIu32 but just in sim/cris/sim-if.c. One type of bug was fixed in commit d16ce6e4d581 "sim: cris: fix memory setup typos" but one remained; the PRIu32 usage is wrong, as hex output is desired; note the 0x prefix. Without this fix, you'll see output like: memory map 0:0x4000..0x5fff (8192 bytes) overlaps 0:0x0..0x16383 (91012 bytes) program stopped with signal 6 (Aborted). for some C programs, like some of the ones in the sim/cris/c testsuite from where the example is taken (freopen2.c). The bug behavior was with memory allocation. With an attempt to allocate memory using the brk syscall such that the room up to the next 8192-byte "page boundary" wasn't sufficient, the simulator memory allocation machinery horked on a consistency error when trying to allocate a memory block to raise the "end of the data segment": there was already memory allocated at that address. Unfortunately, none of the programs in sim/cris/asm exposed this bug at the time, but an assembler test-case is committed after this fix. sim/cris: * sim-if.c (sim_open): Correct PRIu32 to PRIx32.
Diffstat (limited to 'sim')
-rw-r--r--sim/cris/sim-if.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c
index 602db9aebf..63deb467bc 100644
--- a/sim/cris/sim-if.c
+++ b/sim/cris/sim-if.c
@@ -887,7 +887,7 @@ sim_open (SIM_OPEN_KIND kind, host_callback *callback, struct bfd *abfd,
/* Allocate core managed memory if none specified by user. */
if (sim_core_read_buffer (sd, NULL, read_map, &c, startmem, 1) == 0)
- sim_do_commandf (sd, "memory region 0x%" PRIx32 ",0x%" PRIu32,
+ sim_do_commandf (sd, "memory region 0x%" PRIx32 ",0x%" PRIx32,
startmem, endmem - startmem);
/* Allocate simulator I/O managed memory if none specified by user. */