diff options
author | Daniel Jacobowitz <drow@false.org> | 2004-10-16 17:42:00 +0000 |
---|---|---|
committer | Daniel Jacobowitz <drow@false.org> | 2004-10-16 17:42:00 +0000 |
commit | fd5008162e2dc522e4fea16de38a355f7e1a43be (patch) | |
tree | 5df2b32d3dbdef7b9996bdbf0b9a408e481774ea /gdb/gdbserver/thread-db.c | |
parent | f6de3c42a31e268abe5f03ea860742829db2f677 (diff) | |
download | fsf-binutils-gdb-fd5008162e2dc522e4fea16de38a355f7e1a43be.zip fsf-binutils-gdb-fd5008162e2dc522e4fea16de38a355f7e1a43be.tar.gz fsf-binutils-gdb-fd5008162e2dc522e4fea16de38a355f7e1a43be.tar.bz2 |
* 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.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/gdb/gdbserver/thread-db.c b/gdb/gdbserver/thread-db.c index f3d57a5..c6e0c2d 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: |