From 29136be7df3418fc09555eeac5dde6b43106e9be Mon Sep 17 00:00:00 2001 From: Alan Modra Date: Thu, 4 Aug 2022 12:48:05 +0930 Subject: Don't use BFD_VMA_FMT in gdb and sim Like commit b82817674f, this replaces BFD_VMA_FMT "x" in sim/ with PRIx64 and casts to promote bfd_vma to uint64_t. The one file using BFD_VMA_FMT in gdb/ instead now uses hex_string, and a typo in the warning message is fixed. --- sim/cris/sim-if.c | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) (limited to 'sim/cris') diff --git a/sim/cris/sim-if.c b/sim/cris/sim-if.c index d7c1005..75176d0 100644 --- a/sim/cris/sim-if.c +++ b/sim/cris/sim-if.c @@ -257,17 +257,18 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) if (verbose) sim_io_printf (sd, - "Loading segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - lma, phdr[i].p_filesz); + "Loading segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + (uint64_t) lma, (uint64_t) phdr[i].p_filesz); if (bfd_seek (abfd, phdr[i].p_offset, SEEK_SET) != 0 || (bfd_bread (buf, phdr[i].p_filesz, abfd) != phdr[i].p_filesz)) { sim_io_eprintf (sd, - "%s: could not read segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + "%s: could not read segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + STATE_MY_NAME (sd), (uint64_t) lma, + (uint64_t) phdr[i].p_filesz); free (buf); return FALSE; } @@ -275,9 +276,10 @@ cris_load_elf_file (SIM_DESC sd, struct bfd *abfd, sim_write_fn do_write) if (do_write (sd, lma, buf, phdr[i].p_filesz) != phdr[i].p_filesz) { sim_io_eprintf (sd, - "%s: could not load segment at 0x%" BFD_VMA_FMT "x, " - "size 0x%" BFD_VMA_FMT "x\n", - STATE_MY_NAME (sd), lma, phdr[i].p_filesz); + "%s: could not load segment at 0x%" PRIx64 ", " + "size 0x%" PRIx64 "\n", + STATE_MY_NAME (sd), (uint64_t) lma, + (uint64_t) phdr[i].p_filesz); free (buf); return FALSE; } @@ -573,9 +575,8 @@ cris_handle_interpreter (SIM_DESC sd, struct bfd *abfd) memory area, so we go via a temporary area. Luckily, the interpreter is supposed to be small, less than 0x40000 bytes. */ - sim_do_commandf (sd, "memory region 0x%" BFD_VMA_FMT "x," - "0x%" BFD_VMA_FMT "x", - interp_load_addr, interpsiz); + sim_do_commandf (sd, "memory region 0x%" PRIx64 ",0x%" PRIx64, + (uint64_t) interp_load_addr, (uint64_t) interpsiz); /* Now that memory for the interpreter is defined, load it. */ if (!cris_load_elf_file (sd, ibfd, cris_write_interp)) -- cgit v1.1