LLDB  mainline
SBBreakpointName.cpp
Go to the documentation of this file.
1 //===-- SBBreakpointName.cpp ----------------------------------------*- C++ -*-===//
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"
11 #include "lldb/API/SBDebugger.h"
12 #include "lldb/API/SBError.h"
13 #include "lldb/API/SBStream.h"
14 #include "lldb/API/SBStringList.h"
15 #include "lldb/API/SBTarget.h"
16 
19 #include "lldb/Core/Debugger.h"
22 #include "lldb/Target/Target.h"
23 #include "lldb/Target/ThreadSpec.h"
24 #include "lldb/Utility/Stream.h"
25 
27 
28 using namespace lldb;
29 using namespace lldb_private;
30 
31 namespace lldb
32 {
34 public:
35  SBBreakpointNameImpl(TargetSP target_sp, const char *name) {
36  if (!name || name[0] == '\0')
37  return;
38  m_name.assign(name);
39 
40  if (!target_sp)
41  return;
42 
43  m_target_wp = target_sp;
44  }
45 
46  SBBreakpointNameImpl(SBTarget &sb_target, const char *name);
47  bool operator==(const SBBreakpointNameImpl &rhs);
48  bool operator!=(const SBBreakpointNameImpl &rhs);
49 
50  // For now we take a simple approach and only keep the name, and relook up
51  // the location when we need it.
52 
53  TargetSP GetTarget() const {
54  return m_target_wp.lock();
55  }
56 
57  const char *GetName() const {
58  return m_name.c_str();
59  }
60 
61  bool IsValid() const {
62  return !m_name.empty() && m_target_wp.lock();
63  }
64 
65  lldb_private::BreakpointName *GetBreakpointName() const;
66 
67 private:
68  TargetWP m_target_wp;
69  std::string m_name;
70 };
71 
73  const char *name) {
74  if (!name || name[0] == '\0')
75  return;
76  m_name.assign(name);
77 
78  if (!sb_target.IsValid())
79  return;
80 
81  TargetSP target_sp = sb_target.GetSP();
82  if (!target_sp)
83  return;
84 
85  m_target_wp = target_sp;
86 }
87 
89  return m_name == rhs.m_name && m_target_wp.lock() == rhs.m_target_wp.lock();
90 }
91 
93  return m_name != rhs.m_name || m_target_wp.lock() != rhs.m_target_wp.lock();
94 }
95 
97  if (!IsValid())
98  return nullptr;
99  TargetSP target_sp = GetTarget();
100  if (!target_sp)
101  return nullptr;
102  Status error;
103  return target_sp->FindBreakpointName(ConstString(m_name), true, error);
104 }
105 
106 } // namespace lldb
107 
110 }
111 
112 SBBreakpointName::SBBreakpointName(SBTarget &sb_target, const char *name) {
114  sb_target, name);
115 
116  m_impl_up.reset(new SBBreakpointNameImpl(sb_target, name));
117  // Call FindBreakpointName here to make sure the name is valid, reset if not:
118  BreakpointName *bp_name = GetBreakpointName();
119  if (!bp_name)
120  m_impl_up.reset();
121 }
122 
125  (lldb::SBBreakpoint &, const char *), sb_bkpt, name);
126 
127  if (!sb_bkpt.IsValid()) {
128  m_impl_up.reset();
129  return;
130  }
131  BreakpointSP bkpt_sp = sb_bkpt.GetSP();
132  Target &target = bkpt_sp->GetTarget();
133 
134  m_impl_up.reset(new SBBreakpointNameImpl(target.shared_from_this(), name));
135 
136  // Call FindBreakpointName here to make sure the name is valid, reset if not:
137  BreakpointName *bp_name = GetBreakpointName();
138  if (!bp_name) {
139  m_impl_up.reset();
140  return;
141  }
142 
143  // Now copy over the breakpoint's options:
144  target.ConfigureBreakpointName(*bp_name, *bkpt_sp->GetOptions(),
146 }
147 
150  rhs);
151 
152  if (!rhs.m_impl_up)
153  return;
154  else
155  m_impl_up.reset(new SBBreakpointNameImpl(rhs.m_impl_up->GetTarget(),
156  rhs.m_impl_up->GetName()));
157 }
158 
160 
164  const lldb::SBBreakpointName &,
165  SBBreakpointName, operator=,(const lldb::SBBreakpointName &), rhs);
166 
167  if (!rhs.m_impl_up) {
168  m_impl_up.reset();
169  return LLDB_RECORD_RESULT(*this);
170  }
171 
172  m_impl_up.reset(new SBBreakpointNameImpl(rhs.m_impl_up->GetTarget(),
173  rhs.m_impl_up->GetName()));
174  return LLDB_RECORD_RESULT(*this);
175 }
176 
179  bool, SBBreakpointName, operator==,(const lldb::SBBreakpointName &), rhs);
180 
181  return *m_impl_up == *rhs.m_impl_up;
182 }
183 
186  bool, SBBreakpointName, operator!=,(const lldb::SBBreakpointName &), rhs);
187 
188  return *m_impl_up != *rhs.m_impl_up;
189 }
190 
193  return this->operator bool();
194 }
195 SBBreakpointName::operator bool() const {
197 
198  if (!m_impl_up)
199  return false;
200  return m_impl_up->IsValid();
201 }
202 
203 const char *SBBreakpointName::GetName() const {
204  LLDB_RECORD_METHOD_CONST_NO_ARGS(const char *, SBBreakpointName, GetName);
205 
206  if (!m_impl_up)
207  return "<Invalid Breakpoint Name Object>";
208  return m_impl_up->GetName();
209 }
210 
211 void SBBreakpointName::SetEnabled(bool enable) {
212  LLDB_RECORD_METHOD(void, SBBreakpointName, SetEnabled, (bool), enable);
213 
214  BreakpointName *bp_name = GetBreakpointName();
215  if (!bp_name)
216  return;
217 
218  std::lock_guard<std::recursive_mutex> guard(
219  m_impl_up->GetTarget()->GetAPIMutex());
220 
221  bp_name->GetOptions().SetEnabled(enable);
222 }
223 
224 void SBBreakpointName::UpdateName(BreakpointName &bp_name) {
225  if (!IsValid())
226  return;
227 
228  TargetSP target_sp = m_impl_up->GetTarget();
229  if (!target_sp)
230  return;
231  target_sp->ApplyNameToBreakpoints(bp_name);
232 
233 }
234 
237 
238  BreakpointName *bp_name = GetBreakpointName();
239  if (!bp_name)
240  return false;
241 
242  std::lock_guard<std::recursive_mutex> guard(
243  m_impl_up->GetTarget()->GetAPIMutex());
244 
245  return bp_name->GetOptions().IsEnabled();
246 }
247 
248 void SBBreakpointName::SetOneShot(bool one_shot) {
249  LLDB_RECORD_METHOD(void, SBBreakpointName, SetOneShot, (bool), one_shot);
250 
251  BreakpointName *bp_name = GetBreakpointName();
252  if (!bp_name)
253  return;
254 
255  std::lock_guard<std::recursive_mutex> guard(
256  m_impl_up->GetTarget()->GetAPIMutex());
257 
258  bp_name->GetOptions().SetOneShot(one_shot);
259  UpdateName(*bp_name);
260 }
261 
264 
265  const BreakpointName *bp_name = GetBreakpointName();
266  if (!bp_name)
267  return false;
268 
269  std::lock_guard<std::recursive_mutex> guard(
270  m_impl_up->GetTarget()->GetAPIMutex());
271 
272  return bp_name->GetOptions().IsOneShot();
273 }
274 
276  LLDB_RECORD_METHOD(void, SBBreakpointName, SetIgnoreCount, (uint32_t), count);
277 
278  BreakpointName *bp_name = GetBreakpointName();
279  if (!bp_name)
280  return;
281 
282  std::lock_guard<std::recursive_mutex> guard(
283  m_impl_up->GetTarget()->GetAPIMutex());
284 
285  bp_name->GetOptions().SetIgnoreCount(count);
286  UpdateName(*bp_name);
287 }
288 
291 
292  BreakpointName *bp_name = GetBreakpointName();
293  if (!bp_name)
294  return false;
295 
296  std::lock_guard<std::recursive_mutex> guard(
297  m_impl_up->GetTarget()->GetAPIMutex());
298 
299  return bp_name->GetOptions().GetIgnoreCount();
300 }
301 
302 void SBBreakpointName::SetCondition(const char *condition) {
303  LLDB_RECORD_METHOD(void, SBBreakpointName, SetCondition, (const char *),
304  condition);
305 
306  BreakpointName *bp_name = GetBreakpointName();
307  if (!bp_name)
308  return;
309 
310  std::lock_guard<std::recursive_mutex> guard(
311  m_impl_up->GetTarget()->GetAPIMutex());
312 
313  bp_name->GetOptions().SetCondition(condition);
314  UpdateName(*bp_name);
315 }
316 
318  LLDB_RECORD_METHOD_NO_ARGS(const char *, SBBreakpointName, GetCondition);
319 
320  BreakpointName *bp_name = GetBreakpointName();
321  if (!bp_name)
322  return nullptr;
323 
324  std::lock_guard<std::recursive_mutex> guard(
325  m_impl_up->GetTarget()->GetAPIMutex());
326 
327  return bp_name->GetOptions().GetConditionText();
328 }
329 
330 void SBBreakpointName::SetAutoContinue(bool auto_continue) {
331  LLDB_RECORD_METHOD(void, SBBreakpointName, SetAutoContinue, (bool),
332  auto_continue);
333 
334  BreakpointName *bp_name = GetBreakpointName();
335  if (!bp_name)
336  return;
337 
338  std::lock_guard<std::recursive_mutex> guard(
339  m_impl_up->GetTarget()->GetAPIMutex());
340 
341  bp_name->GetOptions().SetAutoContinue(auto_continue);
342  UpdateName(*bp_name);
343 }
344 
346  LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAutoContinue);
347 
348  BreakpointName *bp_name = GetBreakpointName();
349  if (!bp_name)
350  return false;
351 
352  std::lock_guard<std::recursive_mutex> guard(
353  m_impl_up->GetTarget()->GetAPIMutex());
354 
355  return bp_name->GetOptions().IsAutoContinue();
356 }
357 
359  LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadID, (lldb::tid_t), tid);
360 
361  BreakpointName *bp_name = GetBreakpointName();
362  if (!bp_name)
363  return;
364 
365  std::lock_guard<std::recursive_mutex> guard(
366  m_impl_up->GetTarget()->GetAPIMutex());
367 
368  bp_name->GetOptions().SetThreadID(tid);
369  UpdateName(*bp_name);
370 }
371 
374 
375  BreakpointName *bp_name = GetBreakpointName();
376  if (!bp_name)
377  return LLDB_INVALID_THREAD_ID;
378 
379  std::lock_guard<std::recursive_mutex> guard(
380  m_impl_up->GetTarget()->GetAPIMutex());
381 
382  return bp_name->GetOptions().GetThreadSpec()->GetTID();
383 }
384 
386  LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadIndex, (uint32_t), index);
387 
388  BreakpointName *bp_name = GetBreakpointName();
389  if (!bp_name)
390  return;
391 
392  std::lock_guard<std::recursive_mutex> guard(
393  m_impl_up->GetTarget()->GetAPIMutex());
394 
395  bp_name->GetOptions().GetThreadSpec()->SetIndex(index);
396  UpdateName(*bp_name);
397 }
398 
401 
402  BreakpointName *bp_name = GetBreakpointName();
403  if (!bp_name)
404  return LLDB_INVALID_THREAD_ID;
405 
406  std::lock_guard<std::recursive_mutex> guard(
407  m_impl_up->GetTarget()->GetAPIMutex());
408 
409  return bp_name->GetOptions().GetThreadSpec()->GetIndex();
410 }
411 
412 void SBBreakpointName::SetThreadName(const char *thread_name) {
413  LLDB_RECORD_METHOD(void, SBBreakpointName, SetThreadName, (const char *),
414  thread_name);
415 
416  BreakpointName *bp_name = GetBreakpointName();
417  if (!bp_name)
418  return;
419 
420  std::lock_guard<std::recursive_mutex> guard(
421  m_impl_up->GetTarget()->GetAPIMutex());
422 
423  bp_name->GetOptions().GetThreadSpec()->SetName(thread_name);
424  UpdateName(*bp_name);
425 }
426 
427 const char *SBBreakpointName::GetThreadName() const {
429  GetThreadName);
430 
431  BreakpointName *bp_name = GetBreakpointName();
432  if (!bp_name)
433  return nullptr;
434 
435  std::lock_guard<std::recursive_mutex> guard(
436  m_impl_up->GetTarget()->GetAPIMutex());
437 
438  return bp_name->GetOptions().GetThreadSpec()->GetName();
439 }
440 
441 void SBBreakpointName::SetQueueName(const char *queue_name) {
442  LLDB_RECORD_METHOD(void, SBBreakpointName, SetQueueName, (const char *),
443  queue_name);
444 
445  BreakpointName *bp_name = GetBreakpointName();
446  if (!bp_name)
447  return;
448 
449  std::lock_guard<std::recursive_mutex> guard(
450  m_impl_up->GetTarget()->GetAPIMutex());
451 
452  bp_name->GetOptions().GetThreadSpec()->SetQueueName(queue_name);
453  UpdateName(*bp_name);
454 }
455 
456 const char *SBBreakpointName::GetQueueName() const {
458  GetQueueName);
459 
460  BreakpointName *bp_name = GetBreakpointName();
461  if (!bp_name)
462  return nullptr;
463 
464  std::lock_guard<std::recursive_mutex> guard(
465  m_impl_up->GetTarget()->GetAPIMutex());
466 
467  return bp_name->GetOptions().GetThreadSpec()->GetQueueName();
468 }
469 
471  LLDB_RECORD_METHOD(void, SBBreakpointName, SetCommandLineCommands,
472  (lldb::SBStringList &), commands);
473 
474  BreakpointName *bp_name = GetBreakpointName();
475  if (!bp_name)
476  return;
477  if (commands.GetSize() == 0)
478  return;
479 
480 
481  std::lock_guard<std::recursive_mutex> guard(
482  m_impl_up->GetTarget()->GetAPIMutex());
483  std::unique_ptr<BreakpointOptions::CommandData> cmd_data_up(
485 
486  bp_name->GetOptions().SetCommandDataCallback(cmd_data_up);
487  UpdateName(*bp_name);
488 }
489 
491  LLDB_RECORD_METHOD(bool, SBBreakpointName, GetCommandLineCommands,
492  (lldb::SBStringList &), commands);
493 
494  BreakpointName *bp_name = GetBreakpointName();
495  if (!bp_name)
496  return false;
497 
498  StringList command_list;
499  bool has_commands =
500  bp_name->GetOptions().GetCommandLineCallbacks(command_list);
501  if (has_commands)
502  commands.AppendList(command_list);
503  return has_commands;
504 }
505 
506 const char *SBBreakpointName::GetHelpString() const {
508  GetHelpString);
509 
510  BreakpointName *bp_name = GetBreakpointName();
511  if (!bp_name)
512  return "";
513 
514  return bp_name->GetHelp();
515 }
516 
517 void SBBreakpointName::SetHelpString(const char *help_string) {
518  LLDB_RECORD_METHOD(void, SBBreakpointName, SetHelpString, (const char *),
519  help_string);
520 
521  BreakpointName *bp_name = GetBreakpointName();
522  if (!bp_name)
523  return;
524 
525 
526  std::lock_guard<std::recursive_mutex> guard(
527  m_impl_up->GetTarget()->GetAPIMutex());
528  bp_name->SetHelp(help_string);
529 }
530 
532  LLDB_RECORD_METHOD(bool, SBBreakpointName, GetDescription, (lldb::SBStream &),
533  s);
534 
535  BreakpointName *bp_name = GetBreakpointName();
536  if (!bp_name)
537  {
538  s.Printf("No value");
539  return false;
540  }
541 
542  std::lock_guard<std::recursive_mutex> guard(
543  m_impl_up->GetTarget()->GetAPIMutex());
545  return true;
546 }
547 
549  void *baton) {
550  LLDB_RECORD_DUMMY(void, SBBreakpointName, SetCallback,
551  (lldb::SBBreakpointHitCallback, void *), callback, baton);
552 
553  BreakpointName *bp_name = GetBreakpointName();
554  if (!bp_name)
555  return;
556  std::lock_guard<std::recursive_mutex> guard(
557  m_impl_up->GetTarget()->GetAPIMutex());
558 
559  BatonSP baton_sp(new SBBreakpointCallbackBaton(callback, baton));
561  ::PrivateBreakpointHitCallback,
562  baton_sp,
563  false);
564  UpdateName(*bp_name);
565 }
566 
568  const char *callback_function_name) {
569  LLDB_RECORD_METHOD(void, SBBreakpointName, SetScriptCallbackFunction,
570  (const char *), callback_function_name);
571 
572  BreakpointName *bp_name = GetBreakpointName();
573  if (!bp_name)
574  return;
575 
576  std::lock_guard<std::recursive_mutex> guard(
577  m_impl_up->GetTarget()->GetAPIMutex());
578 
579  BreakpointOptions &bp_options = bp_name->GetOptions();
580  m_impl_up->GetTarget()
581  ->GetDebugger()
582  .GetScriptInterpreter()
583  ->SetBreakpointCommandCallbackFunction(&bp_options,
584  callback_function_name);
585  UpdateName(*bp_name);
586 }
587 
588 SBError
589 SBBreakpointName::SetScriptCallbackBody(const char *callback_body_text) {
590  LLDB_RECORD_METHOD(lldb::SBError, SBBreakpointName, SetScriptCallbackBody,
591  (const char *), callback_body_text);
592 
593  SBError sb_error;
594  BreakpointName *bp_name = GetBreakpointName();
595  if (!bp_name)
596  return LLDB_RECORD_RESULT(sb_error);
597 
598  std::lock_guard<std::recursive_mutex> guard(
599  m_impl_up->GetTarget()->GetAPIMutex());
600 
601  BreakpointOptions &bp_options = bp_name->GetOptions();
602  Status error =
603  m_impl_up->GetTarget()
604  ->GetDebugger()
605  .GetScriptInterpreter()
606  ->SetBreakpointCommandCallback(&bp_options, callback_body_text);
607  sb_error.SetError(error);
608  if (!sb_error.Fail())
609  UpdateName(*bp_name);
610 
611  return LLDB_RECORD_RESULT(sb_error);
612 }
613 
616 
617  BreakpointName *bp_name = GetBreakpointName();
618  if (!bp_name)
619  return false;
620  return bp_name->GetPermissions().GetAllowList();
621 }
622 
624  LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowList, (bool), value);
625 
626 
627  BreakpointName *bp_name = GetBreakpointName();
628  if (!bp_name)
629  return;
630  bp_name->GetPermissions().SetAllowList(value);
631 }
632 
634  LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAllowDelete);
635 
636  BreakpointName *bp_name = GetBreakpointName();
637  if (!bp_name)
638  return false;
639  return bp_name->GetPermissions().GetAllowDelete();
640 }
641 
643  LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDelete, (bool), value);
644 
645 
646  BreakpointName *bp_name = GetBreakpointName();
647  if (!bp_name)
648  return;
649  bp_name->GetPermissions().SetAllowDelete(value);
650 }
651 
653  LLDB_RECORD_METHOD_NO_ARGS(bool, SBBreakpointName, GetAllowDisable);
654 
655  BreakpointName *bp_name = GetBreakpointName();
656  if (!bp_name)
657  return false;
658  return bp_name->GetPermissions().GetAllowDisable();
659 }
660 
662  LLDB_RECORD_METHOD(void, SBBreakpointName, SetAllowDisable, (bool), value);
663 
664  BreakpointName *bp_name = GetBreakpointName();
665  if (!bp_name)
666  return;
667  bp_name->GetPermissions().SetAllowDisable(value);
668 }
669 
670 lldb_private::BreakpointName *SBBreakpointName::GetBreakpointName() const
671 {
672  if (!IsValid())
673  return nullptr;
674  return m_impl_up->GetBreakpointName();
675 }
676 
677 
678 namespace lldb_private {
679 namespace repro {
680 
681 template <>
685  (lldb::SBTarget &, const char *));
687  (lldb::SBBreakpoint &, const char *));
689  (const lldb::SBBreakpointName &));
691  const lldb::SBBreakpointName &,
692  SBBreakpointName, operator=,(const lldb::SBBreakpointName &));
694  bool, SBBreakpointName, operator==,(const lldb::SBBreakpointName &));
696  bool, SBBreakpointName, operator!=,(const lldb::SBBreakpointName &));
697  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, IsValid, ());
698  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, operator bool, ());
699  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetName, ());
700  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetEnabled, (bool));
701  LLDB_REGISTER_METHOD(bool, SBBreakpointName, IsEnabled, ());
702  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetOneShot, (bool));
703  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, IsOneShot, ());
704  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetIgnoreCount, (uint32_t));
706  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetCondition, (const char *));
707  LLDB_REGISTER_METHOD(const char *, SBBreakpointName, GetCondition, ());
708  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAutoContinue, (bool));
709  LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAutoContinue, ());
710  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadID, (lldb::tid_t));
712  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadIndex, (uint32_t));
714  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetThreadName, (const char *));
715  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetThreadName,
716  ());
717  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetQueueName, (const char *));
718  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetQueueName,
719  ());
720  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetCommandLineCommands,
721  (lldb::SBStringList &));
722  LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetCommandLineCommands,
723  (lldb::SBStringList &));
724  LLDB_REGISTER_METHOD_CONST(const char *, SBBreakpointName, GetHelpString,
725  ());
726  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetHelpString, (const char *));
727  LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetDescription,
728  (lldb::SBStream &));
729  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetScriptCallbackFunction,
730  (const char *));
731  LLDB_REGISTER_METHOD(lldb::SBError, SBBreakpointName, SetScriptCallbackBody,
732  (const char *));
733  LLDB_REGISTER_METHOD_CONST(bool, SBBreakpointName, GetAllowList, ());
734  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowList, (bool));
735  LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAllowDelete, ());
736  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowDelete, (bool));
737  LLDB_REGISTER_METHOD(bool, SBBreakpointName, GetAllowDisable, ());
738  LLDB_REGISTER_METHOD(void, SBBreakpointName, SetAllowDisable, (bool));
739 }
740 
741 }
742 }
bool operator!=(const lldb::SBBreakpointName &rhs)
void SetAutoContinue(bool auto_continue)
bool IsAutoContinue() const
Check the auto-continue state.
The registry contains a unique mapping between functions and their ID.
Enumerations for broadcasting.
Definition: SBLaunchInfo.h:14
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
void SetName(llvm::StringRef name)
Definition: ThreadSpec.h:53
void SetHelpString(const char *help_string)
bool operator!=(const SBBreakpointNameImpl &rhs)
bool LLDB_API operator==(const SBAddress &lhs, const SBAddress &rhs)
Definition: SBAddress.cpp:66
lldb_private::BreakpointName * GetBreakpointName() const
void SetAutoContinue(bool auto_continue)
Set the auto-continue state.
void SetAllowDisable(bool value)
#define LLDB_RECORD_DUMMY(Result, Class, Method, Signature,...)
The LLDB_RECORD_DUMMY macro is special because it doesn&#39;t actually record anything.
void SetCommandDataCallback(std::unique_ptr< CommandData > &cmd_data)
Set a callback based on BreakpointOptions::CommandData.
void SetScriptCallbackFunction(const char *callback_function_name)
bool Fail() const
Definition: SBError.cpp:54
void SetError(uint32_t err, lldb::ErrorType type)
Definition: SBError.cpp:97
const char * GetQueueName() const
bool(* SBBreakpointHitCallback)(void *baton, SBProcess &process, SBThread &thread, lldb::SBBreakpointLocation &location)
Definition: SBDefines.h:96
void SetCommandLineCommands(SBStringList &commands)
void SetThreadIndex(uint32_t index)
const char * GetName() const
void SetOneShot(bool one_shot)
If enable is true, enable the breakpoint, if false disable it.
void SetOneShot(bool one_shot)
uint32_t GetIgnoreCount() const
Return the current Ignore Count.
const char * GetName() const
Definition: ThreadSpec.cpp:82
BreakpointOptions & GetOptions()
const char * GetQueueName() const
Definition: ThreadSpec.cpp:86
bool IsEnabled() const
Check the Enable/Disable state.
const lldb::SBBreakpointName & operator=(const lldb::SBBreakpointName &rhs)
void SetQueueName(llvm::StringRef queue_name)
Definition: ThreadSpec.h:55
lldb::tid_t GetTID() const
Definition: ThreadSpec.h:59
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
lldb::TargetSP GetSP() const
Definition: SBTarget.cpp:600
void SetCondition(const char *condition)
Set the breakpoint option&#39;s condition.
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
void SetEnabled(bool enabled)
If enable is true, enable the breakpoint, if false disable it.
void SetCallback(SBBreakpointHitCallback callback, void *baton)
uint32_t GetSize() const
void Printf(const char *format,...) __attribute__((format(printf
Definition: SBStream.cpp:62
uint64_t tid_t
Definition: lldb-types.h:86
void ConfigureBreakpointName(BreakpointName &bp_name, const BreakpointOptions &options, const BreakpointName::Permissions &permissions)
Definition: Target.cpp:744
uint32_t GetThreadIndex() const
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
bool GetDescription(lldb::SBStream &description)
void SetQueueName(const char *queue_name)
void SetThreadName(const char *thread_name)
uint32_t GetIgnoreCount() const
const char * GetThreadName() const
const char * GetName() const
ThreadSpec * GetThreadSpec()
Returns a pointer to the ThreadSpec for this option, creating it.
void SetIndex(uint32_t index)
Definition: ThreadSpec.h:49
const char * GetHelpString() const
bool IsValid() const
Definition: SBTarget.cpp:167
bool operator!=(const Address &lhs, const Address &rhs)
Definition: Address.cpp:979
bool GetDescription(Stream *s, lldb::DescriptionLevel level)
bool GetCommandLineCommands(SBStringList &commands)
void SetEnabled(bool enable)
void SetIgnoreCount(uint32_t n)
Set the breakpoint to ignore the next count breakpoint hits.
void SetCondition(const char *condition)
bool GetCommandLineCallbacks(StringList &command_list)
Returns the command line commands for the callback on this breakpoint.
void RegisterMethods< SBBreakpointName >(Registry &R)
void SetThreadID(lldb::tid_t sb_thread_id)
const char * GetConditionText(size_t *hash=nullptr) const
Return a pointer to the text of the condition expression.
#define LLDB_INVALID_THREAD_ID
Definition: lldb-defines.h:93
void AppendList(const char **strv, int strc)
A uniqued constant string class.
Definition: ConstString.h:38
SBBreakpointNameImpl(TargetSP target_sp, const char *name)
bool operator==(const SBBreakpointNameImpl &rhs)
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
Definition: SBAddress.h:15
uint32_t GetIndex() const
Definition: ThreadSpec.h:57
lldb_private::Stream * get()
Definition: SBStream.cpp:160
bool IsOneShot() const
Check the One-shot state.
SBError SetScriptCallbackBody(const char *script_body_text)
void SetThreadID(lldb::tid_t thread_id)
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
void SetCallback(BreakpointHitCallback callback, const lldb::BatonSP &baton_sp, bool synchronous=false)
Adds a callback to the breakpoint option set.
bool IsValid() const
#define LLDB_RECORD_METHOD_CONST_NO_ARGS(Result, Class, Method)
void SetAllowDelete(bool value)
void SetAllowList(bool value)
#define LLDB_RECORD_RESULT(Result)
void SetIgnoreCount(uint32_t count)
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
bool operator==(const lldb::SBBreakpointName &rhs)
An error handling class.
Definition: Status.h:44
class LLDB_API SBBreakpointNameImpl
Definition: SBDefines.h:27
void SetHelp(const char *description)