From 34c6591498f4363ef2c71d683cdaaa33d6a6ad64 Mon Sep 17 00:00:00 2001 From: Pedro Alves Date: Mon, 30 Nov 2015 16:05:15 +0000 Subject: gdbserver crash running gdb.threads/non-ldr-exc-1.exp This fixes a gdbserver crash when running gdb.threads/non-ldr-exc-1.exp with "maint set target-non-stop on". The problem is that qSymbol is called when gdbserver has current_thread == NULL. gdb/gdbserver/ChangeLog: 2015-11-30 Pedro Alves * gdbthread.h (find_any_thread_of_pid): Declare. * inferiors.c (thread_of_pid, find_any_thread_of_pid): New functions. * server.c (handle_query): If current_thread is NULL, look for another thread of the selected process. --- gdb/gdbserver/gdbthread.h | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gdb/gdbserver/gdbthread.h') diff --git a/gdb/gdbserver/gdbthread.h b/gdb/gdbserver/gdbthread.h index d6959f4..0510419 100644 --- a/gdb/gdbserver/gdbthread.h +++ b/gdb/gdbserver/gdbthread.h @@ -80,6 +80,10 @@ struct thread_info *get_first_thread (void); struct thread_info *find_thread_ptid (ptid_t ptid); +/* Find any thread of the PID process. Returns NULL if none is + found. */ +struct thread_info *find_any_thread_of_pid (int pid); + /* Get current thread ID (Linux task ID). */ #define current_ptid (current_thread->entry.id) -- cgit v1.1