blob: a98ce0e0d1fe9baf5601a17feb608d4f6c42f313 [file] [log] [blame]
Chris Lattner24943d22010-06-08 16:52:24 +00001//===-- SBBreakpoint.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/SBBreakpoint.h"
11#include "lldb/API/SBBreakpointLocation.h"
12#include "lldb/API/SBDebugger.h"
Greg Claytonc7f5d5c2010-07-23 23:33:17 +000013#include "lldb/API/SBEvent.h"
Chris Lattner24943d22010-06-08 16:52:24 +000014#include "lldb/API/SBProcess.h"
Caroline Tice98f930f2010-09-20 05:20:02 +000015#include "lldb/API/SBStream.h"
Chris Lattner24943d22010-06-08 16:52:24 +000016#include "lldb/API/SBThread.h"
17
18#include "lldb/Breakpoint/Breakpoint.h"
19#include "lldb/Breakpoint/BreakpointLocation.h"
20#include "lldb/Breakpoint/StoppointCallbackContext.h"
21#include "lldb/Core/Address.h"
Caroline Tice7826c882010-10-26 03:11:13 +000022#include "lldb/Core/Log.h"
Chris Lattner24943d22010-06-08 16:52:24 +000023#include "lldb/Core/Stream.h"
24#include "lldb/Core/StreamFile.h"
25#include "lldb/Target/Process.h"
Chris Lattner24943d22010-06-08 16:52:24 +000026#include "lldb/Target/Target.h"
Jim Ingham8e5e38f2010-06-18 01:47:08 +000027#include "lldb/Target/Thread.h"
28#include "lldb/Target/ThreadSpec.h"
Chris Lattner24943d22010-06-08 16:52:24 +000029
30
31#include "lldb/lldb-enumerations.h"
32
33using namespace lldb;
34using namespace lldb_private;
35
36struct CallbackData
37{
38 SBBreakpoint::BreakpointHitCallback callback;
39 void *callback_baton;
40};
41
42class SBBreakpointCallbackBaton : public Baton
43{
44public:
45
46 SBBreakpointCallbackBaton (SBBreakpoint::BreakpointHitCallback callback, void *baton) :
47 Baton (new CallbackData)
48 {
49 CallbackData *data = (CallbackData *)m_data;
50 data->callback = callback;
51 data->callback_baton = baton;
52 }
53
54 virtual ~SBBreakpointCallbackBaton()
55 {
56 CallbackData *data = (CallbackData *)m_data;
57
58 if (data)
59 {
60 delete data;
61 m_data = NULL;
62 }
63 }
64};
65
66
67SBBreakpoint::SBBreakpoint () :
Greg Clayton63094e02010-06-23 01:19:29 +000068 m_opaque_sp ()
Chris Lattner24943d22010-06-08 16:52:24 +000069{
Caroline Tice7826c882010-10-26 03:11:13 +000070 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
71
72 if (log)
73 log->Printf ("SBBreakpoint::SBBreakpoint () ==> this = %p", this);
Chris Lattner24943d22010-06-08 16:52:24 +000074}
75
76SBBreakpoint::SBBreakpoint (const SBBreakpoint& rhs) :
Greg Clayton63094e02010-06-23 01:19:29 +000077 m_opaque_sp (rhs.m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +000078{
Caroline Tice7826c882010-10-26 03:11:13 +000079 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
80
81 if (log)
82 {
83 SBStream sstr;
84 GetDescription (sstr);
85 log->Printf ("SBBreakpoint::SBBreakpoint (const SBBreakpoint &rhs) rhs.m_opaque_ap.get() = %p ==> this = %p (%s)",
86 rhs.m_opaque_sp.get(), this, sstr.GetData());
87 }
Chris Lattner24943d22010-06-08 16:52:24 +000088}
89
90
91SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) :
Greg Clayton63094e02010-06-23 01:19:29 +000092 m_opaque_sp (bp_sp)
Chris Lattner24943d22010-06-08 16:52:24 +000093{
Caroline Tice7826c882010-10-26 03:11:13 +000094 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API | LIBLLDB_LOG_VERBOSE);
95
96 if (log)
97 {
98 SBStream sstr;
99 GetDescription (sstr);
100 log->Printf("SBBreakpoint::SBBreakpoint (const lldb::BreakpointSP &bp_sp) bp_sp.get() = %p ==> this = %p (%s)",
101 bp_sp.get(), this, sstr.GetData());
102 }
Chris Lattner24943d22010-06-08 16:52:24 +0000103}
104
105SBBreakpoint::~SBBreakpoint()
106{
107}
108
109const SBBreakpoint &
110SBBreakpoint::operator = (const SBBreakpoint& rhs)
111{
Caroline Tice7826c882010-10-26 03:11:13 +0000112 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
113
114 if (log)
115 log->Printf ("SBBreakpoint::operator=");
116
Chris Lattner24943d22010-06-08 16:52:24 +0000117 if (this != &rhs)
118 {
Greg Clayton63094e02010-06-23 01:19:29 +0000119 m_opaque_sp = rhs.m_opaque_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000120 }
Caroline Tice7826c882010-10-26 03:11:13 +0000121
122 if (log)
123 log->Printf ("SBBreakpoint::operator= (const SBBreakpoint &rhs) rhs.m_opaque_sp.get() = %p ==> this = %p",
124 rhs.m_opaque_sp.get(), this);
125
Chris Lattner24943d22010-06-08 16:52:24 +0000126 return *this;
127}
128
129break_id_t
130SBBreakpoint::GetID () const
131{
Caroline Tice7826c882010-10-26 03:11:13 +0000132 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
133
134 if (log)
135 log->Printf ("SBBreakpoint::GetID");
136
Greg Clayton63094e02010-06-23 01:19:29 +0000137 if (m_opaque_sp)
Caroline Tice7826c882010-10-26 03:11:13 +0000138 {
139 break_id_t id = m_opaque_sp->GetID();
140 if (log)
141 log->Printf ("SBBreakpoint::GetID ==> %d", id);
142 return id;
143 }
144
145 if (log)
146 log->Printf ("SBBreakpoint::GetID ==> LLDB_INVALID_BREAK_ID");
147
Chris Lattner24943d22010-06-08 16:52:24 +0000148 return LLDB_INVALID_BREAK_ID;
149}
150
151
152bool
153SBBreakpoint::IsValid() const
154{
Greg Clayton63094e02010-06-23 01:19:29 +0000155 return m_opaque_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000156}
157
158void
Chris Lattner24943d22010-06-08 16:52:24 +0000159SBBreakpoint::ClearAllBreakpointSites ()
160{
Greg Clayton63094e02010-06-23 01:19:29 +0000161 if (m_opaque_sp)
162 m_opaque_sp->ClearAllBreakpointSites ();
Chris Lattner24943d22010-06-08 16:52:24 +0000163}
164
165SBBreakpointLocation
166SBBreakpoint::FindLocationByAddress (addr_t vm_addr)
167{
168 SBBreakpointLocation sb_bp_location;
169
Greg Clayton63094e02010-06-23 01:19:29 +0000170 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000171 {
172 if (vm_addr != LLDB_INVALID_ADDRESS)
173 {
174 Address address;
Greg Claytoneea26402010-09-14 23:36:40 +0000175 Target &target = m_opaque_sp->GetTarget();
176 if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
Chris Lattner24943d22010-06-08 16:52:24 +0000177 {
178 address.SetSection (NULL);
179 address.SetOffset (vm_addr);
180 }
Greg Clayton63094e02010-06-23 01:19:29 +0000181 sb_bp_location.SetLocation (m_opaque_sp->FindLocationByAddress (address));
Chris Lattner24943d22010-06-08 16:52:24 +0000182 }
183 }
184 return sb_bp_location;
185}
186
187break_id_t
188SBBreakpoint::FindLocationIDByAddress (addr_t vm_addr)
189{
190 break_id_t lldb_id = (break_id_t) 0;
191
Greg Clayton63094e02010-06-23 01:19:29 +0000192 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000193 {
194 if (vm_addr != LLDB_INVALID_ADDRESS)
195 {
196 Address address;
Greg Claytoneea26402010-09-14 23:36:40 +0000197 Target &target = m_opaque_sp->GetTarget();
198 if (target.GetSectionLoadList().ResolveLoadAddress (vm_addr, address) == false)
Chris Lattner24943d22010-06-08 16:52:24 +0000199 {
200 address.SetSection (NULL);
201 address.SetOffset (vm_addr);
202 }
Greg Clayton63094e02010-06-23 01:19:29 +0000203 lldb_id = m_opaque_sp->FindLocationIDByAddress (address);
Chris Lattner24943d22010-06-08 16:52:24 +0000204 }
205 }
206
207 return lldb_id;
208}
209
210SBBreakpointLocation
211SBBreakpoint::FindLocationByID (break_id_t bp_loc_id)
212{
213 SBBreakpointLocation sb_bp_location;
214
Greg Clayton63094e02010-06-23 01:19:29 +0000215 if (m_opaque_sp)
216 sb_bp_location.SetLocation (m_opaque_sp->FindLocationByID (bp_loc_id));
Chris Lattner24943d22010-06-08 16:52:24 +0000217
218 return sb_bp_location;
219}
220
221SBBreakpointLocation
222SBBreakpoint::GetLocationAtIndex (uint32_t index)
223{
224 SBBreakpointLocation sb_bp_location;
225
Greg Clayton63094e02010-06-23 01:19:29 +0000226 if (m_opaque_sp)
227 sb_bp_location.SetLocation (m_opaque_sp->GetLocationAtIndex (index));
Chris Lattner24943d22010-06-08 16:52:24 +0000228
229 return sb_bp_location;
230}
231
232void
Chris Lattner24943d22010-06-08 16:52:24 +0000233SBBreakpoint::SetEnabled (bool enable)
234{
Caroline Tice7826c882010-10-26 03:11:13 +0000235 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
236
237 if (log)
238 log->Printf ("SBBreakpoint::SetEnabled (%s)", (enable ? "true" : "false"));
239
Greg Clayton63094e02010-06-23 01:19:29 +0000240 if (m_opaque_sp)
241 m_opaque_sp->SetEnabled (enable);
Chris Lattner24943d22010-06-08 16:52:24 +0000242}
243
244bool
245SBBreakpoint::IsEnabled ()
246{
Greg Clayton63094e02010-06-23 01:19:29 +0000247 if (m_opaque_sp)
248 return m_opaque_sp->IsEnabled();
Chris Lattner24943d22010-06-08 16:52:24 +0000249 else
250 return false;
251}
252
253void
Greg Clayton54e7afa2010-07-09 20:39:50 +0000254SBBreakpoint::SetIgnoreCount (uint32_t count)
Chris Lattner24943d22010-06-08 16:52:24 +0000255{
Caroline Tice7826c882010-10-26 03:11:13 +0000256 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
257
258 if (log)
259 log->Printf ("SBBreakpoint::SetIgnoreCount (%d)", count);
260
Greg Clayton63094e02010-06-23 01:19:29 +0000261 if (m_opaque_sp)
262 m_opaque_sp->SetIgnoreCount (count);
Chris Lattner24943d22010-06-08 16:52:24 +0000263}
264
Jim Inghame3740832010-10-22 01:15:49 +0000265void
266SBBreakpoint::SetCondition (const char *condition)
267{
268 m_opaque_sp->SetCondition (condition);
269}
270
271const char *
272SBBreakpoint::GetCondition ()
273{
274 return m_opaque_sp->GetConditionText ();
275}
276
Greg Clayton54e7afa2010-07-09 20:39:50 +0000277uint32_t
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000278SBBreakpoint::GetHitCount () const
279{
Caroline Tice7826c882010-10-26 03:11:13 +0000280 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
281
282 if (log)
283 log->Printf ("SBBreakpoint::GetHitCount");
284
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000285 if (m_opaque_sp)
Caroline Tice7826c882010-10-26 03:11:13 +0000286 {
287 uint32_t hit_count = m_opaque_sp->GetHitCount();
288 if (log)
289 log->Printf ("SBBreakpoint::GetHitCount ==> %d", hit_count);
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000290 return m_opaque_sp->GetHitCount();
Caroline Tice7826c882010-10-26 03:11:13 +0000291 }
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000292 else
Caroline Tice7826c882010-10-26 03:11:13 +0000293 {
294 if (log)
295 log->Printf ("SBBreakpoint::GetHitCount ==> 0");
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000296 return 0;
Caroline Tice7826c882010-10-26 03:11:13 +0000297 }
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000298}
299
300uint32_t
Chris Lattner24943d22010-06-08 16:52:24 +0000301SBBreakpoint::GetIgnoreCount () const
302{
Greg Clayton63094e02010-06-23 01:19:29 +0000303 if (m_opaque_sp)
304 return m_opaque_sp->GetIgnoreCount();
Chris Lattner24943d22010-06-08 16:52:24 +0000305 else
306 return 0;
307}
308
309void
310SBBreakpoint::SetThreadID (tid_t sb_thread_id)
311{
Greg Clayton63094e02010-06-23 01:19:29 +0000312 if (m_opaque_sp)
313 m_opaque_sp->SetThreadID (sb_thread_id);
Chris Lattner24943d22010-06-08 16:52:24 +0000314}
315
316tid_t
317SBBreakpoint::GetThreadID ()
318{
319 tid_t lldb_thread_id = LLDB_INVALID_THREAD_ID;
Greg Clayton63094e02010-06-23 01:19:29 +0000320 if (m_opaque_sp)
321 lldb_thread_id = m_opaque_sp->GetThreadID();
Chris Lattner24943d22010-06-08 16:52:24 +0000322
323 return lldb_thread_id;
324}
325
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000326void
327SBBreakpoint::SetThreadIndex (uint32_t index)
328{
Greg Clayton63094e02010-06-23 01:19:29 +0000329 if (m_opaque_sp)
330 m_opaque_sp->GetOptions()->GetThreadSpec()->SetIndex (index);
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000331}
332
333uint32_t
334SBBreakpoint::GetThreadIndex() const
335{
Greg Clayton63094e02010-06-23 01:19:29 +0000336 if (m_opaque_sp)
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000337 {
Greg Clayton63094e02010-06-23 01:19:29 +0000338 const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000339 if (thread_spec == NULL)
340 return 0;
341 else
342 return thread_spec->GetIndex();
343 }
344 return 0;
345}
346
347
348void
349SBBreakpoint::SetThreadName (const char *thread_name)
350{
Greg Clayton63094e02010-06-23 01:19:29 +0000351 if (m_opaque_sp)
352 m_opaque_sp->GetOptions()->GetThreadSpec()->SetName (thread_name);
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000353}
354
355const char *
356SBBreakpoint::GetThreadName () const
357{
Greg Clayton63094e02010-06-23 01:19:29 +0000358 if (m_opaque_sp)
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000359 {
Greg Clayton63094e02010-06-23 01:19:29 +0000360 const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000361 if (thread_spec == NULL)
362 return NULL;
363 else
364 return thread_spec->GetName();
365 }
366 return NULL;
367}
368
369void
370SBBreakpoint::SetQueueName (const char *queue_name)
371{
Greg Clayton63094e02010-06-23 01:19:29 +0000372 if (m_opaque_sp)
373 m_opaque_sp->GetOptions()->GetThreadSpec()->SetQueueName (queue_name);
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000374}
375
376const char *
377SBBreakpoint::GetQueueName () const
378{
Greg Clayton63094e02010-06-23 01:19:29 +0000379 if (m_opaque_sp)
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000380 {
Greg Clayton63094e02010-06-23 01:19:29 +0000381 const ThreadSpec *thread_spec = m_opaque_sp->GetOptions()->GetThreadSpec();
Jim Ingham8e5e38f2010-06-18 01:47:08 +0000382 if (thread_spec == NULL)
383 return NULL;
384 else
385 return thread_spec->GetQueueName();
386 }
387 return NULL;
388}
389
Chris Lattner24943d22010-06-08 16:52:24 +0000390size_t
391SBBreakpoint::GetNumResolvedLocations() const
392{
Greg Clayton63094e02010-06-23 01:19:29 +0000393 if (m_opaque_sp)
394 return m_opaque_sp->GetNumResolvedLocations();
Chris Lattner24943d22010-06-08 16:52:24 +0000395 else
396 return 0;
397}
398
399size_t
400SBBreakpoint::GetNumLocations() const
401{
Greg Clayton63094e02010-06-23 01:19:29 +0000402 if (m_opaque_sp)
403 return m_opaque_sp->GetNumLocations();
Chris Lattner24943d22010-06-08 16:52:24 +0000404 else
405 return 0;
406}
407
Caroline Tice98f930f2010-09-20 05:20:02 +0000408bool
Greg Claytond8c62532010-10-07 04:19:01 +0000409SBBreakpoint::GetDescription (SBStream &s)
Chris Lattner24943d22010-06-08 16:52:24 +0000410{
Greg Clayton63094e02010-06-23 01:19:29 +0000411 if (m_opaque_sp)
Chris Lattner24943d22010-06-08 16:52:24 +0000412 {
Greg Claytond8c62532010-10-07 04:19:01 +0000413 s.Printf("SBBreakpoint: id = %i, ", m_opaque_sp->GetID());
414 m_opaque_sp->GetResolverDescription (s.get());
415 m_opaque_sp->GetFilterDescription (s.get());
416 const size_t num_locations = m_opaque_sp->GetNumLocations ();
417 s.Printf(", locations = %zu", num_locations);
418 return true;
Chris Lattner24943d22010-06-08 16:52:24 +0000419 }
Greg Claytond8c62532010-10-07 04:19:01 +0000420 s.Printf ("No value");
421 return false;
Caroline Tice98f930f2010-09-20 05:20:02 +0000422}
423
Chris Lattner24943d22010-06-08 16:52:24 +0000424bool
425SBBreakpoint::PrivateBreakpointHitCallback
426(
427 void *baton,
428 StoppointCallbackContext *ctx,
429 lldb::user_id_t break_id,
430 lldb::user_id_t break_loc_id
431)
432{
Greg Clayton63094e02010-06-23 01:19:29 +0000433 BreakpointSP bp_sp(ctx->exe_ctx.target->GetBreakpointList().FindBreakpointByID(break_id));
Chris Lattner24943d22010-06-08 16:52:24 +0000434 if (baton && bp_sp)
435 {
436 CallbackData *data = (CallbackData *)baton;
437 lldb_private::Breakpoint *bp = bp_sp.get();
438 if (bp && data->callback)
439 {
Greg Clayton63094e02010-06-23 01:19:29 +0000440 if (ctx->exe_ctx.process)
Chris Lattner24943d22010-06-08 16:52:24 +0000441 {
Greg Clayton63094e02010-06-23 01:19:29 +0000442 SBProcess sb_process (ctx->exe_ctx.process->GetSP());
Chris Lattner24943d22010-06-08 16:52:24 +0000443 SBThread sb_thread;
444 SBBreakpointLocation sb_location;
445 assert (bp_sp);
446 sb_location.SetLocation (bp_sp->FindLocationByID (break_loc_id));
Greg Clayton63094e02010-06-23 01:19:29 +0000447 if (ctx->exe_ctx.thread)
448 sb_thread.SetThread(ctx->exe_ctx.thread->GetSP());
Chris Lattner24943d22010-06-08 16:52:24 +0000449
450 return data->callback (data->callback_baton,
451 sb_process,
452 sb_thread,
453 sb_location);
454 }
455 }
456 }
457 return true; // Return true if we should stop at this breakpoint
458}
459
460void
461SBBreakpoint::SetCallback (BreakpointHitCallback callback, void *baton)
462{
Caroline Tice7826c882010-10-26 03:11:13 +0000463 Log *log = lldb_private::GetLogIfAllCategoriesSet (LIBLLDB_LOG_API);
464
465 if (log)
466 log->Printf ("SBBreakpoint::SetCallback :");
467
Greg Clayton63094e02010-06-23 01:19:29 +0000468 if (m_opaque_sp.get())
Chris Lattner24943d22010-06-08 16:52:24 +0000469 {
470 BatonSP baton_sp(new SBBreakpointCallbackBaton (callback, baton));
Caroline Tice7826c882010-10-26 03:11:13 +0000471 if (log)
472 {
473 // CAROLINE: FIXME!!
474 //StreamString sstr;
475 //baton_sp->GetDescription (sstr, lldb::eDescriptionLevelFull);
476 //log->Printf ("%s", sstr.GetData());
477 }
Greg Clayton63094e02010-06-23 01:19:29 +0000478 m_opaque_sp->SetCallback (SBBreakpoint::PrivateBreakpointHitCallback, baton_sp, false);
Chris Lattner24943d22010-06-08 16:52:24 +0000479 }
480}
481
482
483lldb_private::Breakpoint *
484SBBreakpoint::operator->() const
485{
Greg Clayton63094e02010-06-23 01:19:29 +0000486 return m_opaque_sp.get();
Chris Lattner24943d22010-06-08 16:52:24 +0000487}
488
489lldb_private::Breakpoint *
490SBBreakpoint::get() const
491{
Greg Clayton63094e02010-06-23 01:19:29 +0000492 return m_opaque_sp.get();
Chris Lattner24943d22010-06-08 16:52:24 +0000493}
494
495lldb::BreakpointSP &
496SBBreakpoint::operator *()
497{
Greg Clayton63094e02010-06-23 01:19:29 +0000498 return m_opaque_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000499}
500
501const lldb::BreakpointSP &
502SBBreakpoint::operator *() const
503{
Greg Clayton63094e02010-06-23 01:19:29 +0000504 return m_opaque_sp;
Chris Lattner24943d22010-06-08 16:52:24 +0000505}
506
Greg Claytonc7f5d5c2010-07-23 23:33:17 +0000507BreakpointEventType
508SBBreakpoint::GetBreakpointEventTypeFromEvent (const SBEvent& event)
509{
510 if (event.IsValid())
511 return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent (event.GetSP());
512 return eBreakpointEventTypeInvalidType;
513}
514
515SBBreakpoint
516SBBreakpoint::GetBreakpointFromEvent (const lldb::SBEvent& event)
517{
518 SBBreakpoint sb_breakpoint;
519 if (event.IsValid())
520 sb_breakpoint.m_opaque_sp = Breakpoint::BreakpointEventData::GetBreakpointFromEvent (event.GetSP());
521 return sb_breakpoint;
522}
523
524SBBreakpointLocation
525SBBreakpoint::GetBreakpointLocationAtIndexFromEvent (const lldb::SBEvent& event, uint32_t loc_idx)
526{
527 SBBreakpointLocation sb_breakpoint_loc;
528 if (event.IsValid())
529 sb_breakpoint_loc.SetLocation (Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent (event.GetSP(), loc_idx));
530 return sb_breakpoint_loc;
531}
532
533