summaryrefslogtreecommitdiff
path: root/gdb/gdbserver/thread-db.c
diff options
context:
space:
mode:
authorDaniel Jacobowitz <dan@debian.org>2004-10-16 17:42:00 +0000
committerDaniel Jacobowitz <dan@debian.org>2004-10-16 17:42:00 +0000
commitbb0816c9930c5320030569b54f763ca58c80ef07 (patch)
tree0c18ab99fd24cef8b6f475ae80484cdc502c3520 /gdb/gdbserver/thread-db.c
parent5236a8d8aeb0d9de4aa78d5487be625e4a419741 (diff)
downloadgdb-bb0816c9930c5320030569b54f763ca58c80ef07.tar.gz
* linux-i386-low.c (ps_get_thread_area): New.
* linux-x86-64-low.c (ps_get_thread_area): New. * linux-low.c: Include <sys/syscall.h>. (linux_kill_one_process): Don't kill the first thread here. (linux_kill): Kill the first thread here. (kill_lwp): New function. (send_sigstop, linux_send_signal): Use it. * proc-service.c: Clean up #ifdefs. (fpregset_info): Delete. (ps_lgetregs): Update and enable implementation. (ps_lsetregs, ps_lgetfpregs, ps_lsetfpregs): Remove disabled implementations. * remote-utils.c (struct sym_cache, symbol_cache): New. (input_interrupt): Print a clearer message. (async_io_enabled): New variable. (enable_async_io, disable_async_io): Use it. Update comments. (look_up_one_symbol): Use the symbol cache. * thread-db.c (thread_db_look_up_symbols): New function. (thread_db_init): Update comments. Call thread_db_look_up_symbols.
Diffstat (limited to 'gdb/gdbserver/thread-db.c')
-rw-r--r--gdb/gdbserver/thread-db.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c
index f3d57a54d62..c6e0c2de3a7 100644
--- a/gdb/gdbserver/thread-db.c
+++ b/gdb/gdbserver/thread-db.c
@@ -312,11 +312,36 @@ thread_db_find_new_threads (void)
error ("Cannot find new threads: %s", thread_db_err_str (err));
}
+/* Cache all future symbols that thread_db might request. We can not
+ request symbols at arbitrary states in the remote protocol, only
+ when the client tells us that new symbols are available. So when
+ we load the thread library, make sure to check the entire list. */
+
+static void
+thread_db_look_up_symbols (void)
+{
+ const char **sym_list = td_symbol_list ();
+ CORE_ADDR unused;
+
+ for (sym_list = td_symbol_list (); *sym_list; sym_list++)
+ look_up_one_symbol (*sym_list, &unused);
+}
+
int
thread_db_init ()
{
int err;
+ /* FIXME drow/2004-10-16: This is the "overall process ID", which
+ GNU/Linux calls tgid, "thread group ID". When we support
+ attaching to threads, the original thread may not be the correct
+ thread. We would have to get the process ID from /proc for NPTL.
+ For LinuxThreads we could do something similar: follow the chain
+ of parent processes until we find the highest one we're attached
+ to, and use its tgid.
+
+ This isn't the only place in gdbserver that assumes that the first
+ process in the list is the thread group leader. */
proc_handle.pid = ((struct inferior_list_entry *)current_inferior)->id;
err = td_ta_new (&proc_handle, &thread_agent);
@@ -332,6 +357,7 @@ thread_db_init ()
if (thread_db_enable_reporting () == 0)
return 0;
thread_db_find_new_threads ();
+ thread_db_look_up_symbols ();
return 1;
default: