LLDB  mainline
SBDebugger.cpp
Go to the documentation of this file.
1 //===-- SBDebugger.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 
9 #include "SBReproducerPrivate.h"
10 #include "SystemInitializerFull.h"
11 
12 #include "lldb/API/SBDebugger.h"
13 
14 #include "lldb/lldb-private.h"
15 
16 #include "lldb/API/SBBroadcaster.h"
20 #include "lldb/API/SBError.h"
21 #include "lldb/API/SBEvent.h"
22 #include "lldb/API/SBFile.h"
23 #include "lldb/API/SBFrame.h"
24 #include "lldb/API/SBListener.h"
25 #include "lldb/API/SBProcess.h"
27 #include "lldb/API/SBStream.h"
28 #include "lldb/API/SBStringList.h"
30 #include "lldb/API/SBTarget.h"
31 #include "lldb/API/SBThread.h"
33 #include "lldb/API/SBTypeFilter.h"
34 #include "lldb/API/SBTypeFormat.h"
36 #include "lldb/API/SBTypeSummary.h"
38 
39 #include "lldb/Core/Debugger.h"
41 #include "lldb/Core/Progress.h"
42 #include "lldb/Core/StreamFile.h"
45 #include "lldb/Host/Config.h"
46 #include "lldb/Host/XML.h"
51 #include "lldb/Target/Process.h"
52 #include "lldb/Target/TargetList.h"
53 #include "lldb/Utility/Args.h"
54 #include "lldb/Utility/State.h"
55 
56 #include "llvm/ADT/STLExtras.h"
57 #include "llvm/ADT/StringRef.h"
58 #include "llvm/Support/DynamicLibrary.h"
59 #include "llvm/Support/ManagedStatic.h"
60 
61 using namespace lldb;
62 using namespace lldb_private;
63 
64 static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp,
65  const FileSpec &spec,
66  Status &error) {
67  llvm::sys::DynamicLibrary dynlib =
68  llvm::sys::DynamicLibrary::getPermanentLibrary(spec.GetPath().c_str());
69  if (dynlib.isValid()) {
70  typedef bool (*LLDBCommandPluginInit)(lldb::SBDebugger & debugger);
71 
72  lldb::SBDebugger debugger_sb(debugger_sp);
73  // This calls the bool lldb::PluginInitialize(lldb::SBDebugger debugger)
74  // function.
75  // TODO: mangle this differently for your system - on OSX, the first
76  // underscore needs to be removed and the second one stays
77  LLDBCommandPluginInit init_func =
78  (LLDBCommandPluginInit)(uintptr_t)dynlib.getAddressOfSymbol(
79  "_ZN4lldb16PluginInitializeENS_10SBDebuggerE");
80  if (init_func) {
81  if (init_func(debugger_sb))
82  return dynlib;
83  else
84  error.SetErrorString("plug-in refused to load "
85  "(lldb::PluginInitialize(lldb::SBDebugger) "
86  "returned false)");
87  } else {
88  error.SetErrorString("plug-in is missing the required initialization: "
89  "lldb::PluginInitialize(lldb::SBDebugger)");
90  }
91  } else {
92  if (FileSystem::Instance().Exists(spec))
93  error.SetErrorString("this file does not represent a loadable dylib");
94  else
95  error.SetErrorString("no such file");
96  }
97  return llvm::sys::DynamicLibrary();
98 }
99 
100 static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;
101 
103  lldb::SBDebugger &sb_debugger,
104  unsigned long (*callback)(void *, lldb::SBInputReader *,
105  lldb::InputReaderAction, char const *,
106  unsigned long),
107  void *a, lldb::InputReaderGranularity b, char const *c, char const *d,
108  bool e) {
110  lldb::SBError, SBInputReader, Initialize,
111  (lldb::SBDebugger &,
112  unsigned long (*)(void *, lldb::SBInputReader *, lldb::InputReaderAction,
113  const char *, unsigned long),
114  void *, lldb::InputReaderGranularity, const char *, const char *, bool),
115  sb_debugger, callback, a, b, c, d, e);
116 
117  return SBError();
118 }
119 
121  LLDB_RECORD_METHOD(void, SBInputReader, SetIsDone, (bool), b);
122 }
123 
126 
127  return false;
128 }
129 
131 
132 SBDebugger::SBDebugger(const lldb::DebuggerSP &debugger_sp)
133  : m_opaque_sp(debugger_sp) {
134  LLDB_RECORD_CONSTRUCTOR(SBDebugger, (const lldb::DebuggerSP &), debugger_sp);
135 }
136 
137 SBDebugger::SBDebugger(const SBDebugger &rhs) : m_opaque_sp(rhs.m_opaque_sp) {
139 }
140 
141 SBDebugger::~SBDebugger() = default;
142 
145  SBDebugger, operator=,(const lldb::SBDebugger &), rhs);
146 
147  if (this != &rhs) {
148  m_opaque_sp = rhs.m_opaque_sp;
149  }
150  return LLDB_RECORD_RESULT(*this);
151 }
152 
156 
158 }
159 
161  uint64_t &progress_id,
162  uint64_t &completed,
163  uint64_t &total,
164  bool &is_debugger_specific) {
165  const Debugger::ProgressEventData *progress_data =
167  if (progress_data == nullptr)
168  return nullptr;
169  progress_id = progress_data->GetID();
170  completed = progress_data->GetCompleted();
171  total = progress_data->GetTotal();
172  is_debugger_specific = progress_data->IsDebuggerSpecific();
173  // We must record the static method _after_ the out parameters have been
174  // filled in.
176  const char *, SBDebugger, GetProgressFromEvent,
177  (const lldb::SBEvent &, uint64_t &, uint64_t &, uint64_t &, bool &),
178  event, progress_id, completed, total, is_debugger_specific);
179  return LLDB_RECORD_RESULT(progress_data->GetMessage().c_str())
180 }
181 
184  SBBroadcaster broadcaster(&m_opaque_sp->GetBroadcaster(), false);
185  return LLDB_RECORD_RESULT(broadcaster);
186 }
187 
191 }
192 
196 
197  SBError error;
198  if (auto e = g_debugger_lifetime->Initialize(
199  std::make_unique<SystemInitializerFull>(), LoadPlugin)) {
200  error.SetError(Status(std::move(e)));
201  }
202  return LLDB_RECORD_RESULT(error);
203 }
204 
207 
208  g_debugger_lifetime->Terminate();
209 }
210 
213 
214  if (m_opaque_sp)
215  m_opaque_sp->ClearIOHandlers();
216 
217  m_opaque_sp.reset();
218 }
219 
222 
223  return LLDB_RECORD_RESULT(SBDebugger::Create(false, nullptr, nullptr));
224 }
225 
226 SBDebugger SBDebugger::Create(bool source_init_files) {
228  source_init_files);
229 
230  return LLDB_RECORD_RESULT(
231  SBDebugger::Create(source_init_files, nullptr, nullptr));
232 }
233 
234 SBDebugger SBDebugger::Create(bool source_init_files,
235  lldb::LogOutputCallback callback, void *baton)
236 
237 {
239  (bool, lldb::LogOutputCallback, void *), source_init_files,
240  callback, baton);
241 
242  SBDebugger debugger;
243 
244  // Currently we have issues if this function is called simultaneously on two
245  // different threads. The issues mainly revolve around the fact that the
246  // lldb_private::FormatManager uses global collections and having two threads
247  // parsing the .lldbinit files can cause mayhem. So to get around this for
248  // now we need to use a mutex to prevent bad things from happening.
249  static std::recursive_mutex g_mutex;
250  std::lock_guard<std::recursive_mutex> guard(g_mutex);
251 
252  debugger.reset(Debugger::CreateInstance(callback, baton));
253 
254  SBCommandInterpreter interp = debugger.GetCommandInterpreter();
255  if (source_init_files) {
256  interp.get()->SkipLLDBInitFiles(false);
257  interp.get()->SkipAppInitFiles(false);
258  SBCommandReturnObject result;
259  interp.SourceInitFileInHomeDirectory(result, false);
260  } else {
261  interp.get()->SkipLLDBInitFiles(true);
262  interp.get()->SkipAppInitFiles(true);
263  }
264  return debugger;
265 }
266 
269  debugger);
270 
271  Debugger::Destroy(debugger.m_opaque_sp);
272 
273  if (debugger.m_opaque_sp.get() != nullptr)
274  debugger.m_opaque_sp.reset();
275 }
276 
279 
280  // Since this function can be call asynchronously, we allow it to be non-
281  // mandatory. We have seen deadlocks with this function when called so we
282  // need to safeguard against this until we can determine what is causing the
283  // deadlocks.
284 
285  const bool mandatory = false;
286 
288 }
289 
290 bool SBDebugger::IsValid() const {
292  return this->operator bool();
293 }
294 SBDebugger::operator bool() const {
295  LLDB_RECORD_METHOD_CONST_NO_ARGS(bool, SBDebugger, operator bool);
296 
297  return m_opaque_sp.get() != nullptr;
298 }
299 
300 void SBDebugger::SetAsync(bool b) {
301  LLDB_RECORD_METHOD(void, SBDebugger, SetAsync, (bool), b);
302 
303  if (m_opaque_sp)
304  m_opaque_sp->SetAsyncExecution(b);
305 }
306 
309 
310  return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
311 }
312 
315 
316  if (m_opaque_sp)
317  m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
318 }
319 
322 
323  if (m_opaque_sp)
324  m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
325 }
326 
327 void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
328  LLDB_RECORD_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool), fh,
329  transfer_ownership);
330  SetInputFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
331 }
332 
334  LLDB_RECORD_METHOD(SBError, SBDebugger, SetInputFile, (FileSP), file_sp);
335  return LLDB_RECORD_RESULT(SetInputFile(SBFile(file_sp)));
336 }
337 
338 // Shouldn't really be settable after initialization as this could cause lots
339 // of problems; don't want users trying to switch modes in the middle of a
340 // debugging session.
343 
344  SBError error;
345  if (!m_opaque_sp) {
346  error.ref().SetErrorString("invalid debugger");
347  return LLDB_RECORD_RESULT(error);
348  }
349 
350  repro::DataRecorder *recorder = nullptr;
351  if (repro::Generator *g = repro::Reproducer::Instance().GetGenerator())
352  recorder = g->GetOrCreate<repro::CommandProvider>().GetNewRecorder();
353 
354  FileSP file_sp = file.m_opaque_sp;
355 
356  static std::unique_ptr<repro::MultiLoader<repro::CommandProvider>> loader =
358  repro::Reproducer::Instance().GetLoader());
359  if (loader) {
360  llvm::Optional<std::string> nextfile = loader->GetNextFile();
361  FILE *fh = nextfile ? FileSystem::Instance().Fopen(nextfile->c_str(), "r")
362  : nullptr;
363  // FIXME Jonas Devlieghere: shouldn't this error be propagated out to the
364  // reproducer somehow if fh is NULL?
365  if (fh) {
366  file_sp = std::make_shared<NativeFile>(fh, true);
367  }
368  }
369 
370  if (!file_sp || !file_sp->IsValid()) {
371  error.ref().SetErrorString("invalid file");
372  return LLDB_RECORD_RESULT(error);
373  }
374 
375  m_opaque_sp->SetInputFile(file_sp, recorder);
376  return LLDB_RECORD_RESULT(error);
377 }
378 
380  LLDB_RECORD_METHOD(SBError, SBDebugger, SetOutputFile, (FileSP), file_sp);
381  return LLDB_RECORD_RESULT(SetOutputFile(SBFile(file_sp)));
382 }
383 
384 void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
385  LLDB_RECORD_METHOD(void, SBDebugger, SetOutputFileHandle, (FILE *, bool), fh,
386  transfer_ownership);
387  SetOutputFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
388 }
389 
392  SBError error;
393  if (!m_opaque_sp) {
394  error.ref().SetErrorString("invalid debugger");
395  return LLDB_RECORD_RESULT(error);
396  }
397  if (!file) {
398  error.ref().SetErrorString("invalid file");
399  return LLDB_RECORD_RESULT(error);
400  }
401  m_opaque_sp->SetOutputFile(file.m_opaque_sp);
402  return LLDB_RECORD_RESULT(error);
403 }
404 
405 void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
406  LLDB_RECORD_METHOD(void, SBDebugger, SetErrorFileHandle, (FILE *, bool), fh,
407  transfer_ownership);
408  SetErrorFile((FileSP)std::make_shared<NativeFile>(fh, transfer_ownership));
409 }
410 
412  LLDB_RECORD_METHOD(SBError, SBDebugger, SetErrorFile, (FileSP), file_sp);
413  return LLDB_RECORD_RESULT(SetErrorFile(SBFile(file_sp)));
414 }
415 
418  SBError error;
419  if (!m_opaque_sp) {
420  error.ref().SetErrorString("invalid debugger");
421  return LLDB_RECORD_RESULT(error);
422  }
423  if (!file) {
424  error.ref().SetErrorString("invalid file");
425  return LLDB_RECORD_RESULT(error);
426  }
427  m_opaque_sp->SetErrorFile(file.m_opaque_sp);
428  return LLDB_RECORD_RESULT(error);
429 }
430 
433  if (m_opaque_sp) {
434  File &file_sp = m_opaque_sp->GetInputFile();
435  return LLDB_RECORD_RESULT(file_sp.GetStream());
436  }
437  return LLDB_RECORD_RESULT(nullptr);
438 }
439 
442  if (m_opaque_sp) {
443  return LLDB_RECORD_RESULT(SBFile(m_opaque_sp->GetInputFileSP()));
444  }
445  return LLDB_RECORD_RESULT(SBFile());
446 }
447 
450  if (m_opaque_sp) {
451  StreamFile &stream_file = m_opaque_sp->GetOutputStream();
452  return LLDB_RECORD_RESULT(stream_file.GetFile().GetStream());
453  }
454  return LLDB_RECORD_RESULT(nullptr);
455 }
456 
459  if (m_opaque_sp) {
460  SBFile file(m_opaque_sp->GetOutputStream().GetFileSP());
461  return LLDB_RECORD_RESULT(file);
462  }
463  return LLDB_RECORD_RESULT(SBFile());
464 }
465 
468 
469  if (m_opaque_sp) {
470  StreamFile &stream_file = m_opaque_sp->GetErrorStream();
471  return LLDB_RECORD_RESULT(stream_file.GetFile().GetStream());
472  }
473  return LLDB_RECORD_RESULT(nullptr);
474 }
475 
478  SBFile file;
479  if (m_opaque_sp) {
480  SBFile file(m_opaque_sp->GetErrorStream().GetFileSP());
481  return LLDB_RECORD_RESULT(file);
482  }
483  return LLDB_RECORD_RESULT(SBFile());
484 }
485 
488 
489  if (m_opaque_sp)
490  m_opaque_sp->SaveInputTerminalState();
491 }
492 
495 
496  if (m_opaque_sp)
497  m_opaque_sp->RestoreInputTerminalState();
498 }
502 
503  SBCommandInterpreter sb_interpreter;
504  if (m_opaque_sp)
505  sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter());
506 
507  return LLDB_RECORD_RESULT(sb_interpreter);
508 }
509 
510 void SBDebugger::HandleCommand(const char *command) {
511  LLDB_RECORD_METHOD(void, SBDebugger, HandleCommand, (const char *), command);
512 
513  if (m_opaque_sp) {
514  TargetSP target_sp(m_opaque_sp->GetSelectedTarget());
515  std::unique_lock<std::recursive_mutex> lock;
516  if (target_sp)
517  lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
518 
520  SBCommandReturnObject result;
521 
522  sb_interpreter.HandleCommand(command, result, false);
523 
524  result.PutError(m_opaque_sp->GetErrorStream().GetFileSP());
525  result.PutOutput(m_opaque_sp->GetOutputStream().GetFileSP());
526 
527  if (!m_opaque_sp->GetAsyncExecution()) {
528  SBProcess process(GetCommandInterpreter().GetProcess());
529  ProcessSP process_sp(process.GetSP());
530  if (process_sp) {
531  EventSP event_sp;
532  ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
533  while (lldb_listener_sp->GetEventForBroadcaster(
534  process_sp.get(), event_sp, std::chrono::seconds(0))) {
535  SBEvent event(event_sp);
536  HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile());
537  }
538  }
539  }
540  }
541 }
542 
545 
546  SBListener sb_listener;
547  if (m_opaque_sp)
548  sb_listener.reset(m_opaque_sp->GetListener());
549 
550  return LLDB_RECORD_RESULT(sb_listener);
551 }
552 
554  const SBEvent &event, SBFile out,
555  SBFile err) {
558  (const lldb::SBProcess &, const lldb::SBEvent &, SBFile, SBFile), process,
559  event, out, err);
560 
561  return HandleProcessEvent(process, event, out.m_opaque_sp, err.m_opaque_sp);
562 }
563 
565  const SBEvent &event, FILE *out,
566  FILE *err) {
569  (const lldb::SBProcess &, const lldb::SBEvent &, FILE *, FILE *), process,
570  event, out, err);
571 
572  FileSP outfile = std::make_shared<NativeFile>(out, false);
573  FileSP errfile = std::make_shared<NativeFile>(err, false);
574  return HandleProcessEvent(process, event, outfile, errfile);
575 }
576 
578  const SBEvent &event, FileSP out_sp,
579  FileSP err_sp) {
580 
583  (const lldb::SBProcess &, const lldb::SBEvent &, FileSP, FileSP), process,
584  event, out_sp, err_sp);
585 
586  if (!process.IsValid())
587  return;
588 
589  TargetSP target_sp(process.GetTarget().GetSP());
590  if (!target_sp)
591  return;
592 
593  const uint32_t event_type = event.GetType();
594  char stdio_buffer[1024];
595  size_t len;
596 
597  std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
598 
599  if (event_type &
601  // Drain stdout when we stop just in case we have any bytes
602  while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0)
603  if (out_sp)
604  out_sp->Write(stdio_buffer, len);
605  }
606 
607  if (event_type &
609  // Drain stderr when we stop just in case we have any bytes
610  while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0)
611  if (err_sp)
612  err_sp->Write(stdio_buffer, len);
613  }
614 
615  if (event_type & Process::eBroadcastBitStateChanged) {
616  StateType event_state = SBProcess::GetStateFromEvent(event);
617 
618  if (event_state == eStateInvalid)
619  return;
620 
621  bool is_stopped = StateIsStoppedState(event_state);
622  if (!is_stopped)
623  process.ReportEventState(event, out_sp);
624  }
625 }
626 
630 
631  SBSourceManager sb_source_manager(*this);
632  return LLDB_RECORD_RESULT(sb_source_manager);
633 }
634 
635 bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
637  (char *, size_t), arch_name, "",
638  arch_name_len);
639 
640  if (arch_name && arch_name_len) {
641  ArchSpec default_arch = Target::GetDefaultArchitecture();
642 
643  if (default_arch.IsValid()) {
644  const std::string &triple_str = default_arch.GetTriple().str();
645  if (!triple_str.empty())
646  ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str());
647  else
648  ::snprintf(arch_name, arch_name_len, "%s",
649  default_arch.GetArchitectureName());
650  return true;
651  }
652  }
653  if (arch_name && arch_name_len)
654  arch_name[0] = '\0';
655  return false;
656 }
657 
658 bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
660  (const char *), arch_name);
661 
662  if (arch_name) {
663  ArchSpec arch(arch_name);
664  if (arch.IsValid()) {
666  return true;
667  }
668  }
669  return false;
670 }
671 
673 SBDebugger::GetScriptingLanguage(const char *script_language_name) {
675  (const char *), script_language_name);
676 
677  if (!script_language_name)
678  return eScriptLanguageDefault;
680  llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr);
681 }
682 
685 
686  return lldb_private::GetVersion();
687 }
688 
691  (lldb::StateType), state);
692 
693  return lldb_private::StateAsCString(state);
694 }
695 
697  llvm::StringRef name, bool value,
698  llvm::StringRef description) {
699  auto entry_up = std::make_unique<StructuredData::Dictionary>();
700  entry_up->AddBooleanItem("value", value);
701  entry_up->AddStringItem("description", description);
702  dict.AddItem(name, std::move(entry_up));
703 }
704 
706  auto array_up = std::make_unique<StructuredData::Array>();
707 #define LLVM_TARGET(target) \
708  array_up->AddItem(std::make_unique<StructuredData::String>(#target));
709 #include "llvm/Config/Targets.def"
710  auto entry_up = std::make_unique<StructuredData::Dictionary>();
711  entry_up->AddItem("value", std::move(array_up));
712  entry_up->AddStringItem("description", "A list of configured LLVM targets.");
713  dict.AddItem("targets", std::move(entry_up));
714 }
715 
719 
720  auto config_up = std::make_unique<StructuredData::Dictionary>();
722  *config_up, "xml", XMLDocument::XMLEnabled(),
723  "A boolean value that indicates if XML support is enabled in LLDB");
725  *config_up, "curses", LLDB_ENABLE_CURSES,
726  "A boolean value that indicates if curses support is enabled in LLDB");
728  *config_up, "editline", LLDB_ENABLE_LIBEDIT,
729  "A boolean value that indicates if editline support is enabled in LLDB");
731  *config_up, "lzma", LLDB_ENABLE_LZMA,
732  "A boolean value that indicates if lzma support is enabled in LLDB");
734  *config_up, "python", LLDB_ENABLE_PYTHON,
735  "A boolean value that indicates if python support is enabled in LLDB");
737  *config_up, "lua", LLDB_ENABLE_LUA,
738  "A boolean value that indicates if lua support is enabled in LLDB");
739  AddLLVMTargets(*config_up);
740 
741  SBStructuredData data;
742  data.m_impl_up->SetObjectSP(std::move(config_up));
743  return LLDB_RECORD_RESULT(data);
744 }
745 
748  (lldb::StateType), state);
749 
750  const bool result = lldb_private::StateIsRunningState(state);
751 
752  return result;
753 }
754 
757  (lldb::StateType), state);
758 
759  const bool result = lldb_private::StateIsStoppedState(state, false);
760 
761  return result;
762 }
763 
765  const char *target_triple,
766  const char *platform_name,
767  bool add_dependent_modules,
768  lldb::SBError &sb_error) {
771  (const char *, const char *, const char *, bool, lldb::SBError &),
772  filename, target_triple, platform_name, add_dependent_modules, sb_error);
773 
774  SBTarget sb_target;
775  TargetSP target_sp;
776  if (m_opaque_sp) {
777  sb_error.Clear();
778  OptionGroupPlatform platform_options(false);
779  platform_options.SetPlatformName(platform_name);
780 
781  sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget(
782  *m_opaque_sp, filename, target_triple,
783  add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
784  &platform_options, target_sp);
785 
786  if (sb_error.Success())
787  sb_target.SetSP(target_sp);
788  } else {
789  sb_error.SetErrorString("invalid debugger");
790  }
791 
793  LLDB_LOGF(log,
794  "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
795  "platform_name=%s, add_dependent_modules=%u, error=%s) => "
796  "SBTarget(%p)",
797  static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
798  platform_name, add_dependent_modules, sb_error.GetCString(),
799  static_cast<void *>(target_sp.get()));
800 
801  return LLDB_RECORD_RESULT(sb_target);
802 }
803 
804 SBTarget
806  const char *target_triple) {
809  (const char *, const char *), filename, target_triple);
810 
811  SBTarget sb_target;
812  TargetSP target_sp;
813  if (m_opaque_sp) {
814  const bool add_dependent_modules = true;
815  Status error(m_opaque_sp->GetTargetList().CreateTarget(
816  *m_opaque_sp, filename, target_triple,
817  add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
818  target_sp));
819  sb_target.SetSP(target_sp);
820  }
821 
823  LLDB_LOGF(log,
824  "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
825  "(filename=\"%s\", triple=%s) => SBTarget(%p)",
826  static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
827  static_cast<void *>(target_sp.get()));
828 
829  return LLDB_RECORD_RESULT(sb_target);
830 }
831 
833  const char *arch_cstr) {
835  (const char *, const char *), filename, arch_cstr);
836 
838 
839  SBTarget sb_target;
840  TargetSP target_sp;
841  if (m_opaque_sp) {
842  Status error;
843  if (arch_cstr == nullptr) {
844  // The version of CreateTarget that takes an ArchSpec won't accept an
845  // empty ArchSpec, so when the arch hasn't been specified, we need to
846  // call the target triple version.
847  error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp, filename,
848  arch_cstr, eLoadDependentsYes, nullptr, target_sp);
849  } else {
850  PlatformSP platform_sp = m_opaque_sp->GetPlatformList()
851  .GetSelectedPlatform();
852  ArchSpec arch = Platform::GetAugmentedArchSpec(platform_sp.get(),
853  arch_cstr);
854  if (arch.IsValid())
855  error = m_opaque_sp->GetTargetList().CreateTarget(*m_opaque_sp, filename,
856  arch, eLoadDependentsYes, platform_sp, target_sp);
857  else
858  error.SetErrorStringWithFormat("invalid arch_cstr: %s", arch_cstr);
859  }
860  if (error.Success())
861  sb_target.SetSP(target_sp);
862  }
863 
864  LLDB_LOGF(log,
865  "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
866  "arch=%s) => SBTarget(%p)",
867  static_cast<void *>(m_opaque_sp.get()),
868  filename ? filename : "<unspecified>",
869  arch_cstr ? arch_cstr : "<unspecified>",
870  static_cast<void *>(target_sp.get()));
871 
872  return LLDB_RECORD_RESULT(sb_target);
873 }
874 
875 SBTarget SBDebugger::CreateTarget(const char *filename) {
877  filename);
878 
879  SBTarget sb_target;
880  TargetSP target_sp;
881  if (m_opaque_sp) {
882  Status error;
883  const bool add_dependent_modules = true;
884  error = m_opaque_sp->GetTargetList().CreateTarget(
885  *m_opaque_sp, filename, "",
886  add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
887  target_sp);
888 
889  if (error.Success())
890  sb_target.SetSP(target_sp);
891  }
893  LLDB_LOGF(log,
894  "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
895  static_cast<void *>(m_opaque_sp.get()), filename,
896  static_cast<void *>(target_sp.get()));
897  return LLDB_RECORD_RESULT(sb_target);
898 }
899 
902 
903  SBTarget sb_target;
904  if (m_opaque_sp) {
905  sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this());
906  }
908  LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
909  static_cast<void *>(m_opaque_sp.get()),
910  static_cast<void *>(sb_target.GetSP().get()));
911  return LLDB_RECORD_RESULT(sb_target);
912 }
913 
916  target);
917 
918  bool result = false;
919  if (m_opaque_sp) {
920  TargetSP target_sp(target.GetSP());
921  if (target_sp) {
922  // No need to lock, the target list is thread safe
923  result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
924  target_sp->Destroy();
925  target.Clear();
926  }
927  }
928 
930  LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
931  static_cast<void *>(m_opaque_sp.get()),
932  static_cast<void *>(target.m_opaque_sp.get()), result);
933 
934  return result;
935 }
936 
939  idx);
940 
941  SBTarget sb_target;
942  if (m_opaque_sp) {
943  // No need to lock, the target list is thread safe
944  sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx));
945  }
946  return LLDB_RECORD_RESULT(sb_target);
947 }
948 
951  target);
952 
953  lldb::TargetSP target_sp = target.GetSP();
954  if (!target_sp)
955  return UINT32_MAX;
956 
957  if (!m_opaque_sp)
958  return UINT32_MAX;
959 
960  return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
961 }
962 
965  (lldb::pid_t), pid);
966 
967  SBTarget sb_target;
968  if (m_opaque_sp) {
969  // No need to lock, the target list is thread safe
970  sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
971  }
972  return LLDB_RECORD_RESULT(sb_target);
973 }
974 
976  const char *arch_name) {
978  (const char *, const char *), filename, arch_name);
979 
980  SBTarget sb_target;
981  if (m_opaque_sp && filename && filename[0]) {
982  // No need to lock, the target list is thread safe
984  m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
985  TargetSP target_sp(
986  m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
987  FileSpec(filename), arch_name ? &arch : nullptr));
988  sb_target.SetSP(target_sp);
989  }
990  return LLDB_RECORD_RESULT(sb_target);
991 }
992 
993 SBTarget SBDebugger::FindTargetWithLLDBProcess(const ProcessSP &process_sp) {
994  SBTarget sb_target;
995  if (m_opaque_sp) {
996  // No need to lock, the target list is thread safe
997  sb_target.SetSP(
998  m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
999  }
1000  return sb_target;
1001 }
1002 
1005 
1006  if (m_opaque_sp) {
1007  // No need to lock, the target list is thread safe
1008  return m_opaque_sp->GetTargetList().GetNumTargets();
1009  }
1010  return 0;
1011 }
1012 
1015 
1017 
1018  SBTarget sb_target;
1019  TargetSP target_sp;
1020  if (m_opaque_sp) {
1021  // No need to lock, the target list is thread safe
1022  target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget();
1023  sb_target.SetSP(target_sp);
1024  }
1025 
1026  if (log) {
1027  SBStream sstr;
1028  sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1029  LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1030  static_cast<void *>(m_opaque_sp.get()),
1031  static_cast<void *>(target_sp.get()), sstr.GetData());
1032  }
1033 
1034  return LLDB_RECORD_RESULT(sb_target);
1035 }
1036 
1039  sb_target);
1040 
1042 
1043  TargetSP target_sp(sb_target.GetSP());
1044  if (m_opaque_sp) {
1045  m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1046  }
1047  if (log) {
1048  SBStream sstr;
1049  sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1050  LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1051  static_cast<void *>(m_opaque_sp.get()),
1052  static_cast<void *>(target_sp.get()), sstr.GetData());
1053  }
1054 }
1055 
1058 
1060 
1061  SBPlatform sb_platform;
1062  DebuggerSP debugger_sp(m_opaque_sp);
1063  if (debugger_sp) {
1064  sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1065  }
1066  LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1067  static_cast<void *>(m_opaque_sp.get()),
1068  static_cast<void *>(sb_platform.GetSP().get()),
1069  sb_platform.GetName());
1070  return LLDB_RECORD_RESULT(sb_platform);
1071 }
1072 
1075  (lldb::SBPlatform &), sb_platform);
1076 
1078 
1079  DebuggerSP debugger_sp(m_opaque_sp);
1080  if (debugger_sp) {
1081  debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
1082  }
1083 
1084  LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1085  static_cast<void *>(m_opaque_sp.get()),
1086  static_cast<void *>(sb_platform.GetSP().get()),
1087  sb_platform.GetName());
1088 }
1089 
1092 
1093  if (m_opaque_sp) {
1094  // No need to lock, the platform list is thread safe
1095  return m_opaque_sp->GetPlatformList().GetSize();
1096  }
1097  return 0;
1098 }
1099 
1102  (uint32_t), idx);
1103 
1104  SBPlatform sb_platform;
1105  if (m_opaque_sp) {
1106  // No need to lock, the platform list is thread safe
1107  sb_platform.SetSP(m_opaque_sp->GetPlatformList().GetAtIndex(idx));
1108  }
1109  return LLDB_RECORD_RESULT(sb_platform);
1110 }
1111 
1114 
1115  uint32_t idx = 0;
1116  while (true) {
1118  break;
1119  }
1120  ++idx;
1121  }
1122  // +1 for the host platform, which should always appear first in the list.
1123  return idx + 1;
1124 }
1125 
1129 
1130  SBStructuredData data;
1131  auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1132  llvm::StringRef name_str("name"), desc_str("description");
1133 
1134  if (idx == 0) {
1135  PlatformSP host_platform_sp(Platform::GetHostPlatform());
1136  platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1137  platform_dict->AddStringItem(
1138  desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1139  } else if (idx > 0) {
1140  const char *plugin_name =
1142  if (!plugin_name) {
1143  return LLDB_RECORD_RESULT(data);
1144  }
1145  platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1146 
1147  const char *plugin_desc =
1149  if (!plugin_desc) {
1150  return LLDB_RECORD_RESULT(data);
1151  }
1152  platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1153  }
1154 
1155  data.m_impl_up->SetObjectSP(
1156  StructuredData::ObjectSP(platform_dict.release()));
1157  return LLDB_RECORD_RESULT(data);
1158 }
1159 
1160 void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
1162  (void *, const void *, size_t), baton, data, data_len);
1163 
1164  DispatchInput(data, data_len);
1165 }
1166 
1167 void SBDebugger::DispatchInput(const void *data, size_t data_len) {
1168  LLDB_RECORD_DUMMY(void, SBDebugger, DispatchInput, (const void *, size_t),
1169  data, data_len);
1170 
1171  // Log *log(GetLogIfAllCategoriesSet (LIBLLDB_LOG_API));
1172  //
1173  // if (log)
1174  // LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\",
1175  // size_t=%" PRIu64 ")",
1176  // m_opaque_sp.get(),
1177  // (int) data_len,
1178  // (const char *) data,
1179  // (uint64_t)data_len);
1180  //
1181  // if (m_opaque_sp)
1182  // m_opaque_sp->DispatchInput ((const char *) data, data_len);
1183 }
1184 
1187 
1188  if (m_opaque_sp)
1189  m_opaque_sp->DispatchInputInterrupt();
1190 }
1191 
1194 
1195  if (m_opaque_sp)
1196  m_opaque_sp->DispatchInputEndOfFile();
1197 }
1198 
1201  reader);
1202 }
1203 
1204 void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1205  bool spawn_thread) {
1207  auto_handle_events, spawn_thread);
1208 
1209  if (m_opaque_sp) {
1211  options.SetAutoHandleEvents(auto_handle_events);
1212  options.SetSpawnThread(spawn_thread);
1213  m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1214  }
1215 }
1216 
1217 void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1218  bool spawn_thread,
1220  int &num_errors, bool &quit_requested,
1221  bool &stopped_for_crash)
1222 
1223 {
1225  (bool, bool, lldb::SBCommandInterpreterRunOptions &, int &,
1226  bool &, bool &),
1227  auto_handle_events, spawn_thread, options, num_errors,
1228  quit_requested, stopped_for_crash);
1229 
1230  if (m_opaque_sp) {
1231  options.SetAutoHandleEvents(auto_handle_events);
1232  options.SetSpawnThread(spawn_thread);
1233  CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1235  interp.RunCommandInterpreter(options.ref());
1236  num_errors = result.GetNumErrors();
1237  quit_requested =
1239  stopped_for_crash =
1241  }
1242 }
1243 
1245  const SBCommandInterpreterRunOptions &options) {
1248  (const lldb::SBCommandInterpreterRunOptions &), options);
1249 
1250  if (!m_opaque_sp)
1252 
1253  CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1255  interp.RunCommandInterpreter(options.ref());
1256 
1258 }
1259 
1261  const char *repl_options) {
1263  (lldb::LanguageType, const char *), language,
1264  repl_options);
1265 
1266  SBError error;
1267  if (m_opaque_sp)
1268  error.ref() = m_opaque_sp->RunREPL(language, repl_options);
1269  else
1270  error.SetErrorString("invalid debugger");
1271  return LLDB_RECORD_RESULT(error);
1272 }
1273 
1274 void SBDebugger::reset(const DebuggerSP &debugger_sp) {
1275  m_opaque_sp = debugger_sp;
1276 }
1277 
1278 Debugger *SBDebugger::get() const { return m_opaque_sp.get(); }
1279 
1281  assert(m_opaque_sp.get());
1282  return *m_opaque_sp;
1283 }
1284 
1285 const lldb::DebuggerSP &SBDebugger::get_sp() const { return m_opaque_sp; }
1286 
1289  (int), id);
1290 
1291  // No need to lock, the debugger list is thread safe
1292  SBDebugger sb_debugger;
1293  DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id);
1294  if (debugger_sp)
1295  sb_debugger.reset(debugger_sp);
1296  return LLDB_RECORD_RESULT(sb_debugger);
1297 }
1298 
1301 
1302  return (m_opaque_sp ? m_opaque_sp->GetInstanceName().AsCString() : nullptr);
1303 }
1304 
1305 SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
1306  const char *debugger_instance_name) {
1308  (const char *, const char *, const char *),
1309  var_name, value, debugger_instance_name);
1310 
1311  SBError sb_error;
1312  DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName(
1313  ConstString(debugger_instance_name)));
1314  Status error;
1315  if (debugger_sp) {
1316  ExecutionContext exe_ctx(
1317  debugger_sp->GetCommandInterpreter().GetExecutionContext());
1318  error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign,
1319  var_name, value);
1320  } else {
1321  error.SetErrorStringWithFormat("invalid debugger instance name '%s'",
1322  debugger_instance_name);
1323  }
1324  if (error.Fail())
1325  sb_error.SetError(error);
1326  return LLDB_RECORD_RESULT(sb_error);
1327 }
1328 
1331  const char *debugger_instance_name) {
1334  (const char *, const char *), var_name, debugger_instance_name);
1335 
1336  DebuggerSP debugger_sp(Debugger::FindDebuggerWithInstanceName(
1337  ConstString(debugger_instance_name)));
1338  Status error;
1339  if (debugger_sp) {
1340  ExecutionContext exe_ctx(
1341  debugger_sp->GetCommandInterpreter().GetExecutionContext());
1342  lldb::OptionValueSP value_sp(
1343  debugger_sp->GetPropertyValue(&exe_ctx, var_name, false, error));
1344  if (value_sp) {
1345  StreamString value_strm;
1346  value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
1347  const std::string &value_str = std::string(value_strm.GetString());
1348  if (!value_str.empty()) {
1349  StringList string_list;
1350  string_list.SplitIntoLines(value_str);
1351  return LLDB_RECORD_RESULT(SBStringList(&string_list));
1352  }
1353  }
1354  }
1355  return LLDB_RECORD_RESULT(SBStringList());
1356 }
1357 
1360 
1361  return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1362 }
1363 
1365  LLDB_RECORD_DUMMY(void, SBDebugger, SetTerminalWidth, (uint32_t), term_width);
1366 
1367  if (m_opaque_sp)
1368  m_opaque_sp->SetTerminalWidth(term_width);
1369 }
1370 
1371 const char *SBDebugger::GetPrompt() const {
1373 
1375 
1376  LLDB_LOGF(log, "SBDebugger(%p)::GetPrompt () => \"%s\"",
1377  static_cast<void *>(m_opaque_sp.get()),
1378  (m_opaque_sp ? m_opaque_sp->GetPrompt().str().c_str() : ""));
1379 
1380  return (m_opaque_sp ? ConstString(m_opaque_sp->GetPrompt()).GetCString()
1381  : nullptr);
1382 }
1383 
1384 void SBDebugger::SetPrompt(const char *prompt) {
1385  LLDB_RECORD_METHOD(void, SBDebugger, SetPrompt, (const char *), prompt);
1386 
1387  if (m_opaque_sp)
1388  m_opaque_sp->SetPrompt(llvm::StringRef(prompt));
1389 }
1390 
1391 const char *SBDebugger::GetReproducerPath() const {
1393 
1394  return (m_opaque_sp
1395  ? ConstString(m_opaque_sp->GetReproducerPath()).GetCString()
1396  : nullptr);
1397 }
1398 
1402 
1403  return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
1404 }
1405 
1408  (lldb::ScriptLanguage), script_lang);
1409 
1410  if (m_opaque_sp) {
1411  m_opaque_sp->SetScriptLanguage(script_lang);
1412  }
1413 }
1414 
1416  LLDB_RECORD_METHOD(bool, SBDebugger, SetUseExternalEditor, (bool), value);
1417 
1418  return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
1419 }
1420 
1423 
1424  return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
1425 }
1426 
1427 bool SBDebugger::SetUseColor(bool value) {
1428  LLDB_RECORD_METHOD(bool, SBDebugger, SetUseColor, (bool), value);
1429 
1430  return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
1431 }
1432 
1435 
1436  return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
1437 }
1438 
1440  LLDB_RECORD_METHOD(bool, SBDebugger, SetUseSourceCache, (bool), value);
1441 
1442  return (m_opaque_sp ? m_opaque_sp->SetUseSourceCache(value) : false);
1443 }
1444 
1447 
1448  return (m_opaque_sp ? m_opaque_sp->GetUseSourceCache() : false);
1449 }
1450 
1453  description);
1454 
1455  Stream &strm = description.ref();
1456 
1457  if (m_opaque_sp) {
1458  const char *name = m_opaque_sp->GetInstanceName().AsCString();
1459  user_id_t id = m_opaque_sp->GetID();
1460  strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
1461  } else
1462  strm.PutCString("No value");
1463 
1464  return true;
1465 }
1466 
1469 
1470  return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
1471 }
1472 
1473 SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {
1475  (const char *), platform_name_cstr);
1476 
1477  SBError sb_error;
1478  if (m_opaque_sp) {
1479  if (platform_name_cstr && platform_name_cstr[0]) {
1480  ConstString platform_name(platform_name_cstr);
1481  PlatformSP platform_sp(Platform::Find(platform_name));
1482 
1483  if (platform_sp) {
1484  // Already have a platform with this name, just select it
1485  m_opaque_sp->GetPlatformList().SetSelectedPlatform(platform_sp);
1486  } else {
1487  // We don't have a platform by this name yet, create one
1488  platform_sp = Platform::Create(platform_name, sb_error.ref());
1489  if (platform_sp) {
1490  // We created the platform, now append and select it
1491  bool make_selected = true;
1492  m_opaque_sp->GetPlatformList().Append(platform_sp, make_selected);
1493  }
1494  }
1495  } else {
1496  sb_error.ref().SetErrorString("invalid platform name");
1497  }
1498  } else {
1499  sb_error.ref().SetErrorString("invalid debugger");
1500  }
1501  return LLDB_RECORD_RESULT(sb_error);
1502 }
1503 
1504 bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {
1506  (const char *), sysroot);
1507 
1509  if (m_opaque_sp) {
1510  PlatformSP platform_sp(
1511  m_opaque_sp->GetPlatformList().GetSelectedPlatform());
1512 
1513  if (platform_sp) {
1514  if (log && sysroot)
1515  LLDB_LOGF(log, "SBDebugger::SetCurrentPlatformSDKRoot (\"%s\")",
1516  sysroot);
1517  platform_sp->SetSDKRootDirectory(ConstString(sysroot));
1518  return true;
1519  }
1520  }
1521  return false;
1522 }
1523 
1526 
1527  return (m_opaque_sp ? m_opaque_sp->GetCloseInputOnEOF() : false);
1528 }
1529 
1532 
1533  if (m_opaque_sp)
1534  m_opaque_sp->SetCloseInputOnEOF(b);
1535 }
1536 
1537 SBTypeCategory SBDebugger::GetCategory(const char *category_name) {
1539  (const char *), category_name);
1540 
1541  if (!category_name || *category_name == 0)
1543 
1544  TypeCategoryImplSP category_sp;
1545 
1547  category_sp, false)) {
1548  return LLDB_RECORD_RESULT(SBTypeCategory(category_sp));
1549  } else {
1551  }
1552 }
1553 
1556  (lldb::LanguageType), lang_type);
1557 
1558  TypeCategoryImplSP category_sp;
1559  if (DataVisualization::Categories::GetCategory(lang_type, category_sp)) {
1560  return LLDB_RECORD_RESULT(SBTypeCategory(category_sp));
1561  } else {
1563  }
1564 }
1565 
1566 SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {
1568  (const char *), category_name);
1569 
1570  if (!category_name || *category_name == 0)
1572 
1573  TypeCategoryImplSP category_sp;
1574 
1576  category_sp, true)) {
1577  return LLDB_RECORD_RESULT(SBTypeCategory(category_sp));
1578  } else {
1580  }
1581 }
1582 
1583 bool SBDebugger::DeleteCategory(const char *category_name) {
1584  LLDB_RECORD_METHOD(bool, SBDebugger, DeleteCategory, (const char *),
1585  category_name);
1586 
1587  if (!category_name || *category_name == 0)
1588  return false;
1589 
1590  return DataVisualization::Categories::Delete(ConstString(category_name));
1591 }
1592 
1595 
1597 }
1598 
1601  (uint32_t), index);
1602 
1603  return LLDB_RECORD_RESULT(
1605 }
1606 
1610 
1611  return LLDB_RECORD_RESULT(GetCategory("default"));
1612 }
1613 
1616  (lldb::SBTypeNameSpecifier), type_name);
1617 
1618  SBTypeCategory default_category_sb = GetDefaultCategory();
1619  if (default_category_sb.GetEnabled())
1620  return LLDB_RECORD_RESULT(default_category_sb.GetFormatForType(type_name));
1621  return LLDB_RECORD_RESULT(SBTypeFormat());
1622 }
1623 
1626  (lldb::SBTypeNameSpecifier), type_name);
1627 
1628  if (!type_name.IsValid())
1630  return LLDB_RECORD_RESULT(
1632 }
1633 
1636  (lldb::SBTypeNameSpecifier), type_name);
1637 
1638  if (!type_name.IsValid())
1639  return LLDB_RECORD_RESULT(SBTypeFilter());
1640  return LLDB_RECORD_RESULT(
1642 }
1643 
1646  (lldb::SBTypeNameSpecifier), type_name);
1647 
1648  if (!type_name.IsValid())
1652 }
1653 
1654 static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) {
1655  if (categories == nullptr)
1656  return {};
1657  size_t len = 0;
1658  while (categories[len] != nullptr)
1659  ++len;
1660  return llvm::makeArrayRef(categories, len);
1661 }
1662 
1663 bool SBDebugger::EnableLog(const char *channel, const char **categories) {
1664  LLDB_RECORD_METHOD(bool, SBDebugger, EnableLog, (const char *, const char **),
1665  channel, categories);
1666 
1667  if (m_opaque_sp) {
1668  uint32_t log_options =
1671  llvm::raw_string_ostream error_stream(error);
1672  return m_opaque_sp->EnableLog(channel, GetCategoryArray(categories), "",
1673  log_options, error_stream);
1674  } else
1675  return false;
1676 }
1677 
1679  void *baton) {
1681  (lldb::LogOutputCallback, void *), log_callback, baton);
1682 
1683  if (m_opaque_sp) {
1684  return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1685  }
1686 }
1687 
1688 namespace lldb_private {
1689 namespace repro {
1690 
1692  LLDB_REGISTER_METHOD(void, SBInputReader, SetIsDone, (bool));
1693  LLDB_REGISTER_METHOD_CONST(bool, SBInputReader, IsActive, ());
1694 }
1695 
1696 static void SetFileHandleRedirect(SBDebugger *, FILE *, bool) {
1697  // Do nothing.
1698 }
1699 
1700 static SBError SetFileRedirect(SBDebugger *, SBFile file) { return SBError(); }
1701 
1702 static SBError SetFileRedirect(SBDebugger *, FileSP file) { return SBError(); }
1703 
1705  // Custom implementation.
1706  R.Register(&invoke<void (SBDebugger::*)(FILE *, bool)>::method<
1709  R.Register(&invoke<void (SBDebugger::*)(FILE *, bool)>::method<
1712 
1714  SBFile)>::method<&SBDebugger::SetInputFile>::record,
1715  &SetFileRedirect);
1717  SBFile)>::method<&SBDebugger::SetOutputFile>::record,
1718  &SetFileRedirect);
1720  SBFile)>::method<&SBDebugger::SetErrorFile>::record,
1721  &SetFileRedirect);
1722 
1724  FileSP)>::method<&SBDebugger::SetInputFile>::record,
1725  &SetFileRedirect);
1727  FileSP)>::method<&SBDebugger::SetOutputFile>::record,
1728  &SetFileRedirect);
1730  FileSP)>::method<&SBDebugger::SetErrorFile>::record,
1731  &SetFileRedirect);
1732 
1734  GetDefaultArchitecture);
1735 
1737  LLDB_REGISTER_CONSTRUCTOR(SBDebugger, (const lldb::DebuggerSP &));
1740  SBDebugger, operator=,(const lldb::SBDebugger &));
1741  LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, Initialize, ());
1743  InitializeWithErrorHandling, ());
1744  LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, Terminate, ());
1745  LLDB_REGISTER_METHOD(void, SBDebugger, Clear, ());
1749  const char *, SBDebugger, GetProgressFromEvent,
1750  (const lldb::SBEvent &, uint64_t &, uint64_t &, uint64_t &, bool &));
1751  LLDB_REGISTER_STATIC_METHOD(const char *, SBDebugger, GetBroadcasterClass,
1752  ());
1753  LLDB_REGISTER_METHOD(SBBroadcaster, SBDebugger, GetBroadcaster, ());
1755  LLDB_REGISTER_STATIC_METHOD(void, SBDebugger, MemoryPressureDetected, ());
1756  LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, IsValid, ());
1757  LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, operator bool,());
1758  LLDB_REGISTER_METHOD(void, SBDebugger, SetAsync, (bool));
1759  LLDB_REGISTER_METHOD(bool, SBDebugger, GetAsync, ());
1760  LLDB_REGISTER_METHOD(void, SBDebugger, SkipLLDBInitFiles, (bool));
1761  LLDB_REGISTER_METHOD(void, SBDebugger, SkipAppInitFiles, (bool));
1762  LLDB_REGISTER_METHOD(void, SBDebugger, SetInputFileHandle, (FILE *, bool));
1763  LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetInputFileHandle, ());
1764  LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetOutputFileHandle, ());
1765  LLDB_REGISTER_METHOD(FILE *, SBDebugger, GetErrorFileHandle, ());
1766  LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetInputFile, ());
1767  LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetOutputFile, ());
1768  LLDB_REGISTER_METHOD(SBFile, SBDebugger, GetErrorFile, ());
1769  LLDB_REGISTER_METHOD(void, SBDebugger, SaveInputTerminalState, ());
1770  LLDB_REGISTER_METHOD(void, SBDebugger, RestoreInputTerminalState, ());
1772  GetCommandInterpreter, ());
1773  LLDB_REGISTER_METHOD(void, SBDebugger, HandleCommand, (const char *));
1776  void, SBDebugger, HandleProcessEvent,
1777  (const lldb::SBProcess &, const lldb::SBEvent &, FILE *, FILE *));
1779  void, SBDebugger, HandleProcessEvent,
1780  (const lldb::SBProcess &, const lldb::SBEvent &, SBFile, SBFile));
1782  void, SBDebugger, HandleProcessEvent,
1783  (const lldb::SBProcess &, const lldb::SBEvent &, FileSP, FileSP));
1784  LLDB_REGISTER_METHOD(lldb::SBSourceManager, SBDebugger, GetSourceManager, ());
1785  LLDB_REGISTER_STATIC_METHOD(bool, SBDebugger, SetDefaultArchitecture,
1786  (const char *));
1787  LLDB_REGISTER_METHOD(lldb::ScriptLanguage, SBDebugger, GetScriptingLanguage,
1788  (const char *));
1789  LLDB_REGISTER_STATIC_METHOD(const char *, SBDebugger, GetVersionString, ());
1791  (lldb::StateType));
1793  GetBuildConfiguration, ());
1795  (lldb::StateType));
1797  (lldb::StateType));
1799  lldb::SBTarget, SBDebugger, CreateTarget,
1800  (const char *, const char *, const char *, bool, lldb::SBError &));
1802  CreateTargetWithFileAndTargetTriple,
1803  (const char *, const char *));
1804  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, CreateTargetWithFileAndArch,
1805  (const char *, const char *));
1807  (const char *));
1808  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetDummyTarget, ());
1809  LLDB_REGISTER_METHOD(bool, SBDebugger, DeleteTarget, (lldb::SBTarget &));
1810  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetTargetAtIndex,
1811  (uint32_t));
1812  LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetIndexOfTarget,
1813  (lldb::SBTarget));
1814  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithProcessID,
1815  (lldb::pid_t));
1816  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, FindTargetWithFileAndArch,
1817  (const char *, const char *));
1818  LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumTargets, ());
1819  LLDB_REGISTER_METHOD(lldb::SBTarget, SBDebugger, GetSelectedTarget, ());
1820  LLDB_REGISTER_METHOD(void, SBDebugger, SetSelectedTarget, (lldb::SBTarget &));
1821  LLDB_REGISTER_METHOD(lldb::SBPlatform, SBDebugger, GetSelectedPlatform, ());
1822  LLDB_REGISTER_METHOD(void, SBDebugger, SetSelectedPlatform,
1823  (lldb::SBPlatform &));
1824  LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumPlatforms, ());
1825  LLDB_REGISTER_METHOD(lldb::SBPlatform, SBDebugger, GetPlatformAtIndex,
1826  (uint32_t));
1827  LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumAvailablePlatforms, ());
1829  GetAvailablePlatformInfoAtIndex, (uint32_t));
1830  LLDB_REGISTER_METHOD(void, SBDebugger, DispatchInputInterrupt, ());
1831  LLDB_REGISTER_METHOD(void, SBDebugger, DispatchInputEndOfFile, ());
1832  LLDB_REGISTER_METHOD(void, SBDebugger, PushInputReader,
1833  (lldb::SBInputReader &));
1834  LLDB_REGISTER_METHOD(void, SBDebugger, RunCommandInterpreter, (bool, bool));
1835  LLDB_REGISTER_METHOD(void, SBDebugger, RunCommandInterpreter,
1836  (bool, bool, lldb::SBCommandInterpreterRunOptions &,
1837  int &, bool &, bool &));
1839  (lldb::LanguageType, const char *));
1841  (int));
1842  LLDB_REGISTER_METHOD(const char *, SBDebugger, GetInstanceName, ());
1844  (const char *, const char *, const char *));
1846  GetInternalVariableValue,
1847  (const char *, const char *));
1848  LLDB_REGISTER_METHOD_CONST(uint32_t, SBDebugger, GetTerminalWidth, ());
1849  LLDB_REGISTER_METHOD(void, SBDebugger, SetTerminalWidth, (uint32_t));
1850  LLDB_REGISTER_METHOD_CONST(const char *, SBDebugger, GetPrompt, ());
1851  LLDB_REGISTER_METHOD(void, SBDebugger, SetPrompt, (const char *));
1852  LLDB_REGISTER_METHOD_CONST(const char *, SBDebugger, GetReproducerPath, ());
1854  GetScriptLanguage, ());
1855  LLDB_REGISTER_METHOD(void, SBDebugger, SetScriptLanguage,
1857  LLDB_REGISTER_METHOD(bool, SBDebugger, SetUseExternalEditor, (bool));
1858  LLDB_REGISTER_METHOD(bool, SBDebugger, GetUseExternalEditor, ());
1859  LLDB_REGISTER_METHOD(bool, SBDebugger, SetUseColor, (bool));
1860  LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, GetUseColor, ());
1861  LLDB_REGISTER_METHOD(bool, SBDebugger, GetDescription, (lldb::SBStream &));
1863  LLDB_REGISTER_METHOD(lldb::SBError, SBDebugger, SetCurrentPlatform,
1864  (const char *));
1865  LLDB_REGISTER_METHOD(bool, SBDebugger, SetCurrentPlatformSDKRoot,
1866  (const char *));
1867  LLDB_REGISTER_METHOD_CONST(bool, SBDebugger, GetCloseInputOnEOF, ());
1868  LLDB_REGISTER_METHOD(void, SBDebugger, SetCloseInputOnEOF, (bool));
1870  (const char *));
1872  (lldb::LanguageType));
1874  (const char *));
1875  LLDB_REGISTER_METHOD(bool, SBDebugger, DeleteCategory, (const char *));
1876  LLDB_REGISTER_METHOD(uint32_t, SBDebugger, GetNumCategories, ());
1878  (uint32_t));
1880  ());
1889  LLDB_REGISTER_METHOD(bool, SBDebugger, EnableLog,
1890  (const char *, const char **));
1892  RunCommandInterpreter,
1894 }
1895 
1896 } // namespace repro
1897 } // namespace lldb_private
lldb::SBCommandInterpreterRunOptions::SetSpawnThread
void SetSpawnThread(bool)
Definition: SBCommandInterpreterRunOptions.cpp:184
lldb::SBStringList
Definition: SBStringList.h:16
SBTypeSynthetic.h
lldb::SBDebugger::StateAsCString
static const char * StateAsCString(lldb::StateType state)
Definition: SBDebugger.cpp:689
lldb::SBDebugger::HandleCommand
void HandleCommand(const char *command)
Definition: SBDebugger.cpp:510
LLDB_LOG_OPTION_PREPEND_THREAD_NAME
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME
Definition: Log.h:41
SBCommandInterpreterRunOptions.h
lldb::SBDebugger::ref
lldb_private::Debugger & ref() const
Definition: SBDebugger.cpp:1280
lldb_private::PluginManager::GetPlatformPluginNameAtIndex
static const char * GetPlatformPluginNameAtIndex(uint32_t idx)
Definition: PluginManager.cpp:785
lldb::SBDebugger::GetProgressFromEvent
static const char * GetProgressFromEvent(const lldb::SBEvent &event, uint64_t &progress_id, uint64_t &completed, uint64_t &total, bool &is_debugger_specific)
Get progress data from a SBEvent whose type is eBroadcastBitProgress.
Definition: SBDebugger.cpp:160
SystemLifetimeManager.h
lldb::SBDebugger::GetOutputFile
SBFile GetOutputFile()
Definition: SBDebugger.cpp:457
LLDB_RECORD_STATIC_METHOD_NO_ARGS
#define LLDB_RECORD_STATIC_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:174
lldb::SBCommandInterpreterRunResult
Definition: SBCommandInterpreterRunOptions.h:85
lldb::SBDebugger::GetOutputFileHandle
FILE * GetOutputFileHandle()
Definition: SBDebugger.cpp:448
lldb::SBDebugger::GetNumCategories
uint32_t GetNumCategories()
Definition: SBDebugger.cpp:1593
lldb::SBDebugger::SetInputFile
SBError SetInputFile(SBFile file)
Definition: SBDebugger.cpp:341
lldb_private::ExecutionContext
Definition: ExecutionContext.h:292
lldb::SBEvent::get
lldb_private::Event * get() const
Definition: SBEvent.cpp:139
lldb::SBDebugger::SetInputFileHandle
void SetInputFileHandle(FILE *f, bool transfer_ownership)
Definition: SBDebugger.cpp:327
lldb::SBTypeNameSpecifier
Definition: SBTypeNameSpecifier.h:17
lldb::SBCommandReturnObject::PutOutput
size_t PutOutput(FILE *fh)
Definition: SBCommandReturnObject.cpp:117
lldb::SBDebugger::DispatchInputEndOfFile
void DispatchInputEndOfFile()
Definition: SBDebugger.cpp:1192
lldb::SBCommandInterpreter::SourceInitFileInHomeDirectory
void SourceInitFileInHomeDirectory(lldb::SBCommandReturnObject &result)
Definition: SBCommandInterpreter.cpp:454
lldb::SBStream::ref
lldb_private::Stream & ref()
Definition: SBStream.cpp:178
lldb_private::DataVisualization::Categories::GetCount
static uint32_t GetCount()
Definition: DataVisualization.cpp:161
lldb::SBDebugger::RunCommandInterpreter
void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread)
Run the command interpreter.
Definition: SBDebugger.cpp:1204
lldb::ScriptLanguage
ScriptLanguage
Script interpreter types.
Definition: lldb-enumerations.h:216
lldb_private::StructuredData::Dictionary
Definition: StructuredData.h:352
lldb::SBProcess::GetStateFromEvent
static lldb::StateType GetStateFromEvent(const lldb::SBEvent &event)
Definition: SBProcess.cpp:743
lldb::SBDebugger::GetDummyTarget
lldb::SBTarget GetDummyTarget()
Definition: SBDebugger.cpp:900
lldb_private::ArchSpec
Definition: ArchSpec.h:33
lldb::SBDebugger::GetBroadcasterClass
static const char * GetBroadcasterClass()
Definition: SBDebugger.cpp:153
lldb::SBFile::m_opaque_sp
FileSP m_opaque_sp
Definition: SBFile.h:45
lldb::SBDebugger::StateIsStoppedState
static bool StateIsStoppedState(lldb::StateType state)
Definition: SBDebugger.cpp:755
lldb::SBTypeFilter
Definition: SBTypeFilter.h:17
lldb::SBCommandInterpreter::get
lldb_private::CommandInterpreter * get()
Definition: SBCommandInterpreter.cpp:442
lldb::SBDebugger::GetInputFile
SBFile GetInputFile()
Definition: SBDebugger.cpp:440
lldb::SBDebugger::GetSourceManager
lldb::SBSourceManager GetSourceManager()
Definition: SBDebugger.cpp:627
lldb::SBDebugger::GetIndexOfTarget
uint32_t GetIndexOfTarget(lldb::SBTarget target)
Definition: SBDebugger.cpp:949
lldb_private::Platform::Find
static lldb::PlatformSP Find(ConstString name)
Definition: Platform.cpp:274
SBTypeSummary.h
lldb::SBDebugger::SkipLLDBInitFiles
void SkipLLDBInitFiles(bool b)
Definition: SBDebugger.cpp:313
lldb_private::CommandInterpreter::SkipAppInitFiles
void SkipAppInitFiles(bool skip_app_init_files)
Definition: CommandInterpreter.h:476
lldb::SBDebugger::SetCurrentPlatform
lldb::SBError SetCurrentPlatform(const char *platform_name)
Definition: SBDebugger.cpp:1473
lldb::SBDebugger::GetUseExternalEditor
bool GetUseExternalEditor()
Definition: SBDebugger.cpp:1421
lldb_private::repro::SetFileRedirect
static SBError SetFileRedirect(SBDebugger *, FileSP file)
Definition: SBDebugger.cpp:1702
lldb::SBError::GetCString
const char * GetCString() const
Definition: SBError.cpp:39
lldb::SBDebugger::Clear
void Clear()
Definition: SBDebugger.cpp:211
lldb::SBDebugger::GetTerminalWidth
uint32_t GetTerminalWidth() const
Definition: SBDebugger.cpp:1358
lldb::SBDebugger::GetErrorFileHandle
FILE * GetErrorFileHandle()
Definition: SBDebugger.cpp:466
lldb_private::repro::RegisterMethods< SBInputReader >
void RegisterMethods< SBInputReader >(Registry &R)
Definition: SBDebugger.cpp:1691
LLDB_RECORD_RESULT
#define LLDB_RECORD_RESULT(Result)
Definition: ReproducerInstrumentation.h:211
lldb::SBError
class LLDB_API SBError
Definition: SBDefines.h:40
lldb::SBDebugger::GetUseColor
bool GetUseColor() const
Definition: SBDebugger.cpp:1433
lldb::SBCommandReturnObject
Definition: SBCommandReturnObject.h:24
lldb::LogOutputCallback
void(* LogOutputCallback)(const char *, void *baton)
Definition: lldb-types.h:70
lldb_private::DataVisualization::Categories::GetCategory
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
Definition: DataVisualization.cpp:76
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::Process::eBroadcastBitSTDOUT
@ eBroadcastBitSTDOUT
Definition: Process.h:359
lldb::SBDebugger::Create
static lldb::SBDebugger Create()
Definition: SBDebugger.cpp:220
lldb::SBDebugger::SetOutputFile
SBError SetOutputFile(SBFile file)
Definition: SBDebugger.cpp:390
lldb_private::FileSystem::Fopen
FILE * Fopen(const char *path, const char *mode)
Wraps ::fopen in a platform-independent way.
Definition: FileSystemPosix.cpp:74
lldb::SBProcess::IsValid
bool IsValid() const
Definition: SBProcess.cpp:116
lldb_private::CommandInterpreterRunOptions::SetSpawnThread
void SetSpawnThread(bool spawn_thread)
Definition: CommandInterpreter.h:179
lldb::SBTypeSynthetic
class LLDB_API SBTypeSynthetic
Definition: SBDefines.h:89
lldb::SBCommandInterpreter
Definition: SBCommandInterpreter.h:19
SBStringList.h
LIBLLDB_LOG_API
#define LIBLLDB_LOG_API
Definition: Logging.h:30
lldb::SBInputReader
Definition: SBDebugger.h:19
LLDB_INVALID_UID
#define LLDB_INVALID_UID
Definition: lldb-defines.h:92
lldb_private::repro::MultiLoader::Create
static std::unique_ptr< MultiLoader > Create(Loader *loader)
Definition: ReproducerProvider.h:358
LLDB_RECORD_METHOD_NO_ARGS
#define LLDB_RECORD_METHOD_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:165
LLDB_LOGF
#define LLDB_LOGF(log,...)
Definition: Log.h:249
lldb_private::CommandInterpreterRunResult
Definition: CommandInterpreter.h:34
lldb::SBDebugger::GetSelectedTarget
lldb::SBTarget GetSelectedTarget()
Definition: SBDebugger.cpp:1013
lldb::SBTypeCategory::GetEnabled
bool GetEnabled()
Definition: SBTypeCategory.cpp:54
lldb::SBDebugger::GetListener
lldb::SBListener GetListener()
Definition: SBDebugger.cpp:543
lldb::SBInputReader::Initialize
SBError Initialize(lldb::SBDebugger &sb_debugger, unsigned long(*callback)(void *, lldb::SBInputReader *, lldb::InputReaderAction, char const *, unsigned long), void *a, lldb::InputReaderGranularity b, char const *c, char const *d, bool e)
Definition: SBDebugger.cpp:102
lldb::SBTypeSummary
class LLDB_API SBTypeSummary
Definition: SBDefines.h:87
lldb_private::StateAsCString
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition: State.cpp:14
lldb::LanguageType
LanguageType
Programming language type.
Definition: lldb-enumerations.h:436
LLDB_RECORD_CONSTRUCTOR_NO_ARGS
#define LLDB_RECORD_CONSTRUCTOR_NO_ARGS(Class)
Definition: ReproducerInstrumentation.h:136
lldb::SBDebugger::GetInstanceName
const char * GetInstanceName()
Definition: SBDebugger.cpp:1299
lldb_private::StateIsRunningState
bool StateIsRunningState(lldb::StateType state)
Check if a state represents a state where the process or thread is running.
Definition: State.cpp:68
OptionArgParser.h
lldb::SBDebugger::MemoryPressureDetected
static void MemoryPressureDetected()
Definition: SBDebugger.cpp:277
lldb_private::ConstString::AsCString
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
Definition: ConstString.h:193
lldb_private::OptionArgParser::ToScriptLanguage
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)
Definition: OptionArgParser.cpp:123
lldb_private::repro::invoke
To be used as the "Runtime ID" of a member function.
Definition: ReproducerInstrumentation.h:948
LLDB_REGISTER_METHOD_CONST
#define LLDB_REGISTER_METHOD_CONST(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:98
lldb_private::Debugger::CreateInstance
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
Definition: Debugger.cpp:593
lldb_private::StringList::SplitIntoLines
size_t SplitIntoLines(const std::string &lines)
Definition: StringList.cpp:146
lldb::SBDebugger::SetErrorFile
SBError SetErrorFile(SBFile file)
Definition: SBDebugger.cpp:416
lldb::SBDebugger::DeleteTarget
bool DeleteTarget(lldb::SBTarget &target)
Definition: SBDebugger.cpp:914
lldb_private::repro::DataRecorder
Recorder that records its data as text to a file.
Definition: ReproducerProvider.h:55
lldb_private::FileSystem::Exists
bool Exists(const FileSpec &file_spec) const
Returns whether the given file exists.
Definition: common/FileSystem.cpp:170
lldb::SBDebugger::GetNumAvailablePlatforms
uint32_t GetNumAvailablePlatforms()
Get the number of available platforms.
Definition: SBDebugger.cpp:1112
lldb::SBEvent
Definition: SBEvent.h:21
lldb::SBProcess
Definition: SBProcess.h:23
lldb::SBDebugger::GetFilterForType
SBTypeFilter GetFilterForType(SBTypeNameSpecifier)
Definition: SBDebugger.cpp:1634
lldb::SBProcess::ReportEventState
void ReportEventState(const lldb::SBEvent &event, FILE *out) const
Definition: SBProcess.cpp:321
lldb::SBListener::reset
void reset(lldb::ListenerSP listener_sp)
Definition: SBListener.cpp:321
lldb_private::Stream
Definition: Stream.h:28
lldb_private::Debugger::ProgressEventData::GetCompleted
uint64_t GetCompleted() const
Definition: Debugger.h:105
lldb_private::ArchSpec::GetTriple
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition: ArchSpec.h:444
SBReproducerPrivate.h
lldb::SBCommandInterpreterRunOptions::SetAutoHandleEvents
void SetAutoHandleEvents(bool)
Definition: SBCommandInterpreterRunOptions.cpp:169
lldb::SBPlatform::GetName
const char * GetName()
Definition: SBPlatform.cpp:369
lldb::SBProcess::GetSTDOUT
size_t GetSTDOUT(char *dst, size_t dst_len) const
Definition: SBProcess.cpp:272
lldb::SBStringList
class LLDB_API SBStringList
Definition: SBDefines.h:69
LLDB_REGISTER_CONSTRUCTOR
#define LLDB_REGISTER_CONSTRUCTOR(Class, Signature)
Definition: ReproducerInstrumentation.h:89
lldb::SBDebugger::GetDescription
bool GetDescription(lldb::SBStream &description)
Definition: SBDebugger.cpp:1451
lldb::SBCommandInterpreter::HandleCommand
lldb::ReturnStatus HandleCommand(const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history=false)
Definition: SBCommandInterpreter.cpp:155
lldb_private::DataVisualization::Categories::Delete
static bool Delete(ConstString category)
Definition: DataVisualization.cpp:95
Debugger.h
lldb_private::CommandInterpreterRunOptions
Definition: CommandInterpreter.h:59
lldb::SBTypeSummary
Definition: SBTypeSummary.h:57
SBListener.h
lldb_private::repro::RegisterMethods< SBDebugger >
void RegisterMethods< SBDebugger >(Registry &R)
Definition: SBDebugger.cpp:1704
lldb::SBDebugger::SetPrompt
void SetPrompt(const char *prompt)
Definition: SBDebugger.cpp:1384
lldb_private::Process::eBroadcastBitSTDERR
@ eBroadcastBitSTDERR
Definition: Process.h:360
SBSourceManager.h
lldb_private::StreamString::GetString
llvm::StringRef GetString() const
Definition: StreamString.cpp:51
lldb_private::CommandInterpreter::RunCommandInterpreter
CommandInterpreterRunResult RunCommandInterpreter(CommandInterpreterRunOptions &options)
lldb::SBStructuredData::m_impl_up
StructuredDataImplUP m_impl_up
Definition: SBStructuredData.h:104
lldb_private::OptionGroupPlatform
Definition: OptionGroupPlatform.h:21
lldb::SBDebugger::SetAsync
void SetAsync(bool b)
Definition: SBDebugger.cpp:300
lldb::SBDebugger::CreateCategory
SBTypeCategory CreateCategory(const char *category_name)
Definition: SBDebugger.cpp:1566
lldb::SBDebugger::GetDefaultCategory
SBTypeCategory GetDefaultCategory()
Definition: SBDebugger.cpp:1607
Process.h
lldb::eScriptLanguageNone
@ eScriptLanguageNone
Definition: lldb-enumerations.h:217
lldb::SBDebugger::GetVersionString
static const char * GetVersionString()
Definition: SBDebugger.cpp:683
lldb::SBDebugger::CreateTargetWithFileAndTargetTriple
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
Definition: SBDebugger.cpp:805
lldb_private::repro::SetFileHandleRedirect
static void SetFileHandleRedirect(SBDebugger *, FILE *, bool)
Definition: SBDebugger.cpp:1696
lldb::SBDebugger::SetSelectedTarget
void SetSelectedTarget(SBTarget &target)
Definition: SBDebugger.cpp:1037
lldb::SBDebugger::SetErrorFileHandle
void SetErrorFileHandle(FILE *f, bool transfer_ownership)
Definition: SBDebugger.cpp:405
lldb::SBDebugger::SetUseColor
bool SetUseColor(bool use_color)
Definition: SBDebugger.cpp:1427
lldb_private::OptionGroupPlatform::SetPlatformName
void SetPlatformName(const char *platform_name)
Definition: OptionGroupPlatform.h:43
lldb::SBTarget
Definition: SBTarget.h:29
lldb::SBDebugger::SetScriptLanguage
void SetScriptLanguage(lldb::ScriptLanguage script_lang)
Definition: SBDebugger.cpp:1406
lldb_private::PluginManager::GetPlatformPluginDescriptionAtIndex
static const char * GetPlatformPluginDescriptionAtIndex(uint32_t idx)
Definition: PluginManager.cpp:789
lldb::SBDebugger::GetCategory
SBTypeCategory GetCategory(const char *category_name)
Definition: SBDebugger.cpp:1537
lldb_private::FileSpec
Definition: FileSpec.h:56
lldb_private::Platform::GetHostPlatform
static lldb::PlatformSP GetHostPlatform()
Get the native host platform plug-in.
Definition: Platform.cpp:135
error
static llvm::raw_ostream & error(Stream &strm)
Definition: CommandReturnObject.cpp:17
SystemInitializerFull.h
lldb::SBError::Success
bool Success() const
Definition: SBError.cpp:65
SBStream.h
lldb_private::Debugger::GetStaticBroadcasterClass
static ConstString GetStaticBroadcasterClass()
Definition: Debugger.cpp:676
TargetList.h
lldb_private::DataVisualization::GetSyntheticForType
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:64
lldb::SBFile
Definition: SBFile.h:16
lldb::SBError::Clear
void Clear()
Definition: SBError.cpp:47
lldb::SBDebugger::IsValid
bool IsValid() const
Definition: SBDebugger.cpp:290
lldb::SBDebugger::GetAvailablePlatformInfoAtIndex
lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx)
Get the name and description of one of the available platforms.
Definition: SBDebugger.cpp:1126
lldb::InputReaderAction
InputReaderAction
Definition: lldb-enumerations.h:385
lldb_private::StateIsStoppedState
bool StateIsStoppedState(lldb::StateType state, bool must_exist)
Check if a state represents a state where the process or thread is stopped.
Definition: State.cpp:89
AddLLVMTargets
static void AddLLVMTargets(StructuredData::Dictionary &dict)
Definition: SBDebugger.cpp:705
lldb::SBCommandInterpreterRunOptions::ref
lldb_private::CommandInterpreterRunOptions & ref() const
Definition: SBCommandInterpreterRunOptions.cpp:197
LLDB_RECORD_METHOD
#define LLDB_RECORD_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:158
lldb::SBDebugger::InitializeWithErrorHandling
static lldb::SBError InitializeWithErrorHandling()
Definition: SBDebugger.cpp:193
lldb::SBDebugger
Definition: SBDebugger.h:34
SBThread.h
Args.h
lldb::SBDebugger::GetCloseInputOnEOF
bool GetCloseInputOnEOF() const
Definition: SBDebugger.cpp:1524
lldb::SBDebugger::SetInternalVariable
static lldb::SBError SetInternalVariable(const char *var_name, const char *value, const char *debugger_instance_name)
Definition: SBDebugger.cpp:1305
lldb::SBDebugger::GetInputFileHandle
FILE * GetInputFileHandle()
Definition: SBDebugger.cpp:431
lldb_private::eLoadDependentsNo
@ eLoadDependentsNo
Definition: Target.h:64
lldb::SBDebugger::SetSelectedPlatform
void SetSelectedPlatform(lldb::SBPlatform &platform)
Definition: SBDebugger.cpp:1073
lldb::SBPlatform::GetSP
lldb::PlatformSP GetSP() const
Definition: SBPlatform.cpp:378
lldb::SBCommandReturnObject::PutError
size_t PutError(FILE *fh)
Definition: SBCommandReturnObject.cpp:142
lldb::SBProcess::GetSTDERR
size_t GetSTDERR(char *dst, size_t dst_len) const
Definition: SBProcess.cpp:286
SBFrame.h
Progress.h
lldb_private::StructuredData::ObjectSP
std::shared_ptr< Object > ObjectSP
Definition: StructuredData.h:59
lldb::SBDebugger::GetNumPlatforms
uint32_t GetNumPlatforms()
Get the number of currently active platforms.
Definition: SBDebugger.cpp:1090
lldb::SBDebugger::GetSyntheticForType
SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier)
Definition: SBDebugger.cpp:1644
lldb::SBTypeFormat
Definition: SBTypeFormat.h:17
lldb::SBDebugger::GetReproducerPath
const char * GetReproducerPath() const
Definition: SBDebugger.cpp:1391
lldb_private::StringList
Definition: StringList.h:25
SBBroadcaster.h
lldb_private::ConstString
Definition: ConstString.h:40
lldb_private::XMLDocument::XMLEnabled
static bool XMLEnabled()
Definition: XML.cpp:81
lldb::SBDebugger::GetScriptLanguage
lldb::ScriptLanguage GetScriptLanguage() const
Definition: SBDebugger.cpp:1399
lldb_private::StreamString
Definition: StreamString.h:23
lldb::SBError::SetErrorString
void SetErrorString(const char *err_str)
Definition: SBError.cpp:124
lldb::SBDebugger::GetPrompt
const char * GetPrompt() const
Definition: SBDebugger.cpp:1371
lldb::SBDebugger::SetTerminalWidth
void SetTerminalWidth(uint32_t term_width)
Definition: SBDebugger.cpp:1364
lldb::SBDebugger::RestoreInputTerminalState
void RestoreInputTerminalState()
Definition: SBDebugger.cpp:493
lldb::SBDebugger::GetErrorFile
SBFile GetErrorFile()
Definition: SBDebugger.cpp:476
lldb::SBFile
class LLDB_API SBFile
Definition: SBDefines.h:45
lldb::SBDebugger::StateIsRunningState
static bool StateIsRunningState(lldb::StateType state)
Definition: SBDebugger.cpp:746
AddBoolConfigEntry
static void AddBoolConfigEntry(StructuredData::Dictionary &dict, llvm::StringRef name, bool value, llvm::StringRef description)
Definition: SBDebugger.cpp:696
OptionGroupPlatform.h
lldb_private::GetLogIfAllCategoriesSet
Log * GetLogIfAllCategoriesSet(uint32_t mask)
Definition: Logging.cpp:58
lldb::SBDebugger::RunREPL
SBError RunREPL(lldb::LanguageType language, const char *repl_options)
Definition: SBDebugger.cpp:1260
lldb_private::ModuleList::RemoveOrphanSharedModules
static size_t RemoveOrphanSharedModules(bool mandatory)
Definition: ModuleList.cpp:740
LLDB_RECORD_DUMMY_NO_ARGS
#define LLDB_RECORD_DUMMY_NO_ARGS(Result, Class, Method)
Definition: ReproducerInstrumentation.h:219
lldb::SBDebugger::PushInputReader
void PushInputReader(lldb::SBInputReader &reader)
Definition: SBDebugger.cpp:1199
lldb_private::Debugger::ProgressEventData
Definition: Debugger.h:87
lldb_private::CommandInterpreter
Definition: CommandInterpreter.h:214
SBDebugger.h
lldb_private::File
Definition: File.h:35
LLDB_REGISTER_CHAR_PTR_METHOD_STATIC
#define LLDB_REGISTER_CHAR_PTR_METHOD_STATIC(Result, Class, Method)
Definition: ReproducerInstrumentation.h:107
lldb::SBDebugger::FindTargetWithLLDBProcess
lldb::SBTarget FindTargetWithLLDBProcess(const lldb::ProcessSP &processSP)
Definition: SBDebugger.cpp:993
lldb_private::Debugger
Definition: Debugger.h:70
lldb::SBDebugger::EnableLog
bool EnableLog(const char *channel, const char **categories)
Definition: SBDebugger.cpp:1663
lldb_private::OptionValue::eDumpOptionValue
@ eDumpOptionValue
Definition: OptionValue.h:53
LLDB_REGISTER_STATIC_METHOD
#define LLDB_REGISTER_STATIC_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:103
lldb::SBDebugger::GetID
lldb::user_id_t GetID()
Definition: SBDebugger.cpp:1467
lldb::SBDebugger::GetSummaryForType
SBTypeSummary GetSummaryForType(SBTypeNameSpecifier)
Definition: SBDebugger.cpp:1624
string
string(SUBSTRING ${p} 10 -1 pStripped) if($
Definition: Plugins/CMakeLists.txt:40
lldb::SBDebugger::GetUseSourceCache
bool GetUseSourceCache() const
Definition: SBDebugger.cpp:1445
lldb::SBDebugger::reset
void reset(const lldb::DebuggerSP &debugger_sp)
Definition: SBDebugger.cpp:1274
lldb::SBTarget::Clear
void Clear()
Definition: SBTarget.cpp:1671
lldb::SBDebugger::GetPlatformAtIndex
lldb::SBPlatform GetPlatformAtIndex(uint32_t idx)
Get one of the currently active platforms.
Definition: SBDebugger.cpp:1100
lldb_private::ArchSpec::IsValid
bool IsValid() const
Tests if this ArchSpec is valid.
Definition: ArchSpec.h:342
lldb::SBDebugger::GetAsync
bool GetAsync()
Definition: SBDebugger.cpp:307
lldb_private::Debugger::ProgressEventData::GetTotal
uint64_t GetTotal() const
Definition: Debugger.h:106
lldb::SBError::SetError
void SetError(uint32_t err, lldb::ErrorType type)
Definition: SBError.cpp:97
lldb_private::CommandInterpreterRunResult::IsResult
bool IsResult(lldb::CommandInterpreterResult result)
Definition: CommandInterpreter.h:42
SBTypeNameSpecifier.h
lldb::SBDebugger::SaveInputTerminalState
void SaveInputTerminalState()
Definition: SBDebugger.cpp:486
lldb::SBDebugger::GetNumTargets
uint32_t GetNumTargets()
Definition: SBDebugger.cpp:1003
lldb::SBTypeCategory::GetFormatForType
SBTypeFormat GetFormatForType(SBTypeNameSpecifier)
Definition: SBTypeCategory.cpp:215
lldb::SBDebugger::~SBDebugger
~SBDebugger()
lldb_private::repro::Registry::Register
void Register(Signature *f, llvm::StringRef result={}, llvm::StringRef scope={}, llvm::StringRef name={}, llvm::StringRef args={})
Register a default replayer for a function.
Definition: ReproducerInstrumentation.h:538
lldb::SBDebugger::Destroy
static void Destroy(lldb::SBDebugger &debugger)
Definition: SBDebugger.cpp:267
lldb::SBDebugger::operator=
lldb::SBDebugger & operator=(const lldb::SBDebugger &rhs)
Definition: SBDebugger.cpp:143
lldb_private::StructuredData::Dictionary::AddItem
void AddItem(llvm::StringRef key, ObjectSP value_sp)
Definition: StructuredData.h:494
lldb::SBDebugger::GetTargetAtIndex
lldb::SBTarget GetTargetAtIndex(uint32_t idx)
Definition: SBDebugger.cpp:937
lldb-private.h
LoadPlugin
static llvm::sys::DynamicLibrary LoadPlugin(const lldb::DebuggerSP &debugger_sp, const FileSpec &spec, Status &error)
Definition: SBDebugger.cpp:64
lldb::SBDebugger::GetDefaultArchitecture
static bool GetDefaultArchitecture(char *arch_name, size_t arch_name_len)
Definition: SBDebugger.cpp:635
lldb_private::StreamFile::GetFile
File & GetFile()
Definition: StreamFile.h:37
lldb_private::Debugger::ProgressEventData::GetID
uint64_t GetID() const
Definition: Debugger.h:104
lldb_private::eLoadDependentsYes
@ eLoadDependentsYes
Definition: Target.h:63
LLDB_RECORD_CONSTRUCTOR
#define LLDB_RECORD_CONSTRUCTOR(Class, Signature,...)
Definition: ReproducerInstrumentation.h:133
LLDB_LOG_OPTION_PREPEND_TIMESTAMP
#define LLDB_LOG_OPTION_PREPEND_TIMESTAMP
Definition: Log.h:39
StreamFile.h
lldb::SBDebugger::FindTargetWithProcessID
lldb::SBTarget FindTargetWithProcessID(pid_t pid)
Definition: SBDebugger.cpp:963
lldb_private::repro::Registry
The registry contains a unique mapping between functions and their ID.
Definition: ReproducerInstrumentation.h:517
lldb_private::DataVisualization::GetSummaryForType
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:48
SBFile.h
lldb_private::Debugger::ProgressEventData::GetEventDataFromEvent
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
Definition: Debugger.cpp:1178
lldb::eScriptLanguageDefault
@ eScriptLanguageDefault
Definition: lldb-enumerations.h:221
lldb_private::repro::CommandProvider
Definition: ReproducerProvider.h:307
lldb_private::Debugger::FindDebuggerWithInstanceName
static lldb::DebuggerSP FindDebuggerWithInstanceName(ConstString instance_name)
Definition: Debugger.cpp:633
lldb::SBDebugger::GetCategoryAtIndex
SBTypeCategory GetCategoryAtIndex(uint32_t)
Definition: SBDebugger.cpp:1599
lldb::SBInputReader::SetIsDone
void SetIsDone(bool)
Definition: SBDebugger.cpp:120
lldb::SBDebugger::SetCloseInputOnEOF
void SetCloseInputOnEOF(bool b)
Definition: SBDebugger.cpp:1530
lldb_private::Status
Definition: Status.h:44
GetCategoryArray
static llvm::ArrayRef< const char * > GetCategoryArray(const char **categories)
Definition: SBDebugger.cpp:1654
lldb::SBListener
Definition: SBListener.h:16
DataVisualization.h
lldb::SBDebugger::GetCommandInterpreter
lldb::SBCommandInterpreter GetCommandInterpreter()
Definition: SBDebugger.cpp:499
lldb_private::Target::GetDefaultArchitecture
static ArchSpec GetDefaultArchitecture()
Definition: Target.cpp:2356
lldb_private::ArchSpec::GetArchitectureName
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition: ArchSpec.cpp:538
lldb_private::DataVisualization::GetFilterForType
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
Definition: DataVisualization.cpp:59
uint32_t
lldb::SBDebugger::HandleProcessEvent
void HandleProcessEvent(const lldb::SBProcess &process, const lldb::SBEvent &event, FILE *out, FILE *err)
Definition: SBDebugger.cpp:564
lldb::SBPlatform::SetSP
void SetSP(const lldb::PlatformSP &platform_sp)
Definition: SBPlatform.cpp:380
lldb::SBDebugger::GetSelectedPlatform
lldb::SBPlatform GetSelectedPlatform()
Definition: SBDebugger.cpp:1056
lldb::SBProcess::GetSP
lldb::ProcessSP GetSP() const
Definition: SBProcess.cpp:106
lldb::SBTypeCategory
class LLDB_API SBTypeCategory
Definition: SBDefines.h:80
lldb::SBDebugger::CreateTarget
lldb::SBTarget CreateTarget(const char *filename, const char *target_triple, const char *platform_name, bool add_dependent_modules, lldb::SBError &error)
Definition: SBDebugger.cpp:764
lldb_private::Platform::GetAugmentedArchSpec
static ArchSpec GetAugmentedArchSpec(Platform *platform, llvm::StringRef triple)
Augments the triple either with information from platform or the host system (if platform is null).
Definition: Platform.cpp:378
lldb::SBTarget::m_opaque_sp
lldb::TargetSP m_opaque_sp
Definition: SBTarget.h:884
lldb::SBStructuredData
Definition: SBStructuredData.h:17
lldb::SBDebugger::FindTargetWithFileAndArch
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
Definition: SBDebugger.cpp:975
lldb::pid_t
uint64_t pid_t
Definition: lldb-types.h:85
lldb::SBDebugger::SetDefaultArchitecture
static bool SetDefaultArchitecture(const char *arch_name)
Definition: SBDebugger.cpp:658
lldb::SBInputReader::IsActive
bool IsActive() const
Definition: SBDebugger.cpp:124
lldb_private::CommandInterpreterRunResult::GetNumErrors
uint32_t GetNumErrors() const
Definition: CommandInterpreter.h:38
lldb_private::Status::SetErrorString
void SetErrorString(llvm::StringRef err_str)
Set the current error string to err_str.
Definition: Status.cpp:242
lldb_private::Debugger::FindDebuggerWithID
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
Definition: Debugger.cpp:1089
UINT32_MAX
#define UINT32_MAX
Definition: lldb-defines.h:31
XML.h
lldb::SBTypeFormat
class LLDB_API SBTypeFormat
Definition: SBDefines.h:84
lldb::SBDebugger::GetBroadcaster
lldb::SBBroadcaster GetBroadcaster()
Definition: SBDebugger.cpp:182
lldb::SBDebugger::SetCurrentPlatformSDKRoot
bool SetCurrentPlatformSDKRoot(const char *sysroot)
Definition: SBDebugger.cpp:1504
lldb_private::Debugger::ProgressEventData::IsDebuggerSpecific
bool IsDebuggerSpecific() const
Definition: Debugger.h:108
lldb::SBDebugger::Terminate
static void Terminate()
Definition: SBDebugger.cpp:205
g_debugger_lifetime
static llvm::ManagedStatic< SystemLifetimeManager > g_debugger_lifetime
Definition: SBDebugger.cpp:100
PluginManager.h
lldb::SBTypeSynthetic
Definition: SBTypeSynthetic.h:17
SBTypeFilter.h
lldb_private::ConstString::GetCString
const char * GetCString() const
Get the string value as a C string.
Definition: ConstString.h:216
SBStructuredData.h
lldb::eCommandInterpreterResultInferiorCrash
@ eCommandInterpreterResultInferiorCrash
Stopped because the corresponding option was set and the inferior crashed.
Definition: lldb-enumerations.h:1127
StructuredDataImpl.h
SBEvent.h
lldb_private::Stream::Printf
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition: Stream.cpp:107
lldb::SBDebugger::GetScriptingLanguage
lldb::ScriptLanguage GetScriptingLanguage(const char *script_language_name)
Definition: SBDebugger.cpp:673
lldb_private::FileSystem::Instance
static FileSystem & Instance()
Definition: common/FileSystem.cpp:45
lldb::SBTarget::SetSP
void SetSP(const lldb::TargetSP &target_sp)
Definition: SBTarget.cpp:607
lldb::user_id_t
uint64_t user_id_t
Definition: lldb-types.h:84
lldb::SBError::ref
lldb_private::Status & ref()
Definition: SBError.cpp:159
lldb_private
A class that represents a running process on the host machine.
Definition: SBCommandInterpreterRunOptions.h:16
SBTypeFormat.h
lldb::SBCommandInterpreterRunResult
class LLDB_API SBCommandInterpreterRunResult
Definition: SBDefines.h:31
SBCommandReturnObject.h
lldb::SBDebugger::SetOutputFileHandle
void SetOutputFileHandle(FILE *f, bool transfer_ownership)
Definition: SBDebugger.cpp:384
lldb_private::CommandInterpreter::SkipLLDBInitFiles
void SkipLLDBInitFiles(bool skip_lldbinit_files)
Definition: CommandInterpreter.h:472
lldb::SBDebugger::SetUseExternalEditor
bool SetUseExternalEditor(bool input)
Definition: SBDebugger.cpp:1415
lldb_private::DataVisualization::Categories::GetCategoryAtIndex
static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t)
Definition: DataVisualization.cpp:166
lldb::eStateInvalid
@ eStateInvalid
Definition: lldb-enumerations.h:74
lldb::SBDebugger::DispatchInput
void DispatchInput(void *baton, const void *data, size_t data_len)
Definition: SBDebugger.cpp:1160
lldb::SBCommandInterpreter::reset
void reset(lldb_private::CommandInterpreter *)
Definition: SBCommandInterpreter.cpp:449
lldb::SBTarget::GetSP
lldb::TargetSP GetSP() const
Definition: SBTarget.cpp:605
CommandInterpreter.h
lldb::SBBroadcaster
Definition: SBBroadcaster.h:16
State.h
lldb_private::Process::eBroadcastBitStateChanged
@ eBroadcastBitStateChanged
Definition: Process.h:357
SBProcess.h
lldb::SBTypeNameSpecifier::IsValid
bool IsValid() const
Definition: SBTypeNameSpecifier.cpp:49
lldb_private::File::GetStream
virtual FILE * GetStream()
Get the underlying libc stream for this file, or NULL.
Definition: File.cpp:126
SBCommandInterpreter.h
lldb_private::StreamFile
Definition: StreamFile.h:22
lldb_private::Debugger::ProgressEventData::GetMessage
const std::string & GetMessage() const
Definition: Debugger.h:107
LLDB_RECORD_STATIC_METHOD
#define LLDB_RECORD_STATIC_METHOD(Result, Class, Method, Signature,...)
Definition: ReproducerInstrumentation.h:171
lldb::SBCommandInterpreterRunOptions
Definition: SBCommandInterpreterRunOptions.h:23
lldb::SBTypeFilter
class LLDB_API SBTypeFilter
Definition: SBDefines.h:83
lldb::InputReaderGranularity
InputReaderGranularity
Token size/granularities for Input Readers.
Definition: lldb-enumerations.h:329
lldb::StateType
StateType
Process and Thread States.
Definition: lldb-enumerations.h:73
lldb::SBDebugger::SBDebugger
SBDebugger()
Definition: SBDebugger.cpp:130
lldb_private::Log
Definition: Log.h:49
lldb_private::Stream::PutCString
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition: Stream.cpp:63
lldb_private::CommandInterpreterRunOptions::SetAutoHandleEvents
void SetAutoHandleEvents(bool auto_handle_events)
Definition: CommandInterpreter.h:173
lldb::SBDebugger::get_sp
const lldb::DebuggerSP & get_sp() const
Definition: SBDebugger.cpp:1285
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::SBDebugger::m_opaque_sp
lldb::DebuggerSP m_opaque_sp
Definition: SBDebugger.h:395
lldb::SBStream
Definition: SBStream.h:18
lldb_private::Target::SetDefaultArchitecture
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition: Target.cpp:2360
lldb::SBTarget::GetDescription
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
Definition: SBTarget.cpp:1792
lldb::SBDebugger::GetInternalVariableValue
static lldb::SBStringList GetInternalVariableValue(const char *var_name, const char *debugger_instance_name)
Definition: SBDebugger.cpp:1330
lldb::SBDebugger::FindDebuggerWithID
static SBDebugger FindDebuggerWithID(int id)
Definition: SBDebugger.cpp:1287
lldb::SBDebugger::SetLoggingCallback
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Definition: SBDebugger.cpp:1678
lldb_private::FileSpec::GetPath
size_t GetPath(char *path, size_t max_path_length, bool denormalize=true) const
Extract the full path to the file.
Definition: FileSpec.cpp:348
LLDB_RECORD_CHAR_PTR_STATIC_METHOD
#define LLDB_RECORD_CHAR_PTR_STATIC_METHOD(Result, Class, Method, Signature, StrOut,...)
Definition: ReproducerInstrumentation.h:206
SBTarget.h
lldb_private::repro::Reproducer::Instance
static Reproducer & Instance()
Definition: Reproducer.cpp:23
lldb_private::repro::Generator
The generator is responsible for the logic needed to generate a reproducer.
Definition: Reproducer.h:91
lldb::SBDebugger::get
lldb_private::Debugger * get() const
Definition: SBDebugger.cpp:1278
lldb::SBDebugger::DispatchInputInterrupt
void DispatchInputInterrupt()
Definition: SBDebugger.cpp:1185
lldb::SBPlatform
Definition: SBPlatform.h:93
lldb::SBDebugger::GetFormatForType
SBTypeFormat GetFormatForType(SBTypeNameSpecifier)
Definition: SBDebugger.cpp:1614
lldb::SBTypeCategory
Definition: SBTypeCategory.h:17
lldb::SBDebugger::CreateTargetWithFileAndArch
lldb::SBTarget CreateTargetWithFileAndArch(const char *filename, const char *archname)
Definition: SBDebugger.cpp:832
lldb::SBDebugger::DeleteCategory
bool DeleteCategory(const char *category_name)
Definition: SBDebugger.cpp:1583
lldb
Definition: SBAddress.h:15
lldb::SBDebugger::Initialize
static void Initialize()
Definition: SBDebugger.cpp:188
lldb_private::Debugger::Destroy
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition: Debugger.cpp:604
lldb::SBProcess::GetTarget
lldb::SBTarget GetTarget() const
Definition: SBProcess.cpp:244
lldb::SBDebugger::SetUseSourceCache
bool SetUseSourceCache(bool use_source_cache)
Definition: SBDebugger.cpp:1439
lldb::SBTypeNameSpecifier::GetSP
lldb::TypeNameSpecifierImplSP GetSP()
Definition: SBTypeNameSpecifier.cpp:146
lldb::SBDebugger::GetBuildConfiguration
static SBStructuredData GetBuildConfiguration()
Definition: SBDebugger.cpp:716
lldb::SBDebugger::SkipAppInitFiles
void SkipAppInitFiles(bool b)
Definition: SBDebugger.cpp:320
SBError.h
lldb::eDescriptionLevelBrief
@ eDescriptionLevelBrief
Definition: lldb-enumerations.h:208
lldb::SBStream::GetData
const char * GetData()
Definition: SBStream.cpp:43
SBTypeCategory.h
lldb::eCommandInterpreterResultQuitRequested
@ eCommandInterpreterResultQuitRequested
Stopped because quit was requested.
Definition: lldb-enumerations.h:1132
lldb_private::Platform::Create
static lldb::PlatformSP Create(ConstString name, Status &error)
Definition: Platform.cpp:289
LLDB_REGISTER_METHOD
#define LLDB_REGISTER_METHOD(Result, Class, Method, Signature)
Definition: ReproducerInstrumentation.h:93
lldb_private::eVarSetOperationAssign
@ eVarSetOperationAssign
Definition: lldb-private-enumerations.h:90
lldb::SBSourceManager
Definition: SBSourceManager.h:18