This renames win32_thread_info to windows_thread_info in gdbserver.
This renaming helps make it possible to share some code between gdb
and gdbserver.
gdbserver/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.h (struct windows_thread_info): Rename from
win32_thread_info. Remove typedef.
(struct win32_target_ops, win32_require_context): Update.
* win32-low.c (win32_get_thread_context)
(win32_set_thread_context, win32_prepare_to_resume)
(win32_require_context, thread_rec, child_add_thread)
(delete_thread_info, continue_one_thread)
(child_fetch_inferior_registers, child_store_inferior_registers)
(win32_resume, suspend_one_thread, win32_get_tib_address):
Update.
* win32-i386-low.c (update_debug_registers)
(win32_get_current_dr, i386_get_thread_context)
(i386_prepare_to_resume, i386_thread_added, i386_single_step)
(i386_fetch_inferior_register, i386_store_inferior_register):
Update.
* win32-arm-low.c (arm_get_thread_context)
(arm_fetch_inferior_register, arm_store_inferior_register):
Update.
+2020-04-08 Tom Tromey <tromey@adacore.com>
+
+ * win32-low.h (struct windows_thread_info): Rename from
+ win32_thread_info. Remove typedef.
+ (struct win32_target_ops, win32_require_context): Update.
+ * win32-low.c (win32_get_thread_context)
+ (win32_set_thread_context, win32_prepare_to_resume)
+ (win32_require_context, thread_rec, child_add_thread)
+ (delete_thread_info, continue_one_thread)
+ (child_fetch_inferior_registers, child_store_inferior_registers)
+ (win32_resume, suspend_one_thread, win32_get_tib_address):
+ Update.
+ * win32-i386-low.c (update_debug_registers)
+ (win32_get_current_dr, i386_get_thread_context)
+ (i386_prepare_to_resume, i386_thread_added, i386_single_step)
+ (i386_fetch_inferior_register, i386_store_inferior_register):
+ Update.
+ * win32-arm-low.c (arm_get_thread_context)
+ (arm_fetch_inferior_register, arm_store_inferior_register):
+ Update.
+
2020-04-02 Tankut Baris Aktemur <tankut.baris.aktemur@intel.com>
* linux-low.h (struct linux_target_ops): Remove.
extern const struct target_desc *tdesc_arm;
static void
-arm_get_thread_context (win32_thread_info *th)
+arm_get_thread_context (windows_thread_info *th)
{
th->context.ContextFlags = \
CONTEXT_FULL | \
/* Fetch register from gdbserver regcache data. */
static void
arm_fetch_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
+ windows_thread_info *th, int r)
{
char *context_offset = regptr (&th->context, r);
supply_register (regcache, r, context_offset);
/* Store a new register value into the thread context of TH. */
static void
arm_store_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
+ windows_thread_info *th, int r)
{
collect_register (regcache, r, regptr (&th->context, r));
}
static void
update_debug_registers (thread_info *thread)
{
- win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
+ windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
/* The actual update is done later just before resuming the lwp,
we just mark that the registers need updating. */
static DWORD64
win32_get_current_dr (int dr)
{
- win32_thread_info *th
- = (win32_thread_info *) thread_target_data (current_thread);
+ windows_thread_info *th
+ = (windows_thread_info *) thread_target_data (current_thread);
win32_require_context (th);
}
static void
-i386_get_thread_context (win32_thread_info *th)
+i386_get_thread_context (windows_thread_info *th)
{
/* Requesting the CONTEXT_EXTENDED_REGISTERS register set fails if
the system doesn't support extended registers. */
}
static void
-i386_prepare_to_resume (win32_thread_info *th)
+i386_prepare_to_resume (windows_thread_info *th)
{
if (th->debug_registers_changed)
{
}
static void
-i386_thread_added (win32_thread_info *th)
+i386_thread_added (windows_thread_info *th)
{
th->debug_registers_changed = 1;
}
static void
-i386_single_step (win32_thread_info *th)
+i386_single_step (windows_thread_info *th)
{
th->context.EFlags |= FLAG_TRACE_BIT;
}
/* Fetch register from gdbserver regcache data. */
static void
i386_fetch_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
+ windows_thread_info *th, int r)
{
char *context_offset = (char *) &th->context + mappings[r];
/* Store a new register value into the thread context of TH. */
static void
i386_store_inferior_register (struct regcache *regcache,
- win32_thread_info *th, int r)
+ windows_thread_info *th, int r)
{
char *context_offset = (char *) &th->context + mappings[r];
collect_register (regcache, r, context_offset);
/* Get the thread context of the thread associated with TH. */
static void
-win32_get_thread_context (win32_thread_info *th)
+win32_get_thread_context (windows_thread_info *th)
{
memset (&th->context, 0, sizeof (CONTEXT));
(*the_low_target.get_thread_context) (th);
/* Set the thread context of the thread associated with TH. */
static void
-win32_set_thread_context (win32_thread_info *th)
+win32_set_thread_context (windows_thread_info *th)
{
#ifdef _WIN32_WCE
/* Calling SuspendThread on a thread that is running kernel code
/* Set the thread context of the thread associated with TH. */
static void
-win32_prepare_to_resume (win32_thread_info *th)
+win32_prepare_to_resume (windows_thread_info *th)
{
if (the_low_target.prepare_to_resume != NULL)
(*the_low_target.prepare_to_resume) (th);
/* See win32-low.h. */
void
-win32_require_context (win32_thread_info *th)
+win32_require_context (windows_thread_info *th)
{
if (th->context.ContextFlags == 0)
{
/* Find a thread record given a thread id. If GET_CONTEXT is set then
also retrieve the context for this thread. */
-static win32_thread_info *
+static windows_thread_info *
thread_rec (ptid_t ptid, int get_context)
{
thread_info *thread = find_thread_ptid (ptid);
if (thread == NULL)
return NULL;
- win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
+ windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
if (get_context)
win32_require_context (th);
return th;
}
/* Add a thread to the thread list. */
-static win32_thread_info *
+static windows_thread_info *
child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb)
{
- win32_thread_info *th;
+ windows_thread_info *th;
ptid_t ptid = ptid_t (pid, tid, 0);
if ((th = thread_rec (ptid, FALSE)))
return th;
- th = XCNEW (win32_thread_info);
+ th = XCNEW (windows_thread_info);
th->tid = tid;
th->h = h;
th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb;
static void
delete_thread_info (thread_info *thread)
{
- win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
+ windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
remove_thread (thread);
CloseHandle (th->h);
static void
continue_one_thread (thread_info *thread, int thread_id)
{
- win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
+ windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
if (thread_id == -1 || thread_id == th->tid)
{
child_fetch_inferior_registers (struct regcache *regcache, int r)
{
int regno;
- win32_thread_info *th = thread_rec (current_thread_ptid (), TRUE);
+ windows_thread_info *th = thread_rec (current_thread_ptid (), TRUE);
if (r == -1 || r > NUM_REGS)
child_fetch_inferior_registers (regcache, NUM_REGS);
else
child_store_inferior_registers (struct regcache *regcache, int r)
{
int regno;
- win32_thread_info *th = thread_rec (current_thread_ptid (), TRUE);
+ windows_thread_info *th = thread_rec (current_thread_ptid (), TRUE);
if (r == -1 || r == 0 || r > NUM_REGS)
child_store_inferior_registers (regcache, NUM_REGS);
else
DWORD tid;
enum gdb_signal sig;
int step;
- win32_thread_info *th;
+ windows_thread_info *th;
DWORD continue_status = DBG_CONTINUE;
ptid_t ptid;
static void
suspend_one_thread (thread_info *thread)
{
- win32_thread_info *th = (win32_thread_info *) thread_target_data (thread);
+ windows_thread_info *th = (windows_thread_info *) thread_target_data (thread);
if (!th->suspended)
{
int
win32_process_target::get_tib_address (ptid_t ptid, CORE_ADDR *addr)
{
- win32_thread_info *th;
+ windows_thread_info *th;
th = thread_rec (ptid, 0);
if (th == NULL)
return 0;
/* Thread information structure used to track extra information about
each thread. */
-typedef struct win32_thread_info
+struct windows_thread_info
{
/* The Win32 thread identifier. */
DWORD tid;
/* Whether debug registers changed since we last set CONTEXT back to
the thread. */
int debug_registers_changed;
-} win32_thread_info;
+};
struct win32_target_ops
{
void (*initial_stuff) (void);
/* Fetch the context from the inferior. */
- void (*get_thread_context) (win32_thread_info *th);
+ void (*get_thread_context) (windows_thread_info *th);
/* Called just before resuming the thread. */
- void (*prepare_to_resume) (win32_thread_info *th);
+ void (*prepare_to_resume) (windows_thread_info *th);
/* Called when a thread was added. */
- void (*thread_added) (win32_thread_info *th);
+ void (*thread_added) (windows_thread_info *th);
/* Fetch register from gdbserver regcache data. */
void (*fetch_inferior_register) (struct regcache *regcache,
- win32_thread_info *th, int r);
+ windows_thread_info *th, int r);
/* Store a new register value into the thread context of TH. */
void (*store_inferior_register) (struct regcache *regcache,
- win32_thread_info *th, int r);
+ windows_thread_info *th, int r);
- void (*single_step) (win32_thread_info *th);
+ void (*single_step) (windows_thread_info *th);
const unsigned char *breakpoint;
int breakpoint_len;
};
/* Retrieve the context for this thread, if not already retrieved. */
-extern void win32_require_context (win32_thread_info *th);
+extern void win32_require_context (windows_thread_info *th);
/* Map the Windows error number in ERROR to a locale-dependent error
message string and return a pointer to it. Typically, the values