Use new and delete for windows_thread_info
[deliverable/binutils-gdb.git] / gdb / nat / windows-nat.h
CommitLineData
ae1f8880
TT
1/* Internal interfaces for the Windows code
2 Copyright (C) 1995-2020 Free Software Foundation, Inc.
3
4 This file is part of GDB.
5
6 This program is free software; you can redistribute it and/or modify
7 it under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3 of the License, or
9 (at your option) any later version.
10
11 This program is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with this program. If not, see <http://www.gnu.org/licenses/>. */
18
19#ifndef NAT_WINDOWS_NAT_H
20#define NAT_WINDOWS_NAT_H
21
22#include <windows.h>
23
24/* Thread information structure used to track extra information about
25 each thread. */
26struct windows_thread_info
27{
e9534bd2
TT
28 windows_thread_info (DWORD tid_, HANDLE h_, CORE_ADDR tlb)
29 : tid (tid_),
30 h (h_),
31 thread_local_base (tlb)
32 {
33 }
34
35 ~windows_thread_info ()
36 {
37 xfree (name);
38 }
39
40 DISABLE_COPY_AND_ASSIGN (windows_thread_info);
41
ae1f8880
TT
42 /* The Win32 thread identifier. */
43 DWORD tid;
44
45 /* The handle to the thread. */
46 HANDLE h;
47
48 /* Thread Information Block address. */
49 CORE_ADDR thread_local_base;
50
51 /* Non zero if SuspendThread was called on this thread. */
e9534bd2 52 int suspended = 0;
ae1f8880
TT
53
54#ifdef _WIN32_WCE
55 /* The context as retrieved right after suspending the thread. */
e9534bd2 56 CONTEXT base_context {};
ae1f8880
TT
57#endif
58
59 /* The context of the thread, including any manipulations. */
60 union
61 {
e9534bd2 62 CONTEXT context {};
ae1f8880
TT
63#ifdef __x86_64__
64 WOW64_CONTEXT wow64_context;
65#endif
66 };
67
68 /* Whether debug registers changed since we last set CONTEXT back to
69 the thread. */
e9534bd2 70 int debug_registers_changed = 0;
ae1f8880
TT
71
72 /* Nonzero if CONTEXT is invalidated and must be re-read from the
73 inferior thread. */
e9534bd2 74 int reload_context = 0;
ae1f8880
TT
75
76 /* The name of the thread, allocated by xmalloc. */
e9534bd2 77 char *name = nullptr;
ae1f8880
TT
78};
79
80#endif
This page took 0.026763 seconds and 4 git commands to generate.