aboutsummaryrefslogtreecommitdiff
path: root/gdb/mi
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-21 16:16:27 -0600
committerTom Tromey <tom@tromey.com>2018-10-04 22:51:45 -0600
commitb926417afaea99ed17663e06d6654d0048536017 (patch)
treeb26a979c2f74c28f5c8979f55acfdacefdb18cfb /gdb/mi
parent1f88d0c87c37d3a15fa6376335e8b0d1c79d85aa (diff)
downloadgdb-b926417afaea99ed17663e06d6654d0048536017.zip
gdb-b926417afaea99ed17663e06d6654d0048536017.tar.gz
gdb-b926417afaea99ed17663e06d6654d0048536017.tar.bz2
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/mi')
-rw-r--r--gdb/mi/mi-cmd-var.c2
-rw-r--r--gdb/mi/mi-main.c10
2 files changed, 6 insertions, 6 deletions
diff --git a/gdb/mi/mi-cmd-var.c b/gdb/mi/mi-cmd-var.c
index 08e360c..d320a9b 100644
--- a/gdb/mi/mi-cmd-var.c
+++ b/gdb/mi/mi-cmd-var.c
@@ -752,7 +752,7 @@ varobj_update_one (struct varobj *var, enum print_values print_values,
for (varobj *child : r.newobj)
{
- ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ ui_out_emit_tuple inner_tuple_emitter (uiout, NULL);
print_varobj (child, print_values, 1 /* print_expression */);
}
}
diff --git a/gdb/mi/mi-main.c b/gdb/mi/mi-main.c
index 1e31040..f6fbebc 100644
--- a/gdb/mi/mi-main.c
+++ b/gdb/mi/mi-main.c
@@ -768,7 +768,7 @@ list_available_thread_groups (const std::set<int> &ids, int recurse)
for (const osdata_item &child : children)
{
- ui_out_emit_tuple tuple_emitter (uiout, NULL);
+ ui_out_emit_tuple inner_tuple_emitter (uiout, NULL);
const std::string *tid = get_osdata_column (child, "tid");
const std::string *tcore = get_osdata_column (child, "core");
@@ -1376,7 +1376,7 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
{
int col;
int col_byte;
- struct value_print_options opts;
+ struct value_print_options print_opts;
ui_out_emit_tuple tuple_emitter (uiout, NULL);
uiout->field_core_addr ("addr", gdbarch, addr + row_byte);
@@ -1384,7 +1384,7 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
row_byte); */
{
ui_out_emit_list list_data_emitter (uiout, "data");
- get_formatted_print_options (&opts, word_format);
+ get_formatted_print_options (&print_opts, word_format);
for (col = 0, col_byte = row_byte;
col < nr_cols;
col++, col_byte += word_size)
@@ -1396,8 +1396,8 @@ mi_cmd_data_read_memory (const char *command, char **argv, int argc)
else
{
stream.clear ();
- print_scalar_formatted (&mbuf[col_byte], word_type, &opts,
- word_asize, &stream);
+ print_scalar_formatted (&mbuf[col_byte], word_type,
+ &print_opts, word_asize, &stream);
uiout->field_stream (NULL, stream);
}
}