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:57 -0600 |
commit | e9534bd257ac9ea2f7921e8000d27c5dc4477b4e (patch) | |
tree | b35d6e3be01a4fea2dd0650cbcfd549ae5b8c872 /gdbserver/win32-low.cc | |
parent | ae1f8880758d8087ad9fdb137d45c4abc1137b52 (diff) | |
download | gdb-e9534bd257ac9ea2f7921e8000d27c5dc4477b4e.zip gdb-e9534bd257ac9ea2f7921e8000d27c5dc4477b4e.tar.gz gdb-e9534bd257ac9ea2f7921e8000d27c5dc4477b4e.tar.bz2 |
Use new and delete for windows_thread_info
This adds a constructor, destructor, and member initializers to
windows_thread_info, and changes gdb and gdbserver to use new and
delete.
gdb/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* windows-nat.c (windows_add_thread): Use new.
(windows_init_thread_list, windows_delete_thread): Use delete.
(get_windows_debug_event): Update.
* nat/windows-nat.h (struct windows_thread_info): Add constructor,
destructor, and initializers.
gdbserver/ChangeLog
2020-04-08 Tom Tromey <tromey@adacore.com>
* win32-low.c (child_add_thread): Use new.
(delete_thread_info): Use delete.
Diffstat (limited to 'gdbserver/win32-low.cc')
-rw-r--r-- | gdbserver/win32-low.cc | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/gdbserver/win32-low.cc b/gdbserver/win32-low.cc index 55e8322..1284ed1 100644 --- a/gdbserver/win32-low.cc +++ b/gdbserver/win32-low.cc @@ -212,10 +212,7 @@ child_add_thread (DWORD pid, DWORD tid, HANDLE h, void *tlb) if ((th = thread_rec (ptid, FALSE))) return th; - th = XCNEW (windows_thread_info); - th->tid = tid; - th->h = h; - th->thread_local_base = (CORE_ADDR) (uintptr_t) tlb; + th = new windows_thread_info (tid, h, (CORE_ADDR) (uintptr_t) tlb); add_thread (ptid, th); @@ -233,7 +230,7 @@ delete_thread_info (thread_info *thread) remove_thread (thread); CloseHandle (th->h); - free (th); + delete th; } /* Delete a thread from the list of threads. */ |