aboutsummaryrefslogtreecommitdiff
path: root/gdb/gdbserver
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2017-11-19 22:23:25 -0500
committerSimon Marchi <simon.marchi@polymtl.ca>2017-11-19 22:23:25 -0500
commitfcb056a58dd38cfe7bcd34b7889138bf807c40b8 (patch)
treece9e4af1175b5ab784b7ca6ec7785a9e67af5dc8 /gdb/gdbserver
parent139720c5b32963ce52c5f691e179920ff84a2237 (diff)
downloadgdb-fcb056a58dd38cfe7bcd34b7889138bf807c40b8.zip
gdb-fcb056a58dd38cfe7bcd34b7889138bf807c40b8.tar.gz
gdb-fcb056a58dd38cfe7bcd34b7889138bf807c40b8.tar.bz2
Remove usage of find_inferior in linux_stabilize_threads
Simply replace with find_thread. gdb/gdbserver/ChangeLog: * linux-low.c (stuck_in_jump_pad_callback): Change prototype, return bool, remove data argument. (linux_stabilize_threads): Use find_thread.
Diffstat (limited to 'gdb/gdbserver')
-rw-r--r--gdb/gdbserver/ChangeLog6
-rw-r--r--gdb/gdbserver/linux-low.c23
2 files changed, 14 insertions, 15 deletions
diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog
index f824cff..9232f07 100644
--- a/gdb/gdbserver/ChangeLog
+++ b/gdb/gdbserver/ChangeLog
@@ -1,5 +1,11 @@
2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
+ * linux-low.c (stuck_in_jump_pad_callback): Change prototype,
+ return bool, remove data argument.
+ (linux_stabilize_threads): Use find_thread.
+
+2017-11-19 Simon Marchi <simon.marchi@ericsson.com>
+
* linux-low.c (unsuspend_one_lwp): Remove.
(unsuspend_all_lwps): Use for_each_thread, inline code from
unsuspend_one_lwp.
diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c
index fce3fd0..b4c716c 100644
--- a/gdb/gdbserver/linux-low.c
+++ b/gdb/gdbserver/linux-low.c
@@ -2985,7 +2985,7 @@ unsuspend_all_lwps (struct lwp_info *except)
}
static void move_out_of_jump_pad_callback (thread_info *thread);
-static int stuck_in_jump_pad_callback (thread_info *thread, void *data);
+static bool stuck_in_jump_pad_callback (thread_info *thread);
static int lwp_running (thread_info *thread, void *data);
static ptid_t linux_wait_1 (ptid_t ptid,
struct target_waitstatus *ourstatus,
@@ -3024,13 +3024,8 @@ static ptid_t linux_wait_1 (ptid_t ptid,
static void
linux_stabilize_threads (void)
{
- struct thread_info *saved_thread;
- struct thread_info *thread_stuck;
+ thread_info *thread_stuck = find_thread (stuck_in_jump_pad_callback);
- thread_stuck
- = (struct thread_info *) find_inferior (&all_threads,
- stuck_in_jump_pad_callback,
- NULL);
if (thread_stuck != NULL)
{
if (debug_threads)
@@ -3039,7 +3034,7 @@ linux_stabilize_threads (void)
return;
}
- saved_thread = current_thread;
+ thread_info *saved_thread = current_thread;
stabilizing_threads = 1;
@@ -3082,10 +3077,8 @@ linux_stabilize_threads (void)
if (debug_threads)
{
- thread_stuck
- = (struct thread_info *) find_inferior (&all_threads,
- stuck_in_jump_pad_callback,
- NULL);
+ thread_stuck = find_thread (stuck_in_jump_pad_callback);
+
if (thread_stuck != NULL)
debug_printf ("couldn't stabilize, LWP %ld got stuck in jump pad\n",
lwpid_of (thread_stuck));
@@ -4111,13 +4104,13 @@ wait_for_sigstop (void)
}
}
-/* Returns true if LWP ENTRY is stopped in a jump pad, and we can't
+/* Returns true if THREAD is stopped in a jump pad, and we can't
move it out, because we need to report the stop event to GDB. For
example, if the user puts a breakpoint in the jump pad, it's
because she wants to debug it. */
-static int
-stuck_in_jump_pad_callback (thread_info *thread, void *data)
+static bool
+stuck_in_jump_pad_callback (thread_info *thread)
{
struct lwp_info *lwp = get_thread_lwp (thread);