diff options
author | Tom Tromey <tromey@adacore.com> | 2020-04-08 14:33:35 -0600 |
---|---|---|
committer | Tom Tromey <tromey@adacore.com> | 2020-04-08 14:47:58 -0600 |
commit | 28688adf8f883fdd8b642a446ec5578236e84b1e (patch) | |
tree | 2183e5c7e4a1f52946c5d2c7b6d4bf1deeff1d09 /gdb/nat | |
parent | 4834dad062658ef49ef86c9c48eb004c48a242a5 (diff) | |
download | gdb-28688adf8f883fdd8b642a446ec5578236e84b1e.zip gdb-28688adf8f883fdd8b642a446ec5578236e84b1e.tar.gz gdb-28688adf8f883fdd8b642a446ec5578236e84b1e.tar.bz2 |
Share thread_rec between gdb and gdbserver
This changes gdb and gdbserver to use the same calling convention for
the "thread_rec" helper function. Fully merging these is difficult
due to differences in how threads are managed by the enclosing
applications; but sharing a declaration makes it possible for future
shared code to call this method.
gdb/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* windows-nat.c (enum thread_disposition_type): Move to
nat/windows-nat.h.
(windows_nat::thread_rec): Rename from thread_rec. No longer
static.
(windows_add_thread, windows_nat_target::fetch_registers)
(windows_nat_target::store_registers, handle_exception)
(windows_nat_target::resume, get_windows_debug_event)
(windows_nat_target::get_tib_address)
(windows_nat_target::thread_name)
(windows_nat_target::thread_alive): Update.
* nat/windows-nat.h (enum thread_disposition_type): Move from
windows-nat.c.
(thread_rec): Declare.
gdbserver/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (windows_nat::thread_rec): Rename from thread_rec.
No longer static. Change parameters.
(child_add_thread, child_fetch_inferior_registers)
(child_store_inferior_registers, win32_resume)
(win32_get_tib_address): Update.
Diffstat (limited to 'gdb/nat')
-rw-r--r-- | gdb/nat/windows-nat.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/gdb/nat/windows-nat.h b/gdb/nat/windows-nat.h index df28364..e63ef75 100644 --- a/gdb/nat/windows-nat.h +++ b/gdb/nat/windows-nat.h @@ -90,6 +90,27 @@ struct windows_thread_info gdb::unique_xmalloc_ptr<char> name; }; + +/* Possible values to pass to 'thread_rec'. */ +enum thread_disposition_type +{ + /* Do not invalidate the thread's context, and do not suspend the + thread. */ + DONT_INVALIDATE_CONTEXT, + /* Invalidate the context, but do not suspend the thread. */ + DONT_SUSPEND, + /* Invalidate the context and suspend the thread. */ + INVALIDATE_CONTEXT +}; + +/* Find a thread record given a thread id. THREAD_DISPOSITION + controls whether the thread is suspended, and whether the context + is invalidated. + + This function must be supplied by the embedding application. */ +extern windows_thread_info *thread_rec (ptid_t ptid, + thread_disposition_type disposition); + } #endif |