diff options
author | Tom Tromey <tom@tromey.com> | 2018-04-21 16:16:27 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2018-10-04 22:51:45 -0600 |
commit | b926417afaea99ed17663e06d6654d0048536017 (patch) | |
tree | b26a979c2f74c28f5c8979f55acfdacefdb18cfb /gdb/ia64-tdep.c | |
parent | 1f88d0c87c37d3a15fa6376335e8b0d1c79d85aa (diff) | |
download | binutils-gdb-b926417afaea99ed17663e06d6654d0048536017.tar.gz |
Simple -Wshadow=local fixes
This fixes all the straightforward -Wshadow=local warnings in gdb. A
few standard approaches are used here:
* Renaming an inner (or outer, but more commonly inner) variable;
* Lowering a declaration to avoid a clash;
* Moving a declaration into a more inner scope to avoid a clash,
including the special case of moving a declaration into a loop header.
I did not consider any of the changes in this patch to be particularly
noteworthy, though of course they should all still be examined.
gdb/ChangeLog
2018-10-04 Tom Tromey <tom@tromey.com>
* ctf.c (SET_ARRAY_FIELD): Rename "u32".
* p-valprint.c (pascal_val_print): Split inner "i" variable.
* xtensa-tdep.c (xtensa_push_dummy_call): Declare "i" in loop
header.
* xstormy16-tdep.c (xstormy16_push_dummy_call): Declare "val" in
more inner scope.
* xcoffread.c (read_xcoff_symtab): Rename inner "symbol".
* varobj.c (varobj_update): Rename inner "newobj",
"type_changed".
* valprint.c (generic_emit_char): Rename inner "buf".
* valops.c (find_overload_match): Rename inner "temp".
(value_struct_elt_for_reference): Declare "v" in more inner
scope.
* v850-tdep.c (v850_push_dummy_call): Rename "len".
* unittests/array-view-selftests.c (run_tests): Rename inner
"vec".
* tui/tui-stack.c (tui_show_frame_info): Declare "i" in loop
header.
* tracepoint.c (merge_uploaded_trace_state_variables): Declare
"tsv" in more inner scope.
(print_one_static_tracepoint_marker): Rename inner
"tuple_emitter".
* tic6x-tdep.c (tic6x_analyze_prologue): Declare "inst" lower.
(tic6x_push_dummy_call): Don't redeclare "addr".
* target-float.c: Declare "dto" lower.
* symtab.c (lookup_local_symbol): Rename inner "sym".
(find_pc_sect_line): Rename inner "pc".
* stack.c (print_frame): Don't redeclare "gdbarch".
(return_command): Rename inner "gdbarch".
* s390-tdep.c (s390_prologue_frame_unwind_cache): Renam inner
"sp".
* rust-lang.c (rust_internal_print_type): Declare "i" in loop
header.
* rs6000-tdep.c (ppc_process_record): Rename inner "addr".
* riscv-tdep.c (riscv_push_dummy_call): Declare "info" in inner
scope.
* remote.c (remote_target::update_thread_list): Don't redeclare
"tp".
(remote_target::process_initial_stop_replies): Rename inner
"thread".
(remote_target::remote_parse_stop_reply): Don't redeclare "p".
(remote_target::wait_as): Don't redeclare "stop_reply".
(remote_target::get_thread_local_address): Rename inner
"result".
(remote_target::get_tib_address): Likewise.
Diffstat (limited to 'gdb/ia64-tdep.c')
-rw-r--r-- | gdb/ia64-tdep.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/gdb/ia64-tdep.c b/gdb/ia64-tdep.c index 5e9ecb51515..d381ecc74f3 100644 --- a/gdb/ia64-tdep.c +++ b/gdb/ia64-tdep.c @@ -947,7 +947,6 @@ ia64_pseudo_register_read (struct gdbarch *gdbarch, readable_regcache *regcache, found sequentially in memory starting at $bof. This isn't always true, but without libunwind, this is the best we can do. */ - enum register_status status; ULONGEST cfm; ULONGEST bsp; CORE_ADDR reg; @@ -1399,8 +1398,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, && it == M && ((instr & 0x1ee0000003fLL) == 0x02c00000000LL)) { /* alloc - start of a regular function. */ - int sol = (int) ((instr & 0x00007f00000LL) >> 20); - int sof = (int) ((instr & 0x000000fe000LL) >> 13); + int sol_bits = (int) ((instr & 0x00007f00000LL) >> 20); + int sof_bits = (int) ((instr & 0x000000fe000LL) >> 13); int rN = (int) ((instr & 0x00000001fc0LL) >> 6); /* Verify that the current cfm matches what we think is the @@ -1409,8 +1408,8 @@ examine_prologue (CORE_ADDR pc, CORE_ADDR lim_pc, addresses of various registers such as the return address. We will instead treat the frame as frameless. */ if (!this_frame || - (sof == (cache->cfm & 0x7f) && - sol == ((cache->cfm >> 7) & 0x7f))) + (sof_bits == (cache->cfm & 0x7f) && + sol_bits == ((cache->cfm >> 7) & 0x7f))) frameless = 0; cfm_reg = rN; @@ -3229,9 +3228,9 @@ ia64_extract_return_value (struct type *type, struct regcache *regcache, while (n-- > 0) { - ULONGEST val; - regcache_cooked_read_unsigned (regcache, regnum, &val); - memcpy ((char *)valbuf + offset, &val, reglen); + ULONGEST regval; + regcache_cooked_read_unsigned (regcache, regnum, ®val); + memcpy ((char *)valbuf + offset, ®val, reglen); offset += reglen; regnum++; } @@ -3270,7 +3269,6 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, } else { - ULONGEST val; int offset = 0; int regnum = IA64_GR8_REGNUM; int reglen = TYPE_LENGTH (register_type (gdbarch, IA64_GR8_REGNUM)); @@ -3288,6 +3286,7 @@ ia64_store_return_value (struct type *type, struct regcache *regcache, if (m) { + ULONGEST val; memcpy (&val, (char *)valbuf + offset, m); regcache_cooked_write_unsigned (regcache, regnum, val); } |