[PATCH 01/12] sim cris: Correct PRIu32 to PRIx32

Mike Frysinger vapier@gentoo.org
Wed Feb 16 04:43:15 GMT 2022


On 14 Feb 2022 23:59, Hans-Peter Nilsson via Gdb-patches wrote:
> 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.

thanks, this had been plaguing me for a while.  i eventually managed to
get a cris-elf toolchain working to test against, but it was long after
the bug, so i wasn't able to trace back where it was coming from.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://sourceware.org/pipermail/gdb-patches/attachments/20220215/ab0ede22/attachment.sig>


More information about the Gdb-patches mailing list