Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 1 | //===-- SBBreakpointLocation.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/API/SBBreakpointLocation.h" | ||||
11 | #include "lldb/API/SBDefines.h" | ||||
Greg Clayton | 980c750 | 2011-09-24 01:37:21 +0000 | [diff] [blame] | 12 | #include "lldb/API/SBAddress.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 13 | #include "lldb/API/SBDebugger.h" |
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 14 | #include "lldb/API/SBStream.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 15 | |
16 | #include "lldb/lldb-types.h" | ||||
17 | #include "lldb/lldb-defines.h" | ||||
Greg Clayton | 640dc6b | 2010-11-18 18:52:36 +0000 | [diff] [blame] | 18 | #include "lldb/Breakpoint/Breakpoint.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 19 | #include "lldb/Breakpoint/BreakpointLocation.h" |
Jim Ingham | 3c7b5b9 | 2010-06-16 02:00:15 +0000 | [diff] [blame] | 20 | #include "lldb/Target/ThreadSpec.h" |
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 21 | #include "lldb/Core/Log.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 22 | #include "lldb/Core/Stream.h" |
23 | #include "lldb/Core/StreamFile.h" | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 24 | #include "lldb/Target/Target.h" |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 25 | #include "lldb/Target/ThreadSpec.h" |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 26 | |
27 | using namespace lldb; | ||||
28 | using namespace lldb_private; | ||||
29 | |||||
30 | |||||
Greg Clayton | 538eb82 | 2010-11-05 23:17:00 +0000 | [diff] [blame] | 31 | SBBreakpointLocation::SBBreakpointLocation () : |
32 | m_opaque_sp () | ||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 33 | { |
34 | } | ||||
35 | |||||
36 | SBBreakpointLocation::SBBreakpointLocation (const lldb::BreakpointLocationSP &break_loc_sp) : | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 37 | m_opaque_sp (break_loc_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 38 | { |
Greg Clayton | 952e9dc | 2013-03-27 23:08:40 +0000 | [diff] [blame] | 39 | Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); |
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 40 | |
41 | if (log) | ||||
42 | { | ||||
43 | SBStream sstr; | ||||
Johnny Chen | bdc36bd | 2011-04-25 20:23:05 +0000 | [diff] [blame] | 44 | GetDescription (sstr, lldb::eDescriptionLevelBrief); |
Caroline Tice | 61ba7ec | 2010-10-26 23:49:36 +0000 | [diff] [blame] | 45 | log->Printf ("SBBreakpointLocation::SBBreakpointLocaiton (const lldb::BreakpointLocationsSP &break_loc_sp" |
46 | "=%p) => this.sp = %p (%s)", break_loc_sp.get(), m_opaque_sp.get(), sstr.GetData()); | ||||
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 47 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 48 | } |
49 | |||||
Greg Clayton | 538eb82 | 2010-11-05 23:17:00 +0000 | [diff] [blame] | 50 | SBBreakpointLocation::SBBreakpointLocation(const SBBreakpointLocation &rhs) : |
51 | m_opaque_sp (rhs.m_opaque_sp) | ||||
52 | { | ||||
53 | } | ||||
54 | |||||
55 | const SBBreakpointLocation & | ||||
56 | SBBreakpointLocation::operator = (const SBBreakpointLocation &rhs) | ||||
57 | { | ||||
58 | if (this != &rhs) | ||||
59 | m_opaque_sp = rhs.m_opaque_sp; | ||||
60 | return *this; | ||||
61 | } | ||||
62 | |||||
63 | |||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 64 | SBBreakpointLocation::~SBBreakpointLocation () |
65 | { | ||||
66 | } | ||||
67 | |||||
68 | bool | ||||
69 | SBBreakpointLocation::IsValid() const | ||||
70 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 71 | return m_opaque_sp.get() != NULL; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 72 | } |
73 | |||||
Jim Ingham | 9a29f00 | 2011-09-24 01:04:57 +0000 | [diff] [blame] | 74 | SBAddress |
75 | SBBreakpointLocation::GetAddress () | ||||
76 | { | ||||
77 | if (m_opaque_sp) | ||||
78 | return SBAddress(&m_opaque_sp->GetAddress()); | ||||
79 | else | ||||
80 | return SBAddress(); | ||||
81 | } | ||||
82 | |||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 83 | addr_t |
84 | SBBreakpointLocation::GetLoadAddress () | ||||
85 | { | ||||
86 | addr_t ret_addr = LLDB_INVALID_ADDRESS; | ||||
87 | |||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 88 | if (m_opaque_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 89 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 90 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 91 | ret_addr = m_opaque_sp->GetLoadAddress(); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 92 | } |
93 | |||||
94 | return ret_addr; | ||||
95 | } | ||||
96 | |||||
97 | void | ||||
98 | SBBreakpointLocation::SetEnabled (bool enabled) | ||||
99 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 100 | if (m_opaque_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 101 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 102 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 103 | m_opaque_sp->SetEnabled (enabled); |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 104 | } |
105 | } | ||||
106 | |||||
107 | bool | ||||
108 | SBBreakpointLocation::IsEnabled () | ||||
109 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 110 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 111 | { |
112 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 113 | return m_opaque_sp->IsEnabled(); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 114 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 115 | else |
116 | return false; | ||||
117 | } | ||||
118 | |||||
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 119 | uint32_t |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 120 | SBBreakpointLocation::GetIgnoreCount () |
121 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 122 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 123 | { |
124 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 125 | return m_opaque_sp->GetIgnoreCount(); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 126 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 127 | else |
128 | return 0; | ||||
129 | } | ||||
130 | |||||
131 | void | ||||
Greg Clayton | 54e7afa | 2010-07-09 20:39:50 +0000 | [diff] [blame] | 132 | SBBreakpointLocation::SetIgnoreCount (uint32_t n) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 133 | { |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 134 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 135 | { |
136 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 137 | m_opaque_sp->SetIgnoreCount (n); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 138 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 139 | } |
140 | |||||
141 | void | ||||
Jim Ingham | e374083 | 2010-10-22 01:15:49 +0000 | [diff] [blame] | 142 | SBBreakpointLocation::SetCondition (const char *condition) |
143 | { | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 144 | if (m_opaque_sp) |
145 | { | ||||
146 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
147 | m_opaque_sp->SetCondition (condition); | ||||
148 | } | ||||
Jim Ingham | e374083 | 2010-10-22 01:15:49 +0000 | [diff] [blame] | 149 | } |
150 | |||||
151 | const char * | ||||
152 | SBBreakpointLocation::GetCondition () | ||||
153 | { | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 154 | if (m_opaque_sp) |
155 | { | ||||
156 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
157 | return m_opaque_sp->GetConditionText (); | ||||
158 | } | ||||
159 | return NULL; | ||||
Jim Ingham | e374083 | 2010-10-22 01:15:49 +0000 | [diff] [blame] | 160 | } |
161 | |||||
162 | void | ||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 163 | SBBreakpointLocation::SetThreadID (tid_t thread_id) |
164 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 165 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 166 | { |
167 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 168 | m_opaque_sp->SetThreadID (thread_id); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 169 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 170 | } |
171 | |||||
172 | tid_t | ||||
173 | SBBreakpointLocation::GetThreadID () | ||||
174 | { | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 175 | tid_t tid = LLDB_INVALID_THREAD_ID; |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 176 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 177 | { |
178 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 179 | return m_opaque_sp->GetThreadID(); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 180 | } |
181 | return tid; | ||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 182 | } |
183 | |||||
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 184 | void |
185 | SBBreakpointLocation::SetThreadIndex (uint32_t index) | ||||
186 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 187 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 188 | { |
189 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 190 | m_opaque_sp->SetThreadIndex (index); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 191 | } |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 192 | } |
193 | |||||
194 | uint32_t | ||||
195 | SBBreakpointLocation::GetThreadIndex() const | ||||
196 | { | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 197 | uint32_t thread_idx = UINT32_MAX; |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 198 | if (m_opaque_sp) |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 199 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 200 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 201 | return m_opaque_sp->GetThreadIndex(); |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 202 | } |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 203 | return thread_idx; |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 204 | } |
205 | |||||
206 | |||||
207 | void | ||||
208 | SBBreakpointLocation::SetThreadName (const char *thread_name) | ||||
209 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 210 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 211 | { |
212 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 213 | m_opaque_sp->SetThreadName (thread_name); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 214 | } |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 215 | } |
216 | |||||
217 | const char * | ||||
218 | SBBreakpointLocation::GetThreadName () const | ||||
219 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 220 | if (m_opaque_sp) |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 221 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 222 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 223 | return m_opaque_sp->GetThreadName(); |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 224 | } |
225 | return NULL; | ||||
226 | } | ||||
227 | |||||
228 | void | ||||
229 | SBBreakpointLocation::SetQueueName (const char *queue_name) | ||||
230 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 231 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 232 | { |
233 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 234 | m_opaque_sp->SetQueueName (queue_name); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 235 | } |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 236 | } |
237 | |||||
238 | const char * | ||||
239 | SBBreakpointLocation::GetQueueName () const | ||||
240 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 241 | if (m_opaque_sp) |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 242 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 243 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Jim Ingham | 28e2386 | 2012-02-08 05:23:15 +0000 | [diff] [blame] | 244 | m_opaque_sp->GetQueueName (); |
Jim Ingham | 8e5e38f | 2010-06-18 01:47:08 +0000 | [diff] [blame] | 245 | } |
246 | return NULL; | ||||
247 | } | ||||
248 | |||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 249 | bool |
250 | SBBreakpointLocation::IsResolved () | ||||
251 | { | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 252 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 253 | { |
254 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 255 | return m_opaque_sp->IsResolved(); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 256 | } |
257 | return false; | ||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 258 | } |
259 | |||||
260 | void | ||||
261 | SBBreakpointLocation::SetLocation (const lldb::BreakpointLocationSP &break_loc_sp) | ||||
262 | { | ||||
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 263 | // Uninstall the callbacks? |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 264 | m_opaque_sp = break_loc_sp; |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 265 | } |
266 | |||||
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 267 | bool |
Johnny Chen | bdc36bd | 2011-04-25 20:23:05 +0000 | [diff] [blame] | 268 | SBBreakpointLocation::GetDescription (SBStream &description, DescriptionLevel level) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 269 | { |
Greg Clayton | 96154be | 2011-11-13 06:57:31 +0000 | [diff] [blame] | 270 | Stream &strm = description.ref(); |
271 | |||||
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 272 | if (m_opaque_sp) |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 273 | { |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 274 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); |
Greg Clayton | 96154be | 2011-11-13 06:57:31 +0000 | [diff] [blame] | 275 | m_opaque_sp->GetDescription (&strm, level); |
276 | strm.EOL(); | ||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 277 | } |
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 278 | else |
Greg Clayton | 96154be | 2011-11-13 06:57:31 +0000 | [diff] [blame] | 279 | strm.PutCString ("No value"); |
Caroline Tice | 98f930f | 2010-09-20 05:20:02 +0000 | [diff] [blame] | 280 | |
281 | return true; | ||||
282 | } | ||||
283 | |||||
Jim Ingham | 1c4ae3e | 2012-05-16 00:51:15 +0000 | [diff] [blame] | 284 | break_id_t |
285 | SBBreakpointLocation::GetID () | ||||
286 | { | ||||
287 | if (m_opaque_sp) | ||||
288 | { | ||||
289 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
290 | return m_opaque_sp->GetID (); | ||||
291 | } | ||||
292 | else | ||||
293 | return LLDB_INVALID_BREAK_ID; | ||||
294 | } | ||||
295 | |||||
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 296 | SBBreakpoint |
297 | SBBreakpointLocation::GetBreakpoint () | ||||
298 | { | ||||
Greg Clayton | 952e9dc | 2013-03-27 23:08:40 +0000 | [diff] [blame] | 299 | Log *log(lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API)); |
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 300 | |
Caroline Tice | 61ba7ec | 2010-10-26 23:49:36 +0000 | [diff] [blame] | 301 | //if (log) |
302 | // log->Printf ("SBBreakpointLocation::GetBreakpoint ()"); | ||||
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 303 | |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 304 | SBBreakpoint sb_bp; |
Greg Clayton | 63094e0 | 2010-06-23 01:19:29 +0000 | [diff] [blame] | 305 | if (m_opaque_sp) |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 306 | { |
307 | Mutex::Locker api_locker (m_opaque_sp->GetBreakpoint().GetTarget().GetAPIMutex()); | ||||
Greg Clayton | 13d24fb | 2012-01-29 20:56:30 +0000 | [diff] [blame] | 308 | *sb_bp = m_opaque_sp->GetBreakpoint ().shared_from_this(); |
Greg Clayton | bdcda46 | 2010-12-20 20:49:23 +0000 | [diff] [blame] | 309 | } |
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 310 | |
311 | if (log) | ||||
312 | { | ||||
313 | SBStream sstr; | ||||
314 | sb_bp.GetDescription (sstr); | ||||
Greg Clayton | 49ce682 | 2010-10-31 03:01:06 +0000 | [diff] [blame] | 315 | log->Printf ("SBBreakpointLocation(%p)::GetBreakpoint () => SBBreakpoint(%p) %s", |
Caroline Tice | 61ba7ec | 2010-10-26 23:49:36 +0000 | [diff] [blame] | 316 | m_opaque_sp.get(), sb_bp.get(), sstr.GetData()); |
Caroline Tice | 7826c88 | 2010-10-26 03:11:13 +0000 | [diff] [blame] | 317 | } |
Chris Lattner | 24943d2 | 2010-06-08 16:52:24 +0000 | [diff] [blame] | 318 | return sb_bp; |
319 | } | ||||
320 |