aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver/server.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-04-22 10:50:27 -0600
committerTom Tromey <tom@tromey.com>2018-10-04 22:51:46 -0600
commitda4ae14a4d1614015f6e8d4a37df1b882806630a (patch)
treeeb3dd1793d968b1cbbfd89649eb84e749dab9ec3 /gdb/gdbserver/server.c
parentb926417afaea99ed17663e06d6654d0048536017 (diff)
downloadbinutils-da4ae14a4d1614015f6e8d4a37df1b882806630a.zip
binutils-da4ae14a4d1614015f6e8d4a37df1b882806630a.tar.gz
binutils-da4ae14a4d1614015f6e8d4a37df1b882806630a.tar.bz2
Avoid shadowing in gdbserver
This fixes a few instances of shadowing in gdbserver. These are all simple fixes. gdb/gdbserver/ChangeLog 2018-10-04 Tom Tromey <tom@tromey.com> * server.c (handle_status): Rename inner "thread". (process_serial_event): Declare "res" in 'm' case. * linux-low.c (last_thread_of_process_p, find_lwp_pid) (iterate_over_lwps): Rename inner "thread". (linux_qxfer_libraries_svr4): Rename inner "len". * gdbthread.h (find_thread_in_random): Rename inner "thread".
Diffstat (limited to 'gdb/gdbserver/server.c')
-rw-r--r--gdb/gdbserver/server.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/gdb/gdbserver/server.c b/gdb/gdbserver/server.c
index a491ae0..d711c53 100644
--- a/gdb/gdbserver/server.c
+++ b/gdb/gdbserver/server.c
@@ -3367,9 +3367,9 @@ handle_status (char *own_buf)
/* If the last event thread is not found for some reason, look
for some other thread that might have an event to report. */
if (thread == NULL)
- thread = find_thread ([] (thread_info *thread)
+ thread = find_thread ([] (thread_info *thr_arg)
{
- return thread->status_pending_p;
+ return thr_arg->status_pending_p;
});
/* If we're still out of luck, simply pick the first thread in
@@ -4028,7 +4028,6 @@ process_serial_event (void)
client_state &cs = get_client_state ();
int signal;
unsigned int len;
- int res;
CORE_ADDR mem_addr;
unsigned char sig;
int packet_len;
@@ -4172,13 +4171,15 @@ process_serial_event (void)
}
break;
case 'm':
- require_running_or_break (cs.own_buf);
- decode_m_packet (&cs.own_buf[1], &mem_addr, &len);
- res = gdb_read_memory (mem_addr, mem_buf, len);
- if (res < 0)
- write_enn (cs.own_buf);
- else
- bin2hex (mem_buf, cs.own_buf, res);
+ {
+ require_running_or_break (cs.own_buf);
+ decode_m_packet (&cs.own_buf[1], &mem_addr, &len);
+ int res = gdb_read_memory (mem_addr, mem_buf, len);
+ if (res < 0)
+ write_enn (cs.own_buf);
+ else
+ bin2hex (mem_buf, cs.own_buf, res);
+ }
break;
case 'M':
require_running_or_break (cs.own_buf);