aboutsummaryrefslogtreecommitdiff
path: root/gdb/windows-nat.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@adacore.com>2020-04-08 14:33:35 -0600
committerTom Tromey <tromey@adacore.com>2020-04-08 14:47:58 -0600
commit2950fdf7423a404f6ebc691606d04917fd68228a (patch)
tree3072d75a13dd55ea955f206737a2b75a5a547003 /gdb/windows-nat.c
parent62fe396b1cba6b0c3d06b758d9f8254c6d538ad8 (diff)
downloadgdb-2950fdf7423a404f6ebc691606d04917fd68228a.zip
gdb-2950fdf7423a404f6ebc691606d04917fd68228a.tar.gz
gdb-2950fdf7423a404f6ebc691606d04917fd68228a.tar.bz2
Make windows_thread_info::name a unique_xmalloc_ptr
This changes windows_thread_info::name to be a unique_xmalloc_ptr, removing some manual memory management. gdb/ChangeLog 2020-04-08 Tom Tromey <tromey@adacore.com> * windows-nat.c (handle_exception) (windows_nat_target::thread_name): Update. * nat/windows-nat.h (windows_thread_info): Remove destructor. <name>: Now unique_xmalloc_ptr.
Diffstat (limited to 'gdb/windows-nat.c')
-rw-r--r--gdb/windows-nat.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/gdb/windows-nat.c b/gdb/windows-nat.c
index b7f21cb..7fbc9a4 100644
--- a/gdb/windows-nat.c
+++ b/gdb/windows-nat.c
@@ -1414,8 +1414,7 @@ handle_exception (struct target_waitstatus *ourstatus)
if (thread_name_len > 0)
{
thread_name.get ()[thread_name_len - 1] = '\0';
- xfree (named_thread->name);
- named_thread->name = thread_name.release ();
+ named_thread->name = std::move (thread_name);
}
}
ourstatus->value.sig = GDB_SIGNAL_TRAP;
@@ -3394,7 +3393,7 @@ windows_nat_target::get_ada_task_ptid (long lwp, long thread)
const char *
windows_nat_target::thread_name (struct thread_info *thr)
{
- return thread_rec (thr->ptid.tid (), 0)->name;
+ return thread_rec (thr->ptid.tid (), 0)->name.get ();
}