xref: /llvm-project/lldb/source/Target/ThreadSpec.cpp (revision 1b54c88cc4f8582222644d65dfd61703206430ef)
1 //===-- ThreadSpec.cpp ----------------------------------------------*- C++ -*-===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9 
10 #include "lldb/Target/Thread.h"
11 #include "lldb/Target/ThreadSpec.h"
12 
13 using namespace lldb;
14 using namespace lldb_private;
15 
16 ThreadSpec::ThreadSpec() :
17     m_index (-1),
18     m_tid (LLDB_INVALID_THREAD_ID),
19     m_name(),
20     m_queue_name ()
21 {
22 }
23 
24 ThreadSpec::ThreadSpec (const ThreadSpec &rhs) :
25     m_index(rhs.m_index),
26     m_tid(rhs.m_tid),
27     m_name(rhs.m_name),
28     m_queue_name(rhs.m_queue_name)
29 {
30 }
31 
32 const ThreadSpec &
33 ThreadSpec::operator=(const ThreadSpec &rhs)
34 {
35     m_index = rhs.m_index;
36     m_tid = rhs.m_tid;
37     m_name = rhs.m_name;
38     m_queue_name = rhs.m_queue_name;
39     return *this;
40 }
41 
42 const char *
43 ThreadSpec::GetName () const
44 {
45     if (m_name.empty())
46         return NULL;
47     else
48         return m_name.c_str();
49 }
50 
51 const char *
52 ThreadSpec::GetQueueName () const
53 {
54     if (m_queue_name.empty())
55         return NULL;
56     else
57         return m_queue_name.c_str();
58 }
59