diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-05-03 23:27:16 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-05-04 08:13:45 -0400 |
commit | 5ee0bc23a68fe2a6a7717b31fda1db878b2c9764 (patch) | |
tree | 89d9ac8cad39ef7afdf6dfa1d93a5f06b87a440f /sim/rx | |
parent | 225bda24db9671e2087fda892f94141625836a40 (diff) | |
download | gdb-5ee0bc23a68fe2a6a7717b31fda1db878b2c9764.zip gdb-5ee0bc23a68fe2a6a7717b31fda1db878b2c9764.tar.gz gdb-5ee0bc23a68fe2a6a7717b31fda1db878b2c9764.tar.bz2 |
sim: clean up bfd_vma printing
A lot of this code predates the bfd_vma format define, so we have a
random mix of casts to known types so we can printf the value. Use
the BFD_VMA_FMT that now exists to simplify and reliability output
across different build configs.
Diffstat (limited to 'sim/rx')
-rw-r--r-- | sim/rx/ChangeLog | 4 | ||||
-rw-r--r-- | sim/rx/load.c | 8 |
2 files changed, 9 insertions, 3 deletions
diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index 4d7e93d..21a8ff62 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/ChangeLog @@ -1,3 +1,7 @@ +2021-05-04 Mike Frysinger <vapier@gentoo.org> + + * load.c (rx_load): Use BFD_VMA_FMT and drop casts. + 2021-05-03 Simon Marchi <simon.marchi@polymtl.ca> * trace.c (op_printf): Likewise. diff --git a/sim/rx/load.c b/sim/rx/load.c index b4523e1..b04826f 100644 --- a/sim/rx/load.c +++ b/sim/rx/load.c @@ -128,8 +128,10 @@ rx_load (bfd *prog, host_callback *callback) base = p->p_paddr; if (verbose > 1) - fprintf (stderr, "[load segment: lma=%08x vma=%08x size=%08x]\n", - (int) base, (int) p->p_vaddr, (int) size); + fprintf (stderr, + "[load segment: lma=%08" BFD_VMA_FMT "x vma=%08x " + "size=%08" BFD_VMA_FMT "x]\n", + base, (int) p->p_vaddr, size); if (callback) xprintf (callback, "Loading section %s, size %#lx lma %08lx vma %08lx\n", @@ -151,7 +153,7 @@ rx_load (bfd *prog, host_callback *callback) } if (bfd_bread (buf, size, prog) != size) { - fprintf (stderr, "Failed to read %lx bytes\n", (long) size); + fprintf (stderr, "Failed to read %" BFD_VMA_FMT "x bytes\n", size); continue; } |