diff options
author | Doug Evans <dje@google.com> | 2014-02-19 16:38:44 -0800 |
---|---|---|
committer | Doug Evans <dje@google.com> | 2014-02-19 16:38:44 -0800 |
commit | f7667f0de68675a72743c73333c83a5fc6e5e69e (patch) | |
tree | 3bb438477d258ea00632081f632944136cc716e7 /gdb/gdbserver/linux-low.h | |
parent | b3312d801920bf1705263f533cdf16330bddedbe (diff) | |
download | gdb-f7667f0de68675a72743c73333c83a5fc6e5e69e.zip gdb-f7667f0de68675a72743c73333c83a5fc6e5e69e.tar.gz gdb-f7667f0de68675a72743c73333c83a5fc6e5e69e.tar.bz2 |
Add backlink from lwp_info to thread_info.
* gdbthread.h (add_thread): Change result type to struct thread_info *.
* inferiors.c (add_thread): Change result type to struct thread_info *.
All callers updated.
(add_lwp): Call add_thread here instead of in callers.
All callers updated.
* linux-low.h (get_lwp_thread): Rewrite.
(struct lwp_info): New member "thread".
This speeds up gdbserver attach in non-stop mode because now get_lwp_thread
doesn't do a linear search for the corresponding thread_info object.
Diffstat (limited to 'gdb/gdbserver/linux-low.h')
-rw-r--r-- | gdb/gdbserver/linux-low.h | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/gdb/gdbserver/linux-low.h b/gdb/gdbserver/linux-low.h index 3b7ec21..b3e75db 100644 --- a/gdb/gdbserver/linux-low.h +++ b/gdb/gdbserver/linux-low.h @@ -229,14 +229,17 @@ extern struct linux_target_ops the_low_target; #define get_lwp(inf) ((struct lwp_info *)(inf)) #define get_thread_lwp(thr) (get_lwp (inferior_target_data (thr))) -#define get_lwp_thread(proc) ((struct thread_info *) \ - find_inferior_id (&all_threads, \ - get_lwp (proc)->entry.id)) +#define get_lwp_thread(lwp) ((lwp)->thread) struct lwp_info { struct inferior_list_entry entry; + /* Backlink to the thread_info object. + It is the "main" representation of the thread, we just contain + linux-specific subordinate data. */ + struct thread_info *thread; + /* If this flag is set, the next SIGSTOP will be ignored (the process will be immediately resumed). This means that either we sent the SIGSTOP to it ourselves and got some other pending event |