[PATCH 2/2] [pr gdb/19447] sim: mips: Add shadow mappings for 32-bit memory address space

Mike Frysinger vapier@gentoo.org
Wed May 12 18:21:57 GMT 2021


On 05 May 2021 04:51, Faraz Shahbazker wrote:
> --- a/sim/mips/interp.c
> +++ b/sim/mips/interp.c
> @@ -438,6 +438,9 @@ sim_open (SIM_OPEN_KIND kind, host_callback *cb,
>  	  /* memory alias K1BASE@1,K1SIZE%MEMSIZE,K0BASE */
>  	  sim_do_commandf (sd, "memory alias 0x%lx@1,0x%lx%%0x%lx,0x%0x",
>  			   K1BASE, K1SIZE, (long)mem_size, K0BASE);
> +	  if (WITH_TARGET_WORD_BITSIZE == 64)
> +	    sim_do_commandf (sd, "memory alias 0x%lx,0x%lx,0x%lx",
> +			     (K0BASE), (long)mem_size, EXTENDED(K0BASE));

instead of using %lx & casting to (long), use sim's PRIx* for the format.
	sim_do_commandf (sd, "memory alias 0x%x,0x%" PRIxTA ",0x%" PRIxTW,
		K0BASE, mem_size, EXTENDED(K0BASE));
-mike


More information about the Gdb-patches mailing list