diff options
author | Mike Frysinger <vapier@gentoo.org> | 2021-01-09 14:06:15 -0500 |
---|---|---|
committer | Mike Frysinger <vapier@gentoo.org> | 2021-01-11 08:27:40 -0500 |
commit | 90e123dd600140ccc0731668e1256e1a55b04f8f (patch) | |
tree | 00e402bffbe259eb1735ddf7a075d02ddc029766 /sim | |
parent | 933306703a73585ad80c72a8a9422833074961a2 (diff) | |
download | gdb-90e123dd600140ccc0731668e1256e1a55b04f8f.zip gdb-90e123dd600140ccc0731668e1256e1a55b04f8f.tar.gz gdb-90e123dd600140ccc0731668e1256e1a55b04f8f.tar.bz2 |
sim: common: fix printf formats
For 32-bit targets, %x happens to work for unsigned_word. But for
64-bit targets, it's too small, and gcc throws an error. Use the
right printf format define for them.
Diffstat (limited to 'sim')
-rw-r--r-- | sim/common/ChangeLog | 4 | ||||
-rw-r--r-- | sim/common/sim-core.c | 3 |
2 files changed, 6 insertions, 1 deletions
diff --git a/sim/common/ChangeLog b/sim/common/ChangeLog index 6ffee16..8039a78 100644 --- a/sim/common/ChangeLog +++ b/sim/common/ChangeLog @@ -1,5 +1,9 @@ 2021-01-11 Mike Frysinger <vapier@gentoo.org> + * sim-core.c (sim_memory_map): Change %#x to PRIxTW. + +2021-01-11 Mike Frysinger <vapier@gentoo.org> + * acinclude.m4 (SIM_AC_COMMON): Delete checks for stdlib.h, string.h, strings.h, time.h, and errno.h. * callback.c, cgen-scache.c, dv-glue.c, dv-pal.c, dv-sockser.c, diff --git a/sim/common/sim-core.c b/sim/common/sim-core.c index ade345e..9b1e168 100644 --- a/sim/common/sim-core.c +++ b/sim/common/sim-core.c @@ -480,7 +480,8 @@ sim_memory_map (SIM_DESC sd) if (mapping->level != 0) continue; - entry = xasprintf ("<memory type='ram' start='%#x' length='%#x'/>\n", + entry = xasprintf ("<memory type='ram' start='%#" PRIxTW "' " + "length='%#" PRIxTW "'/>\n", mapping->base, mapping->nr_bytes); /* The sim memory map is organized by access, not by addresses. So a RWX memory map will have three independent mappings. |