LLDB  mainline
SBBreakpoint.cpp
Go to the documentation of this file.
1 //===-- SBBreakpoint.cpp --------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
10 #include "SBReproducerPrivate.h"
12 #include "lldb/API/SBDebugger.h"
13 #include "lldb/API/SBEvent.h"
14 #include "lldb/API/SBProcess.h"
15 #include "lldb/API/SBStream.h"
16 #include "lldb/API/SBStringList.h"
18 #include "lldb/API/SBThread.h"
19 
26 #include "lldb/Core/Address.h"
27 #include "lldb/Core/Debugger.h"
28 #include "lldb/Core/StreamFile.h"
32 #include "lldb/Target/Process.h"
34 #include "lldb/Target/Target.h"
35 #include "lldb/Target/Thread.h"
36 #include "lldb/Target/ThreadSpec.h"
37 #include "lldb/Utility/Stream.h"
38 
40 
41 #include "lldb/lldb-enumerations.h"
42 
43 #include "llvm/ADT/STLExtras.h"
44 
45 using namespace lldb;
46 using namespace lldb_private;
47 
49 
51  : m_opaque_wp(rhs.m_opaque_wp) {
53 }
54 
55 SBBreakpoint::SBBreakpoint(const lldb::BreakpointSP &bp_sp)
56  : m_opaque_wp(bp_sp) {
57  LLDB_RECORD_CONSTRUCTOR(SBBreakpoint, (const lldb::BreakpointSP &), bp_sp);
58 }
59 
60 SBBreakpoint::~SBBreakpoint() = default;
61 
64  SBBreakpoint, operator=,(const lldb::SBBreakpoint &), rhs);
65 
67  return LLDB_RECORD_RESULT(*this);
68 }
69 
72  bool, SBBreakpoint, operator==,(const lldb::SBBreakpoint &), rhs);
73 
74  return m_opaque_wp.lock() == rhs.m_opaque_wp.lock();
75 }
76 
79  bool, SBBreakpoint, operator!=,(const lldb::SBBreakpoint &), rhs);
80 
81  return m_opaque_wp.lock() != rhs.m_opaque_wp.lock();
82 }
83 
86 
87  BreakpointSP bkpt_sp = GetSP();
88  if (bkpt_sp)
89  return LLDB_RECORD_RESULT(SBTarget(bkpt_sp->GetTargetSP()));
90 
91  return LLDB_RECORD_RESULT(SBTarget());
92 }
93 
96 
98  BreakpointSP bkpt_sp = GetSP();
99  if (bkpt_sp)
100  break_id = bkpt_sp->GetID();
101 
102  return break_id;
103 }
104 
105 bool SBBreakpoint::IsValid() const {
107  return this->operator bool();
108 }
109 SBBreakpoint::operator bool() const {
110  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBBreakpoint, operator bool);
111 
112  BreakpointSP bkpt_sp = GetSP();
113  if (!bkpt_sp)
114  return false;
115  else if (bkpt_sp->GetTarget().GetBreakpointByID(bkpt_sp->GetID()))
116  return true;
117  else
118  return false;
119 }
120 
123 
124  BreakpointSP bkpt_sp = GetSP();
125  if (bkpt_sp) {
126  std::lock_guard<std::recursive_mutex> guard(
127  bkpt_sp->GetTarget().GetAPIMutex());
128  bkpt_sp->ClearAllBreakpointSites();
129  }
130 }
131 
134  FindLocationByAddress, (lldb::addr_t), vm_addr);
135 
136  SBBreakpointLocation sb_bp_location;
137 
138  BreakpointSP bkpt_sp = GetSP();
139  if (bkpt_sp) {
140  if (vm_addr != LLDB_INVALID_ADDRESS) {
141  std::lock_guard<std::recursive_mutex> guard(
142  bkpt_sp->GetTarget().GetAPIMutex());
143  Address address;
144  Target &target = bkpt_sp->GetTarget();
145  if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
146  address.SetRawAddress(vm_addr);
147  }
148  sb_bp_location.SetLocation(bkpt_sp->FindLocationByAddress(address));
149  }
150  }
151  return LLDB_RECORD_RESULT(sb_bp_location);
152 }
153 
156  (lldb::addr_t), vm_addr);
157 
159  BreakpointSP bkpt_sp = GetSP();
160 
161  if (bkpt_sp && vm_addr != LLDB_INVALID_ADDRESS) {
162  std::lock_guard<std::recursive_mutex> guard(
163  bkpt_sp->GetTarget().GetAPIMutex());
164  Address address;
165  Target &target = bkpt_sp->GetTarget();
166  if (!target.GetSectionLoadList().ResolveLoadAddress(vm_addr, address)) {
167  address.SetRawAddress(vm_addr);
168  }
169  break_id = bkpt_sp->FindLocationIDByAddress(address);
170  }
171 
172  return break_id;
173 }
174 
177  (lldb::break_id_t), bp_loc_id);
178 
179  SBBreakpointLocation sb_bp_location;
180  BreakpointSP bkpt_sp = GetSP();
181 
182  if (bkpt_sp) {
183  std::lock_guard<std::recursive_mutex> guard(
184  bkpt_sp->GetTarget().GetAPIMutex());
185  sb_bp_location.SetLocation(bkpt_sp->FindLocationByID(bp_loc_id));
186  }
187 
188  return LLDB_RECORD_RESULT(sb_bp_location);
189 }
190 
193  GetLocationAtIndex, (uint32_t), index);
194 
195  SBBreakpointLocation sb_bp_location;
196  BreakpointSP bkpt_sp = GetSP();
197 
198  if (bkpt_sp) {
199  std::lock_guard<std::recursive_mutex> guard(
200  bkpt_sp->GetTarget().GetAPIMutex());
201  sb_bp_location.SetLocation(bkpt_sp->GetLocationAtIndex(index));
202  }
203 
204  return LLDB_RECORD_RESULT(sb_bp_location);
205 }
206 
207 void SBBreakpoint::SetEnabled(bool enable) {
208  LLDB_RECORD_METHOD(void, SBBreakpoint, SetEnabled, (bool), enable);
209 
210  BreakpointSP bkpt_sp = GetSP();
211 
212  if (bkpt_sp) {
213  std::lock_guard<std::recursive_mutex> guard(
214  bkpt_sp->GetTarget().GetAPIMutex());
215  bkpt_sp->SetEnabled(enable);
216  }
217 }
218 
221 
222  BreakpointSP bkpt_sp = GetSP();
223  if (bkpt_sp) {
224  std::lock_guard<std::recursive_mutex> guard(
225  bkpt_sp->GetTarget().GetAPIMutex());
226  return bkpt_sp->IsEnabled();
227  } else
228  return false;
229 }
230 
231 void SBBreakpoint::SetOneShot(bool one_shot) {
232  LLDB_RECORD_METHOD(void, SBBreakpoint, SetOneShot, (bool), one_shot);
233 
234  BreakpointSP bkpt_sp = GetSP();
235 
236  if (bkpt_sp) {
237  std::lock_guard<std::recursive_mutex> guard(
238  bkpt_sp->GetTarget().GetAPIMutex());
239  bkpt_sp->SetOneShot(one_shot);
240  }
241 }
242 
245 
246  BreakpointSP bkpt_sp = GetSP();
247  if (bkpt_sp) {
248  std::lock_guard<std::recursive_mutex> guard(
249  bkpt_sp->GetTarget().GetAPIMutex());
250  return bkpt_sp->IsOneShot();
251  } else
252  return false;
253 }
254 
257 
258  BreakpointSP bkpt_sp = GetSP();
259  if (bkpt_sp) {
260  std::lock_guard<std::recursive_mutex> guard(
261  bkpt_sp->GetTarget().GetAPIMutex());
262  return bkpt_sp->IsInternal();
263  } else
264  return false;
265 }
266 
269 
270  BreakpointSP bkpt_sp = GetSP();
271 
272  if (bkpt_sp) {
273  std::lock_guard<std::recursive_mutex> guard(
274  bkpt_sp->GetTarget().GetAPIMutex());
275  bkpt_sp->SetIgnoreCount(count);
276  }
277 }
278 
279 void SBBreakpoint::SetCondition(const char *condition) {
280  LLDB_RECORD_METHOD(void, SBBreakpoint, SetCondition, (const char *),
281  condition);
282 
283  BreakpointSP bkpt_sp = GetSP();
284  if (bkpt_sp) {
285  std::lock_guard<std::recursive_mutex> guard(
286  bkpt_sp->GetTarget().GetAPIMutex());
287  bkpt_sp->SetCondition(condition);
288  }
289 }
290 
293 
294  BreakpointSP bkpt_sp = GetSP();
295  if (bkpt_sp) {
296  std::lock_guard<std::recursive_mutex> guard(
297  bkpt_sp->GetTarget().GetAPIMutex());
298  return bkpt_sp->GetConditionText();
299  }
300  return nullptr;
301 }
302 
303 void SBBreakpoint::SetAutoContinue(bool auto_continue) {
305  auto_continue);
306 
307  BreakpointSP bkpt_sp = GetSP();
308  if (bkpt_sp) {
309  std::lock_guard<std::recursive_mutex> guard(
310  bkpt_sp->GetTarget().GetAPIMutex());
311  bkpt_sp->SetAutoContinue(auto_continue);
312  }
313 }
314 
317 
318  BreakpointSP bkpt_sp = GetSP();
319  if (bkpt_sp) {
320  std::lock_guard<std::recursive_mutex> guard(
321  bkpt_sp->GetTarget().GetAPIMutex());
322  return bkpt_sp->IsAutoContinue();
323  }
324  return false;
325 }
326 
329 
330  uint32_t count = 0;
331  BreakpointSP bkpt_sp = GetSP();
332  if (bkpt_sp) {
333  std::lock_guard<std::recursive_mutex> guard(
334  bkpt_sp->GetTarget().GetAPIMutex());
335  count = bkpt_sp->GetHitCount();
336  }
337 
338  return count;
339 }
340 
343 
344  uint32_t count = 0;
345  BreakpointSP bkpt_sp = GetSP();
346  if (bkpt_sp) {
347  std::lock_guard<std::recursive_mutex> guard(
348  bkpt_sp->GetTarget().GetAPIMutex());
349  count = bkpt_sp->GetIgnoreCount();
350  }
351 
352  return count;
353 }
354 
357 
358  BreakpointSP bkpt_sp = GetSP();
359  if (bkpt_sp) {
360  std::lock_guard<std::recursive_mutex> guard(
361  bkpt_sp->GetTarget().GetAPIMutex());
362  bkpt_sp->SetThreadID(tid);
363  }
364 }
365 
368 
370  BreakpointSP bkpt_sp = GetSP();
371  if (bkpt_sp) {
372  std::lock_guard<std::recursive_mutex> guard(
373  bkpt_sp->GetTarget().GetAPIMutex());
374  tid = bkpt_sp->GetThreadID();
375  }
376 
377  return tid;
378 }
379 
382 
383  BreakpointSP bkpt_sp = GetSP();
384  if (bkpt_sp) {
385  std::lock_guard<std::recursive_mutex> guard(
386  bkpt_sp->GetTarget().GetAPIMutex());
387  bkpt_sp->GetOptions().GetThreadSpec()->SetIndex(index);
388  }
389 }
390 
393 
394  uint32_t thread_idx = UINT32_MAX;
395  BreakpointSP bkpt_sp = GetSP();
396  if (bkpt_sp) {
397  std::lock_guard<std::recursive_mutex> guard(
398  bkpt_sp->GetTarget().GetAPIMutex());
399  const ThreadSpec *thread_spec =
400  bkpt_sp->GetOptions().GetThreadSpecNoCreate();
401  if (thread_spec != nullptr)
402  thread_idx = thread_spec->GetIndex();
403  }
404 
405  return thread_idx;
406 }
407 
408 void SBBreakpoint::SetThreadName(const char *thread_name) {
409  LLDB_RECORD_METHOD(void, SBBreakpoint, SetThreadName, (const char *),
410  thread_name);
411 
412  BreakpointSP bkpt_sp = GetSP();
413 
414  if (bkpt_sp) {
415  std::lock_guard<std::recursive_mutex> guard(
416  bkpt_sp->GetTarget().GetAPIMutex());
417  bkpt_sp->GetOptions().GetThreadSpec()->SetName(thread_name);
418  }
419 }
420 
421 const char *SBBreakpoint::GetThreadName() const {
423 
424  const char *name = nullptr;
425  BreakpointSP bkpt_sp = GetSP();
426  if (bkpt_sp) {
427  std::lock_guard<std::recursive_mutex> guard(
428  bkpt_sp->GetTarget().GetAPIMutex());
429  const ThreadSpec *thread_spec =
430  bkpt_sp->GetOptions().GetThreadSpecNoCreate();
431  if (thread_spec != nullptr)
432  name = thread_spec->GetName();
433  }
434 
435  return name;
436 }
437 
438 void SBBreakpoint::SetQueueName(const char *queue_name) {
439  LLDB_RECORD_METHOD(void, SBBreakpoint, SetQueueName, (const char *),
440  queue_name);
441 
442  BreakpointSP bkpt_sp = GetSP();
443  if (bkpt_sp) {
444  std::lock_guard<std::recursive_mutex> guard(
445  bkpt_sp->GetTarget().GetAPIMutex());
446  bkpt_sp->GetOptions().GetThreadSpec()->SetQueueName(queue_name);
447  }
448 }
449 
450 const char *SBBreakpoint::GetQueueName() const {
452 
453  const char *name = nullptr;
454  BreakpointSP bkpt_sp = GetSP();
455  if (bkpt_sp) {
456  std::lock_guard<std::recursive_mutex> guard(
457  bkpt_sp->GetTarget().GetAPIMutex());
458  const ThreadSpec *thread_spec =
459  bkpt_sp->GetOptions().GetThreadSpecNoCreate();
460  if (thread_spec)
461  name = thread_spec->GetQueueName();
462  }
463 
464  return name;
465 }
466 
470 
471  size_t num_resolved = 0;
472  BreakpointSP bkpt_sp = GetSP();
473  if (bkpt_sp) {
474  std::lock_guard<std::recursive_mutex> guard(
475  bkpt_sp->GetTarget().GetAPIMutex());
476  num_resolved = bkpt_sp->GetNumResolvedLocations();
477  }
478  return num_resolved;
479 }
480 
483 
484  BreakpointSP bkpt_sp = GetSP();
485  size_t num_locs = 0;
486  if (bkpt_sp) {
487  std::lock_guard<std::recursive_mutex> guard(
488  bkpt_sp->GetTarget().GetAPIMutex());
489  num_locs = bkpt_sp->GetNumLocations();
490  }
491  return num_locs;
492 }
493 
496  (lldb::SBStringList &), commands);
497 
498  BreakpointSP bkpt_sp = GetSP();
499  if (!bkpt_sp)
500  return;
501  if (commands.GetSize() == 0)
502  return;
503 
504  std::lock_guard<std::recursive_mutex> guard(
505  bkpt_sp->GetTarget().GetAPIMutex());
506  std::unique_ptr<BreakpointOptions::CommandData> cmd_data_up(
508 
509  bkpt_sp->GetOptions().SetCommandDataCallback(cmd_data_up);
510 }
511 
514  (lldb::SBStringList &), commands);
515 
516  BreakpointSP bkpt_sp = GetSP();
517  if (!bkpt_sp)
518  return false;
519  StringList command_list;
520  bool has_commands =
521  bkpt_sp->GetOptions().GetCommandLineCallbacks(command_list);
522  if (has_commands)
523  commands.AppendList(command_list);
524  return has_commands;
525 }
526 
529 
530  return GetDescription(s, true);
531 }
532 
533 bool SBBreakpoint::GetDescription(SBStream &s, bool include_locations) {
535  (lldb::SBStream &, bool), s, include_locations);
536 
537  BreakpointSP bkpt_sp = GetSP();
538  if (bkpt_sp) {
539  std::lock_guard<std::recursive_mutex> guard(
540  bkpt_sp->GetTarget().GetAPIMutex());
541  s.Printf("SBBreakpoint: id = %i, ", bkpt_sp->GetID());
542  bkpt_sp->GetResolverDescription(s.get());
543  bkpt_sp->GetFilterDescription(s.get());
544  if (include_locations) {
545  const size_t num_locations = bkpt_sp->GetNumLocations();
546  s.Printf(", locations = %" PRIu64, (uint64_t)num_locations);
547  }
548  return true;
549  }
550  s.Printf("No value");
551  return false;
552 }
553 
556  (lldb::SBAddress &), address);
557 
558  BreakpointSP bkpt_sp = GetSP();
559  SBError error;
560 
561  if (!address.IsValid()) {
562  error.SetErrorString("Can't add an invalid address.");
563  return LLDB_RECORD_RESULT(error);
564  }
565 
566  if (!bkpt_sp) {
567  error.SetErrorString("No breakpoint to add a location to.");
568  return LLDB_RECORD_RESULT(error);
569  }
570 
571  if (!llvm::isa<BreakpointResolverScripted>(bkpt_sp->GetResolver().get())) {
572  error.SetErrorString("Only a scripted resolver can add locations.");
573  return LLDB_RECORD_RESULT(error);
574  }
575 
576  if (bkpt_sp->GetSearchFilter()->AddressPasses(address.ref()))
577  bkpt_sp->AddLocation(address.ref());
578  else {
579  StreamString s;
580  address.get()->Dump(&s, &bkpt_sp->GetTarget(),
581  Address::DumpStyleModuleWithFileAddress);
582  error.SetErrorStringWithFormat("Address: %s didn't pass the filter.",
583  s.GetData());
584  }
585  return LLDB_RECORD_RESULT(error);
586 }
587 
591 
592  SBStructuredData data;
593  BreakpointSP bkpt_sp = GetSP();
594 
595  if (!bkpt_sp)
596  return LLDB_RECORD_RESULT(data);
597 
598  StructuredData::ObjectSP bkpt_dict = bkpt_sp->SerializeToStructuredData();
599  data.m_impl_up->SetObjectSP(bkpt_dict);
600  return LLDB_RECORD_RESULT(data);
601 }
602 
605  (lldb::SBBreakpointHitCallback, void *), callback, baton);
606 
607  BreakpointSP bkpt_sp = GetSP();
608 
609  if (bkpt_sp) {
610  std::lock_guard<std::recursive_mutex> guard(
611  bkpt_sp->GetTarget().GetAPIMutex());
612  BatonSP baton_sp(new SBBreakpointCallbackBaton(callback, baton));
613  bkpt_sp->SetCallback(SBBreakpointCallbackBaton
614  ::PrivateBreakpointHitCallback, baton_sp,
615  false);
616  }
617 }
618 
620  const char *callback_function_name) {
622  (const char *), callback_function_name);
623  SBStructuredData empty_args;
624  SetScriptCallbackFunction(callback_function_name, empty_args);
625 }
626 
628  const char *callback_function_name,
629  SBStructuredData &extra_args) {
631  (const char *, SBStructuredData &), callback_function_name, extra_args);
632  SBError sb_error;
633  BreakpointSP bkpt_sp = GetSP();
634 
635  if (bkpt_sp) {
636  Status error;
637  std::lock_guard<std::recursive_mutex> guard(
638  bkpt_sp->GetTarget().GetAPIMutex());
639  BreakpointOptions &bp_options = bkpt_sp->GetOptions();
640  error = bkpt_sp->GetTarget()
641  .GetDebugger()
642  .GetScriptInterpreter()
643  ->SetBreakpointCommandCallbackFunction(bp_options,
644  callback_function_name,
645  extra_args.m_impl_up
646  ->GetObjectSP());
647  sb_error.SetError(error);
648  } else
649  sb_error.SetErrorString("invalid breakpoint");
650 
651  return LLDB_RECORD_RESULT(sb_error);
652 }
653 
654 SBError SBBreakpoint::SetScriptCallbackBody(const char *callback_body_text) {
656  (const char *), callback_body_text);
657 
658  BreakpointSP bkpt_sp = GetSP();
659 
660  SBError sb_error;
661  if (bkpt_sp) {
662  std::lock_guard<std::recursive_mutex> guard(
663  bkpt_sp->GetTarget().GetAPIMutex());
664  BreakpointOptions &bp_options = bkpt_sp->GetOptions();
665  Status error =
666  bkpt_sp->GetTarget()
667  .GetDebugger()
668  .GetScriptInterpreter()
669  ->SetBreakpointCommandCallback(bp_options, callback_body_text);
670  sb_error.SetError(error);
671  } else
672  sb_error.SetErrorString("invalid breakpoint");
673 
674  return LLDB_RECORD_RESULT(sb_error);
675 }
676 
677 bool SBBreakpoint::AddName(const char *new_name) {
678  LLDB_RECORD_METHOD(bool, SBBreakpoint, AddName, (const char *), new_name);
679 
680  SBError status = AddNameWithErrorHandling(new_name);
681  return status.Success();
682 }
683 
686  (const char *), new_name);
687 
688  BreakpointSP bkpt_sp = GetSP();
689 
690  SBError status;
691  if (bkpt_sp) {
692  std::lock_guard<std::recursive_mutex> guard(
693  bkpt_sp->GetTarget().GetAPIMutex());
694  Status error;
695  bkpt_sp->GetTarget().AddNameToBreakpoint(bkpt_sp, new_name, error);
696  status.SetError(error);
697  } else {
698  status.SetErrorString("invalid breakpoint");
699  }
700 
701  return LLDB_RECORD_RESULT(status);
702 }
703 
704 void SBBreakpoint::RemoveName(const char *name_to_remove) {
705  LLDB_RECORD_METHOD(void, SBBreakpoint, RemoveName, (const char *),
706  name_to_remove);
707 
708  BreakpointSP bkpt_sp = GetSP();
709 
710  if (bkpt_sp) {
711  std::lock_guard<std::recursive_mutex> guard(
712  bkpt_sp->GetTarget().GetAPIMutex());
713  bkpt_sp->GetTarget().RemoveNameFromBreakpoint(bkpt_sp,
714  ConstString(name_to_remove));
715  }
716 }
717 
718 bool SBBreakpoint::MatchesName(const char *name) {
719  LLDB_RECORD_METHOD(bool, SBBreakpoint, MatchesName, (const char *), name);
720 
721  BreakpointSP bkpt_sp = GetSP();
722 
723  if (bkpt_sp) {
724  std::lock_guard<std::recursive_mutex> guard(
725  bkpt_sp->GetTarget().GetAPIMutex());
726  return bkpt_sp->MatchesName(name);
727  }
728 
729  return false;
730 }
731 
734  names);
735 
736  BreakpointSP bkpt_sp = GetSP();
737 
738  if (bkpt_sp) {
739  std::lock_guard<std::recursive_mutex> guard(
740  bkpt_sp->GetTarget().GetAPIMutex());
741  std::vector<std::string> names_vec;
742  bkpt_sp->GetNames(names_vec);
743  for (std::string name : names_vec) {
744  names.AppendString(name.c_str());
745  }
746  }
747 }
748 
751  (const lldb::SBEvent &), event);
752 
753  return Breakpoint::BreakpointEventData::GetEventDataFromEvent(event.get()) !=
754  nullptr;
755 }
756 
757 BreakpointEventType
759  LLDB_RECORD_STATIC_METHOD(lldb::BreakpointEventType, SBBreakpoint,
761  (const lldb::SBEvent &), event);
762 
763  if (event.IsValid())
764  return Breakpoint::BreakpointEventData::GetBreakpointEventTypeFromEvent(
765  event.GetSP());
766  return eBreakpointEventTypeInvalidType;
767 }
768 
772  event);
773 
774  if (event.IsValid())
775  return LLDB_RECORD_RESULT(
776  SBBreakpoint(Breakpoint::BreakpointEventData::GetBreakpointFromEvent(
777  event.GetSP())));
779 }
780 
783  uint32_t loc_idx) {
786  (const lldb::SBEvent &, uint32_t), event, loc_idx);
787 
788  SBBreakpointLocation sb_breakpoint_loc;
789  if (event.IsValid())
790  sb_breakpoint_loc.SetLocation(
791  Breakpoint::BreakpointEventData::GetBreakpointLocationAtIndexFromEvent(
792  event.GetSP(), loc_idx));
793  return LLDB_RECORD_RESULT(sb_breakpoint_loc);
794 }
795 
796 uint32_t
800  (const lldb::SBEvent &), event);
801 
802  uint32_t num_locations = 0;
803  if (event.IsValid())
804  num_locations =
805  (Breakpoint::BreakpointEventData::GetNumBreakpointLocationsFromEvent(
806  event.GetSP()));
807  return num_locations;
808 }
809 
812 
813  BreakpointSP bkpt_sp = GetSP();
814  if (bkpt_sp)
815  return bkpt_sp->IsHardware();
816  return false;
817 }
818 
819 BreakpointSP SBBreakpoint::GetSP() const { return m_opaque_wp.lock(); }
820 
821 // This is simple collection of breakpoint id's and their target.
823 public:
824  SBBreakpointListImpl(lldb::TargetSP target_sp) : m_target_wp() {
825  if (target_sp && target_sp->IsValid())
826  m_target_wp = target_sp;
827  }
828 
829  ~SBBreakpointListImpl() = default;
830 
831  size_t GetSize() { return m_break_ids.size(); }
832 
833  BreakpointSP GetBreakpointAtIndex(size_t idx) {
834  if (idx >= m_break_ids.size())
835  return BreakpointSP();
836  TargetSP target_sp = m_target_wp.lock();
837  if (!target_sp)
838  return BreakpointSP();
839  lldb::break_id_t bp_id = m_break_ids[idx];
840  return target_sp->GetBreakpointList().FindBreakpointByID(bp_id);
841  }
842 
843  BreakpointSP FindBreakpointByID(lldb::break_id_t desired_id) {
844  TargetSP target_sp = m_target_wp.lock();
845  if (!target_sp)
846  return BreakpointSP();
847 
848  for (lldb::break_id_t &break_id : m_break_ids) {
849  if (break_id == desired_id)
850  return target_sp->GetBreakpointList().FindBreakpointByID(break_id);
851  }
852  return BreakpointSP();
853  }
854 
855  bool Append(BreakpointSP bkpt) {
856  TargetSP target_sp = m_target_wp.lock();
857  if (!target_sp || !bkpt)
858  return false;
859  if (bkpt->GetTargetSP() != target_sp)
860  return false;
861  m_break_ids.push_back(bkpt->GetID());
862  return true;
863  }
864 
865  bool AppendIfUnique(BreakpointSP bkpt) {
866  TargetSP target_sp = m_target_wp.lock();
867  if (!target_sp || !bkpt)
868  return false;
869  if (bkpt->GetTargetSP() != target_sp)
870  return false;
871  lldb::break_id_t bp_id = bkpt->GetID();
872  if (find(m_break_ids.begin(), m_break_ids.end(), bp_id) ==
873  m_break_ids.end())
874  return false;
875 
876  m_break_ids.push_back(bkpt->GetID());
877  return true;
878  }
879 
881  TargetSP target_sp = m_target_wp.lock();
882  if (!target_sp)
883  return false;
884  if (id == LLDB_INVALID_BREAK_ID)
885  return false;
886  m_break_ids.push_back(id);
887  return true;
888  }
889 
890  void Clear() { m_break_ids.clear(); }
891 
893  for (lldb::break_id_t id : m_break_ids) {
894  bp_list.AddBreakpointID(BreakpointID(id));
895  }
896  }
897 
898  TargetSP GetTarget() { return m_target_wp.lock(); }
899 
900 private:
901  std::vector<lldb::break_id_t> m_break_ids;
902  TargetWP m_target_wp;
903 };
904 
906  : m_opaque_sp(new SBBreakpointListImpl(target.GetSP())) {
908 }
909 
911 
914 
915  if (!m_opaque_sp)
916  return 0;
917  else
918  return m_opaque_sp->GetSize();
919 }
920 
923  (size_t), idx);
924 
925  if (!m_opaque_sp)
927 
928  BreakpointSP bkpt_sp = m_opaque_sp->GetBreakpointAtIndex(idx);
929  return LLDB_RECORD_RESULT(SBBreakpoint(bkpt_sp));
930 }
931 
934  (lldb::break_id_t), id);
935 
936  if (!m_opaque_sp)
938  BreakpointSP bkpt_sp = m_opaque_sp->FindBreakpointByID(id);
939  return LLDB_RECORD_RESULT(SBBreakpoint(bkpt_sp));
940 }
941 
944  (const lldb::SBBreakpoint &), sb_bkpt);
945 
946  if (!sb_bkpt.IsValid())
947  return;
948  if (!m_opaque_sp)
949  return;
950  m_opaque_sp->Append(sb_bkpt.m_opaque_wp.lock());
951 }
952 
955  id);
956 
957  if (!m_opaque_sp)
958  return;
959  m_opaque_sp->AppendByID(id);
960 }
961 
964  (const lldb::SBBreakpoint &), sb_bkpt);
965 
966  if (!sb_bkpt.IsValid())
967  return false;
968  if (!m_opaque_sp)
969  return false;
970  return m_opaque_sp->AppendIfUnique(sb_bkpt.GetSP());
971 }
972 
975 
976  if (m_opaque_sp)
977  m_opaque_sp->Clear();
978 }
979 
981  lldb_private::BreakpointIDList &bp_id_list) {
982  if (m_opaque_sp)
983  m_opaque_sp->CopyToBreakpointIDList(bp_id_list);
984 }
985 
986 namespace lldb_private {
987 namespace repro {
988 
989 template <>
993  LLDB_REGISTER_CONSTRUCTOR(SBBreakpoint, (const lldb::BreakpointSP &));
995  SBBreakpoint, operator=,(const lldb::SBBreakpoint &));
997  SBBreakpoint, operator==,(const lldb::SBBreakpoint &));
999  SBBreakpoint, operator!=,(const lldb::SBBreakpoint &));
1002  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, IsValid, ());
1003  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, operator bool, ());
1004  LLDB_REGISTER_METHOD(void, SBBreakpoint, ClearAllBreakpointSites, ());
1006  FindLocationByAddress, (lldb::addr_t));
1008  FindLocationIDByAddress, (lldb::addr_t));
1010  FindLocationByID, (lldb::break_id_t));
1012  GetLocationAtIndex, (uint32_t));
1013  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetEnabled, (bool));
1014  LLDB_REGISTER_METHOD(bool, SBBreakpoint, IsEnabled, ());
1015  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetOneShot, (bool));
1016  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, IsOneShot, ());
1017  LLDB_REGISTER_METHOD(bool, SBBreakpoint, IsInternal, ());
1018  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetIgnoreCount, (uint32_t));
1019  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetCondition, (const char *));
1020  LLDB_REGISTER_METHOD(const char *, SBBreakpoint, GetCondition, ());
1021  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetAutoContinue, (bool));
1022  LLDB_REGISTER_METHOD(bool, SBBreakpoint, GetAutoContinue, ());
1024  LLDB_REGISTER_METHOD_CONST(uint32_t, SBBreakpoint, GetIgnoreCount, ());
1025  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetThreadID, (lldb::tid_t));
1026  LLDB_REGISTER_METHOD(lldb::tid_t, SBBreakpoint, GetThreadID, ());
1027  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetThreadIndex, (uint32_t));
1028  LLDB_REGISTER_METHOD_CONST(uint32_t, SBBreakpoint, GetThreadIndex, ());
1029  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetThreadName, (const char *));
1030  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpoint, GetThreadName, ());
1031  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetQueueName, (const char *));
1032  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpoint, GetQueueName, ());
1033  LLDB_REGISTER_METHOD_CONST(size_t, SBBreakpoint, GetNumResolvedLocations,
1034  ());
1035  LLDB_REGISTER_METHOD_CONST(size_t, SBBreakpoint, GetNumLocations, ());
1036  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetCommandLineCommands,
1037  (lldb::SBStringList &));
1038  LLDB_REGISTER_METHOD(bool, SBBreakpoint, GetCommandLineCommands,
1039  (lldb::SBStringList &));
1040  LLDB_REGISTER_METHOD(bool, SBBreakpoint, GetDescription,
1041  (lldb::SBStream &));
1042  LLDB_REGISTER_METHOD(bool, SBBreakpoint, GetDescription,
1043  (lldb::SBStream &, bool));
1045  (lldb::SBAddress &));
1047  SerializeToStructuredData, ());
1048  LLDB_REGISTER_METHOD(void, SBBreakpoint, SetScriptCallbackFunction,
1049  (const char *));
1050  LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpoint, SetScriptCallbackFunction,
1051  (const char *, SBStructuredData &));
1052  LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpoint, SetScriptCallbackBody,
1053  (const char *));
1054  LLDB_REGISTER_METHOD(bool, SBBreakpoint, AddName, (const char *));
1055  LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpoint, AddNameWithErrorHandling,
1056  (const char *));
1057  LLDB_REGISTER_METHOD(void, SBBreakpoint, RemoveName, (const char *));
1058  LLDB_REGISTER_METHOD(bool, SBBreakpoint, MatchesName, (const char *));
1060  LLDB_REGISTER_STATIC_METHOD(bool, SBBreakpoint, EventIsBreakpointEvent,
1061  (const lldb::SBEvent &));
1062  LLDB_REGISTER_STATIC_METHOD(lldb::BreakpointEventType, SBBreakpoint,
1063  GetBreakpointEventTypeFromEvent,
1064  (const lldb::SBEvent &));
1066  GetBreakpointFromEvent,
1067  (const lldb::SBEvent &));
1069  GetBreakpointLocationAtIndexFromEvent,
1070  (const lldb::SBEvent &, uint32_t));
1072  GetNumBreakpointLocationsFromEvent,
1073  (const lldb::SBEvent &));
1074  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpoint, IsHardware, ());
1075 }
1076 
1077 template <>
1080  LLDB_REGISTER_METHOD_CONST(size_t, SBBreakpointList, GetSize, ());
1082  GetBreakpointAtIndex, (size_t));
1084  FindBreakpointByID, (lldb::break_id_t));
1085  LLDB_REGISTER_METHOD(void, SBBreakpointList, Append,
1086  (const lldb::SBBreakpoint &));
1087  LLDB_REGISTER_METHOD(void, SBBreakpointList, AppendByID,
1088  (lldb::break_id_t));
1089  LLDB_REGISTER_METHOD(bool, SBBreakpointList, AppendIfUnique,
1090  (const lldb::SBBreakpoint &));
1091  LLDB_REGISTER_METHOD(void, SBBreakpointList, Clear, ());
1092 }
1093 
1094 }
1095 }
lldb::SBBreakpointLocation
Definition: SBBreakpointLocation.h:17
SBBreakpointListImpl::AppendIfUnique
bool AppendIfUnique(BreakpointSP bkpt)
Definition: SBBreakpoint.cpp:865
lldb::SBStringList
Definition: SBStringList.h:16
lldb::SBEvent::get
lldb_private::Event * get() const
Definition: SBEvent.cpp:139
lldb::SBBreakpoint::GetCondition
const char * GetCondition()
Definition: SBBreakpoint.cpp:291
SBBreakpointListImpl::GetSize
size_t GetSize()
Definition: SBBreakpoint.cpp:831
lldb::SBStringList::AppendString
void AppendString(const char *str)
Definition: SBStringList.cpp:62
lldb::SBStringList::GetSize
uint32_t GetSize() const
Definition: SBStringList.cpp:102
SBBreakpointListImpl
Definition: SBBreakpoint.cpp:822
lldb::SBBreakpoint::AddName
bool AddName(const char *new_name)
Definition: SBBreakpoint.cpp:677
lldb::SBBreakpoint::operator=
const lldb::SBBreakpoint & operator=(const lldb::SBBreakpoint &rhs)
Definition: SBBreakpoint.cpp:62
lldb::SBStream::Printf
void Printf(const char *format,...) __attribute__((format(printf
Definition: SBStream.cpp:69
lldb_private::BreakpointOptions::CommandData
Definition: BreakpointOptions.h:45
lldb::SBBreakpoint::AddNameWithErrorHandling
SBError AddNameWithErrorHandling(const char *new_name)
Definition: SBBreakpoint.cpp:684
LLDB_RECORD_RESULT
#define LLDB_RECORD_RESULT(Result)
Definition: ReproducerInstrumentation.h:211
lldb::SBBreakpoint::RemoveName
void RemoveName(const char *name_to_remove)
Definition: SBBreakpoint.cpp:704
LLDB_RECORD_METHOD_CONST_NO_ARGS
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:168
lldb::SBError
Definition: SBError.h:20
lldb_private::repro::RegisterMethods< SBBreakpoint >
void RegisterMethods< SBBreakpoint >(Registry &R)
Definition: SBBreakpoint.cpp:990
lldb::SBBreakpoint::GetAutoContinue
bool GetAutoContinue()
Definition: SBBreakpoint.cpp:315
SBBreakpointOptionCommon.h
SBStringList.h
lldb::SBBreakpoint::GetNumBreakpointLocationsFromEvent
static uint32_t GetNumBreakpointLocationsFromEvent(const lldb::SBEvent &event_sp)
Definition: SBBreakpoint.cpp:797
SBBreakpointListImpl::Clear
void Clear()
Definition: SBBreakpoint.cpp:890
lldb::SBBreakpoint::SerializeToStructuredData
SBStructuredData SerializeToStructuredData()
Definition: SBBreakpoint.cpp:588
SBBreakpointListImpl::Append
bool Append(BreakpointSP bkpt)
Definition: SBBreakpoint.cpp:855
LLDB_RECORD_METHOD_NO_ARGS
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:165
BreakpointLocation.h
StoppointCallbackContext.h
lldb::SBBreakpointList::CopyToBreakpointIDList
void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_id_list)
Definition: SBBreakpoint.cpp:980
LLDB_RECORD_CONSTRUCTOR_NO_ARGS
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
Definition: ReproducerInstrumentation.h:136
BreakpointResolver.h
lldb::SBBreakpoint::m_opaque_wp
lldb::BreakpointWP m_opaque_wp
Definition: SBBreakpoint.h:156
SectionLoadList.h
LLDB_REGISTER_METHOD_CONST
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:98
lldb::SBBreakpoint::GetThreadName
const char * GetThreadName() const
Definition: SBBreakpoint.cpp:421
lldb::SBEvent
Definition: SBEvent.h:21
lldb_private::repro::RegisterMethods< SBBreakpointList >
void RegisterMethods< SBBreakpointList >(Registry &R)
Definition: SBBreakpoint.cpp:1078
lldb::addr_t
uint64_t addr_t
Definition: lldb-types.h:83
SBReproducerPrivate.h
lldb::SBBreakpoint::SetIgnoreCount
void SetIgnoreCount(uint32_t count)
Definition: SBBreakpoint.cpp:267
LLDB_REGISTER_CONSTRUCTOR
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
Definition: ReproducerInstrumentation.h:89
Debugger.h
lldb_private::Target
Definition: Target.h:454
SBBreakpointListImpl::FindBreakpointByID
BreakpointSP FindBreakpointByID(lldb::break_id_t desired_id)
Definition: SBBreakpoint.cpp:843
lldb::SBBreakpoint::FindLocationByID
lldb::SBBreakpointLocation FindLocationByID(lldb::break_id_t bp_loc_id)
Definition: SBBreakpoint.cpp:175
lldb::SBBreakpoint::SetThreadName
void SetThreadName(const char *thread_name)
Definition: SBBreakpoint.cpp:408
lldb::SBStructuredData::m_impl_up
StructuredDataImplUP m_impl_up
Definition: SBStructuredData.h:104
Process.h
lldb::eScriptLanguageNone
@ eScriptLanguageNone
Definition: lldb-enumerations.h:217
Target.h
lldb::SBBreakpointList::~SBBreakpointList
~SBBreakpointList()
lldb::SBBreakpoint::GetLocationAtIndex
lldb::SBBreakpointLocation GetLocationAtIndex(uint32_t index)
Definition: SBBreakpoint.cpp:191
lldb::SBBreakpoint::SetQueueName
void SetQueueName(const char *queue_name)
Definition: SBBreakpoint.cpp:438
lldb::SBTarget
Definition: SBTarget.h:29
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
lldb::SBError::Success
bool Success() const
Definition: SBError.cpp:65
SBStream.h
lldb::SBBreakpoint::SetCommandLineCommands
void SetCommandLineCommands(SBStringList &commands)
Definition: SBBreakpoint.cpp:494
lldb::SBStream::get
lldb_private::Stream * get()
Definition: SBStream.cpp:176
lldb::SBBreakpoint::operator==
bool operator==(const lldb::SBBreakpoint &rhs)
Definition: SBBreakpoint.cpp:70
lldb::SBBreakpoint::ClearAllBreakpointSites
void ClearAllBreakpointSites()
Definition: SBBreakpoint.cpp:121
lldb::SBBreakpoint::IsHardware
bool IsHardware() const
Definition: SBBreakpoint.cpp:810
LLDB_RECORD_METHOD
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:158
lldb::SBBreakpoint::SetCondition
void SetCondition(const char *condition)
Definition: SBBreakpoint.cpp:279
SBThread.h
lldb::SBBreakpoint::SBBreakpoint
SBBreakpoint()
Definition: SBBreakpoint.cpp:48
SBBreakpointListImpl::GetBreakpointAtIndex
BreakpointSP GetBreakpointAtIndex(size_t idx)
Definition: SBBreakpoint.cpp:833
ThreadSpec.h
lldb::SBEvent::GetSP
lldb::EventSP & GetSP() const
Definition: SBEvent.cpp:137
SBBreakpointListImpl::SBBreakpointListImpl
SBBreakpointListImpl(lldb::TargetSP target_sp)
Definition: SBBreakpoint.cpp:824
lldb::SBBreakpoint::IsValid
bool IsValid() const
Definition: SBBreakpoint.cpp:105
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb_private::StreamString::GetData
const char * GetData() const
Definition: StreamString.h:43
lldb::SBBreakpointCallbackBaton
Definition: SBBreakpointOptionCommon.h:22
lldb::SBBreakpoint::FindLocationIDByAddress
lldb::break_id_t FindLocationIDByAddress(lldb::addr_t vm_addr)
Definition: SBBreakpoint.cpp:154
lldb::break_id_t
int32_t break_id_t
Definition: lldb-types.h:88
lldb::SBBreakpoint::SetEnabled
void SetEnabled(bool enable)
Definition: SBBreakpoint.cpp:207
lldb_private::StringList
Definition: StringList.h:25
lldb_private::ConstString
Definition: ConstString.h:40
lldb::SBBreakpoint::~SBBreakpoint
~SBBreakpoint()
lldb_private::StreamString
Definition: StreamString.h:23
lldb::SBError::SetErrorString
void SetErrorString(const char *err_str)
Definition: SBError.cpp:124
lldb_private::BreakpointOptions
Definition: BreakpointOptions.h:27
lldb::SBBreakpoint::GetNumResolvedLocations
size_t GetNumResolvedLocations() const
Definition: SBBreakpoint.cpp:467
lldb-enumerations.h
lldb::SBAddress::IsValid
bool IsValid() const
Definition: SBAddress.cpp:76
lldb::SBBreakpoint::SetScriptCallbackBody
SBError SetScriptCallbackBody(const char *script_body_text)
Definition: SBBreakpoint.cpp:654
lldb::SBBreakpoint::SetCallback
void SetCallback(SBBreakpointHitCallback callback, void *baton)
Definition: SBBreakpoint.cpp:603
lldb::SBBreakpoint::EventIsBreakpointEvent
static bool EventIsBreakpointEvent(const lldb::SBEvent &event)
Definition: SBBreakpoint.cpp:749
SBDebugger.h
SBBreakpointListImpl::AppendByID
bool AppendByID(lldb::break_id_t id)
Definition: SBBreakpoint.cpp:880
LLDB_REGISTER_STATIC_METHOD
#define LLDB_REGISTER_STATIC_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:103
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:39
lldb::SBBreakpointList::SBBreakpointList
SBBreakpointList(SBTarget &target)
Definition: SBBreakpoint.cpp:905
lldb::SBBreakpoint
class LLDB_API SBBreakpoint
Definition: SBDefines.h:23
lldb::SBBreakpointList::FindBreakpointByID
SBBreakpoint FindBreakpointByID(lldb::break_id_t)
Definition: SBBreakpoint.cpp:932
Thread.h
lldb::SBError::SetError
void SetError(uint32_t err, lldb::ErrorType type)
Definition: SBError.cpp:97
lldb::SBBreakpointList::AppendIfUnique
bool AppendIfUnique(const SBBreakpoint &sb_bkpt)
Definition: SBBreakpoint.cpp:962
lldb_private::SectionLoadList::ResolveLoadAddress
bool ResolveLoadAddress(lldb::addr_t load_addr, Address &so_addr, bool allow_section_end=false) const
Definition: SectionLoadList.cpp:208
Address.h
lldb_private::ThreadSpec
Definition: ThreadSpec.h:33
lldb::SBBreakpointList
Definition: SBBreakpoint.h:159
lldb_private::Address::SetRawAddress
void SetRawAddress(lldb::addr_t addr)
Definition: Address.h:435
LLDB_INVALID_BREAK_ID
#define LLDB_INVALID_BREAK_ID
Definition: lldb-defines.h:49
lldb::SBBreakpoint::GetIgnoreCount
uint32_t GetIgnoreCount() const
Definition: SBBreakpoint.cpp:341
LLDB_RECORD_CONSTRUCTOR
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
Definition: ReproducerInstrumentation.h:133
StreamFile.h
lldb_private::repro::Registry
The registry contains a unique mapping between functions and their ID.
Definition: ReproducerInstrumentation.h:517
lldb_private::ThreadSpec::GetName
const char * GetName() const
Definition: ThreadSpec.cpp:68
lldb::SBBreakpointHitCallback
bool(* SBBreakpointHitCallback)(void *baton, SBProcess &process, SBThread &thread, lldb::SBBreakpointLocation &location)
Definition: SBDefines.h:97
lldb::SBBreakpoint::GetThreadIndex
uint32_t GetThreadIndex() const
Definition: SBBreakpoint.cpp:391
lldb_private::ThreadSpec::GetIndex
uint32_t GetIndex() const
Definition: ThreadSpec.h:55
lldb::SBBreakpoint::GetBreakpointEventTypeFromEvent
static lldb::BreakpointEventType GetBreakpointEventTypeFromEvent(const lldb::SBEvent &event)
Definition: SBBreakpoint.cpp:758
lldb::SBBreakpoint::SetThreadIndex
void SetThreadIndex(uint32_t index)
Definition: SBBreakpoint.cpp:380
lldb_private::Status
Definition: Status.h:44
lldb::SBBreakpoint::AddLocation
SBError AddLocation(SBAddress &address)
Definition: SBBreakpoint.cpp:554
lldb_private::ThreadSpec::GetQueueName
const char * GetQueueName() const
Definition: ThreadSpec.cpp:72
lldb::SBBreakpointList::Clear
void Clear()
Definition: SBBreakpoint.cpp:973
BreakpointIDList.h
uint32_t
lldb_private::Address
Definition: Address.h:59
lldb::SBStructuredData
Definition: SBStructuredData.h:17
lldb::SBBreakpointList::m_opaque_sp
std::shared_ptr< SBBreakpointListImpl > m_opaque_sp
Definition: SBBreakpoint.h:185
lldb::SBBreakpoint
Definition: SBBreakpoint.h:18
lldb_private::BreakpointID
Definition: BreakpointID.h:22
SBBreakpointLocation.h
lldb::SBBreakpoint::GetCommandLineCommands
bool GetCommandLineCommands(SBStringList &commands)
Definition: SBBreakpoint.cpp:512
lldb::SBBreakpoint::MatchesName
bool MatchesName(const char *name)
Definition: SBBreakpoint.cpp:718
lldb::SBBreakpointList::AppendByID
void AppendByID(lldb::break_id_t id)
Definition: SBBreakpoint.cpp:953
lldb::SBBreakpointList::GetSize
size_t GetSize() const
Definition: SBBreakpoint.cpp:912
lldb::SBBreakpoint::SetOneShot
void SetOneShot(bool one_shot)
Definition: SBBreakpoint.cpp:231
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
lldb_private::Address::Dump
bool Dump(Stream *s, ExecutionContextScope *exe_scope, DumpStyle style, DumpStyle fallback_style=DumpStyleInvalid, uint32_t addr_byte_size=UINT32_MAX) const
Dump a description of this object to a Stream.
Definition: Address.cpp:405
lldb::SBBreakpoint::GetBreakpointFromEvent
static lldb::SBBreakpoint GetBreakpointFromEvent(const lldb::SBEvent &event)
Definition: SBBreakpoint.cpp:769
lldb::SBBreakpoint::GetHitCount
uint32_t GetHitCount() const
Definition: SBBreakpoint.cpp:327
lldb_private::Target::GetSectionLoadList
SectionLoadList & GetSectionLoadList()
Definition: Target.h:1043
lldb::SBBreakpoint::SBTarget
friend class SBTarget
Definition: SBBreakpoint.h:152
LLDB_INVALID_ADDRESS
#define LLDB_INVALID_ADDRESS
Definition: lldb-defines.h:86
SBStructuredData.h
lldb_private::BreakpointIDList::AddBreakpointID
bool AddBreakpointID(BreakpointID bp_id)
Definition: BreakpointIDList.cpp:46
lldb::SBBreakpoint::IsOneShot
bool IsOneShot() const
Definition: SBBreakpoint.cpp:243
StructuredDataImpl.h
lldb::SBBreakpoint::GetID
break_id_t GetID() const
Definition: SBBreakpoint.cpp:94
SBEvent.h
lldb::SBBreakpoint::SetAutoContinue
void SetAutoContinue(bool auto_continue)
Definition: SBBreakpoint.cpp:303
lldb::SBBreakpoint::GetQueueName
const char * GetQueueName() const
Definition: SBBreakpoint.cpp:450
SBBreakpointListImpl::m_break_ids
std::vector< lldb::break_id_t > m_break_ids
Definition: SBBreakpoint.cpp:901
lldb::SBBreakpoint::SetThreadID
void SetThreadID(lldb::tid_t sb_thread_id)
Definition: SBBreakpoint.cpp:355
lldb::SBAddress
Definition: SBAddress.h:17
lldb::SBAddress::ref
lldb_private::Address & ref()
Definition: SBAddress.cpp:180
lldb::SBBreakpoint::FindLocationByAddress
lldb::SBBreakpointLocation FindLocationByAddress(lldb::addr_t vm_addr)
Definition: SBBreakpoint.cpp:132
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
lldb::SBBreakpoint::operator!=
bool operator!=(const lldb::SBBreakpoint &rhs)
Definition: SBBreakpoint.cpp:77
lldb::SBBreakpoint::GetDescription
bool GetDescription(lldb::SBStream &description)
Definition: SBBreakpoint.cpp:527
lldb::SBBreakpoint::GetSP
lldb::BreakpointSP GetSP() const
Definition: SBBreakpoint.cpp:819
Breakpoint.h
lldb::SBBreakpoint::GetTarget
lldb::SBTarget GetTarget() const
Definition: SBBreakpoint.cpp:84
lldb::SBBreakpoint::GetBreakpointLocationAtIndexFromEvent
static lldb::SBBreakpointLocation GetBreakpointLocationAtIndexFromEvent(const lldb::SBEvent &event, uint32_t loc_idx)
Definition: SBBreakpoint.cpp:782
lldb::SBBreakpoint::GetNames
void GetNames(SBStringList &names)
Definition: SBBreakpoint.cpp:732
lldb::SBEvent::IsValid
bool IsValid() const
Definition: SBEvent.cpp:160
SBBreakpointListImpl::m_target_wp
TargetWP m_target_wp
Definition: SBBreakpoint.cpp:902
lldb::SBBreakpoint::IsEnabled
bool IsEnabled()
Definition: SBBreakpoint.cpp:219
CommandInterpreter.h
lldb::SBAddress::get
lldb_private::Address * get()
Definition: SBAddress.cpp:193
SBProcess.h
lldb::SBBreakpointLocation::SetLocation
void SetLocation(const lldb::BreakpointLocationSP &break_loc_sp)
Definition: SBBreakpointLocation.cpp:417
LLDB_RECORD_STATIC_METHOD
#define LLDB_RECORD_STATIC_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:171
LLDB_INVALID_THREAD_ID
#define LLDB_INVALID_THREAD_ID
Definition: lldb-defines.h:94
Stream.h
lldb::SBBreakpointList::Append
void Append(const SBBreakpoint &sb_bkpt)
Definition: SBBreakpoint.cpp:942
LLDB_RECORD_DUMMY
#define LLDB_RECORD_DUMMY(Result, Class, Method, Signature,...)
The LLDB_RECORD_DUMMY macro is special because it doesn't actually record anything.
Definition: ReproducerInstrumentation.h:216
lldb::SBStream
Definition: SBStream.h:18
SBBreakpointListImpl::CopyToBreakpointIDList
void CopyToBreakpointIDList(lldb_private::BreakpointIDList &bp_list)
Definition: SBBreakpoint.cpp:892
BreakpointResolverScripted.h
lldb::SBBreakpoint::SetScriptCallbackFunction
void SetScriptCallbackFunction(const char *callback_function_name)
Definition: SBBreakpoint.cpp:619
ScriptInterpreter.h
lldb::SBBreakpointList::GetBreakpointAtIndex
SBBreakpoint GetBreakpointAtIndex(size_t idx)
Definition: SBBreakpoint.cpp:921
lldb
Definition: SBAddress.h:15
lldb::SBBreakpoint::IsInternal
bool IsInternal()
Definition: SBBreakpoint.cpp:255
lldb::SBBreakpoint::GetThreadID
lldb::tid_t GetThreadID()
Definition: SBBreakpoint.cpp:366
lldb_private::BreakpointIDList
Definition: BreakpointIDList.h:25
lldb::SBStringList::AppendList
void AppendList(const char **strv, int strc)
Definition: SBStringList.cpp:73
SBBreakpoint.h
lldb::SBBreakpoint::GetNumLocations
size_t GetNumLocations() const
Definition: SBBreakpoint.cpp:481
lldb::tid_t
uint64_t tid_t
Definition: lldb-types.h:86
LLDB_REGISTER_METHOD
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:93
SBBreakpointListImpl::GetTarget
TargetSP GetTarget()
Definition: SBBreakpoint.cpp:898