diff options
author | Mark Wielaard <mark@klomp.org> | 2024-01-22 12:58:11 +0100 |
---|---|---|
committer | Mark Wielaard <mark@klomp.org> | 2024-01-22 14:22:30 +0100 |
commit | cbbcd7fd1075b7fb158586507cce3be19051b26f (patch) | |
tree | d94b8e2edf8275fd6903209910f80571ff2d5ef2 /sim/ppc | |
parent | c2625a463ffd8c0d10b85b65e80ab8b67b28e441 (diff) | |
download | gdb-cbbcd7fd1075b7fb158586507cce3be19051b26f.zip gdb-cbbcd7fd1075b7fb158586507cce3be19051b26f.tar.gz gdb-cbbcd7fd1075b7fb158586507cce3be19051b26f.tar.bz2 |
sim: Fix -Werror=shadow=local by changing mem to addr in sim_{read,write}
m32c/cpu.h defines mem as enum value, which causes GCC 14 to emit
sim/m32c/gdb-if.c: In function ‘sim_read’:
sim/m32c/gdb-if.c:162:33: error: declaration of ‘mem’ shadows a previous local [-Werror=shadow=local]
162 | sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length)
| ~~~~~~~~~^~~
In file included from ../../binutils-gdb/sim/m32c/gdb-if.c:38:
sim/m32c/cpu.h:83:3: note: shadowed declaration is here
83 | mem,
| ^~~
Fix this by renaming mem to addr in all sim_read and sim_write functions.
Most already used addr instead of mem. In one file, sim/rx/gdb-if.c, this
also meant renaming the local addr variable to vma.
Diffstat (limited to 'sim/ppc')
-rw-r--r-- | sim/ppc/sim_calls.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/sim/ppc/sim_calls.c b/sim/ppc/sim_calls.c index 13e39a6..dc177e4 100644 --- a/sim/ppc/sim_calls.c +++ b/sim/ppc/sim_calls.c @@ -125,26 +125,26 @@ sim_load (SIM_DESC sd, const char *prog, bfd *abfd, int from_tty) uint64_t -sim_read (SIM_DESC sd, uint64_t mem, void *buf, uint64_t length) +sim_read (SIM_DESC sd, uint64_t addr, void *buf, uint64_t length) { int result = psim_read_memory(simulator, MAX_NR_PROCESSORS, - buf, mem, length); + buf, addr, length); TRACE(trace_gdb, - ("sim_read(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n", - mem, buf, length, result)); + ("sim_read(addr=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n", + addr, buf, length, result)); return result; } uint64_t -sim_write (SIM_DESC sd, uint64_t mem, const void *buf, uint64_t length) +sim_write (SIM_DESC sd, uint64_t addr, const void *buf, uint64_t length) { int result = psim_write_memory(simulator, MAX_NR_PROCESSORS, - buf, mem, length, + buf, addr, length, 1/*violate_ro*/); TRACE(trace_gdb, - ("sim_write(mem=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n", - mem, buf, length, result)); + ("sim_write(addr=0x%" PRIx64 ", buf=%p, length=%" PRIx64 ") = %d\n", + addr, buf, length, result)); return result; } |