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
13
18#include "lldb/API/SBError.h"
19#include "lldb/API/SBEvent.h"
20#include "lldb/API/SBFile.h"
21#include "lldb/API/SBFrame.h"
22#include "lldb/API/SBListener.h"
23#include "lldb/API/SBProcess.h"
25#include "lldb/API/SBStream.h"
28#include "lldb/API/SBTarget.h"
29#include "lldb/API/SBThread.h"
30#include "lldb/API/SBTrace.h"
37
38#include "lldb/Core/Debugger.h"
41#include "lldb/Core/Progress.h"
44#include "lldb/Host/Config.h"
46#include "lldb/Host/XML.h"
51#include "lldb/Target/Process.h"
53#include "lldb/Utility/Args.h"
55#include "lldb/Utility/State.h"
57
58#include "llvm/ADT/STLExtras.h"
59#include "llvm/ADT/StringRef.h"
60#include "llvm/Config/llvm-config.h" // for LLVM_ENABLE_CURL
61#include "llvm/Support/DynamicLibrary.h"
62#include "llvm/Support/ManagedStatic.h"
63#include "llvm/Support/PrettyStackTrace.h"
64#include "llvm/Support/Signals.h"
65
66using namespace lldb;
67using namespace lldb_private;
68
69static llvm::ManagedStatic<SystemLifetimeManager> g_debugger_lifetime;
70
72 lldb::SBDebugger &sb_debugger,
73 unsigned long (*callback)(void *, lldb::SBInputReader *,
74 lldb::InputReaderAction, char const *,
75 unsigned long),
76 void *a, lldb::InputReaderGranularity b, char const *c, char const *d,
77 bool e) {
78 LLDB_INSTRUMENT_VA(this, sb_debugger, callback, a, b, c, d, e);
79
80 return SBError();
81}
82
84
87
88 return false;
89}
90
92
94 : m_opaque_sp(debugger_sp) {
95 LLDB_INSTRUMENT_VA(this, debugger_sp);
96}
97
101
102SBDebugger::~SBDebugger() = default;
103
105 LLDB_INSTRUMENT_VA(this, rhs);
106
107 if (this != &rhs) {
109 }
110 return *this;
111}
112
118
120 uint64_t &progress_id,
121 uint64_t &completed,
122 uint64_t &total,
123 bool &is_debugger_specific) {
124 LLDB_INSTRUMENT_VA(event);
125
126 const ProgressEventData *progress_data =
128 if (progress_data == nullptr)
129 return nullptr;
130 progress_id = progress_data->GetID();
131 completed = progress_data->GetCompleted();
132 total = progress_data->GetTotal();
133 is_debugger_specific = progress_data->IsDebuggerSpecific();
134 ConstString message(progress_data->GetMessage());
135 return message.AsCString();
136}
137
140 LLDB_INSTRUMENT_VA(event);
141
142 StructuredData::DictionarySP dictionary_sp =
144
145 if (!dictionary_sp)
146 return {};
147
149 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
150 return data;
151}
152
155 LLDB_INSTRUMENT_VA(event);
156
157 StructuredData::DictionarySP dictionary_sp =
159
160 if (!dictionary_sp)
161 return {};
162
164 data.m_impl_up->SetObjectSP(std::move(dictionary_sp));
165 return data;
166}
167
169 LLDB_INSTRUMENT_VA(this);
170 SBBroadcaster broadcaster(&m_opaque_sp->GetBroadcaster(), false);
171 return broadcaster;
172}
173
178
181
182 SBError error((Status()));
183 if (auto e = g_debugger_lifetime->Initialize(
184 std::make_unique<SystemInitializerFull>())) {
185 error.SetError(Status::FromError(std::move(e)));
186 }
187 return error;
188}
189
192
193 llvm::EnablePrettyStackTrace();
194 static std::string executable =
195 llvm::sys::fs::getMainExecutable(nullptr, nullptr);
196 llvm::sys::PrintStackTraceOnErrorSignal(executable);
197}
198
199static void DumpDiagnostics(void *cookie) {
200 Diagnostics::Instance().Dump(llvm::errs());
201}
202
205
206 llvm::sys::AddSignalHandler(&DumpDiagnostics, nullptr);
207}
208
211
212 g_debugger_lifetime->Terminate();
213}
214
216 LLDB_INSTRUMENT_VA(this);
217
218 if (m_opaque_sp)
219 m_opaque_sp->ClearIOHandlers();
220
221 m_opaque_sp.reset();
222}
223
226
227 return SBDebugger::Create(false, nullptr, nullptr);
228}
229
230SBDebugger SBDebugger::Create(bool source_init_files) {
231 LLDB_INSTRUMENT_VA(source_init_files);
232
233 return SBDebugger::Create(source_init_files, nullptr, nullptr);
234}
235
236SBDebugger SBDebugger::Create(bool source_init_files,
237 lldb::LogOutputCallback callback, void *baton)
238
239{
240 LLDB_INSTRUMENT_VA(source_init_files, 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
255 if (source_init_files) {
256 interp.get()->SkipLLDBInitFiles(false);
257 interp.get()->SkipAppInitFiles(false);
259 interp.SourceInitFileInGlobalDirectory(result);
260 interp.SourceInitFileInHomeDirectory(result, false);
261 } else {
262 interp.get()->SkipLLDBInitFiles(true);
263 interp.get()->SkipAppInitFiles(true);
264 }
265 return debugger;
266}
267
269 LLDB_INSTRUMENT_VA(debugger);
270
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
291 LLDB_INSTRUMENT_VA(this);
292 return this->operator bool();
293}
294SBDebugger::operator bool() const {
295 LLDB_INSTRUMENT_VA(this);
296
297 return m_opaque_sp.get() != nullptr;
298}
299
301 LLDB_INSTRUMENT_VA(this, b);
302
303 if (m_opaque_sp)
304 m_opaque_sp->SetAsyncExecution(b);
305}
306
308 LLDB_INSTRUMENT_VA(this);
309
310 return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
311}
312
314 LLDB_INSTRUMENT_VA(this, b);
315
316 if (m_opaque_sp)
317 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
318}
319
321 LLDB_INSTRUMENT_VA(this, b);
322
323 if (m_opaque_sp)
324 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
325}
326
327void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
328 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
329 if (m_opaque_sp)
330 m_opaque_sp->SetInputFile((FileSP)std::make_shared<NativeFile>(
331 fh, File::eOpenOptionReadOnly, transfer_ownership));
332}
333
336 SBError sb_error;
337 if (data == nullptr) {
338 sb_error = Status::FromErrorString("String data is null");
339 return sb_error;
340 }
341
342 size_t size = strlen(data);
343 if (size == 0) {
344 sb_error = Status::FromErrorString("String data is empty");
345 return sb_error;
346 }
347
348 if (!m_opaque_sp) {
349 sb_error = Status::FromErrorString("invalid debugger");
350 return sb_error;
351 }
352
353 sb_error.SetError(m_opaque_sp->SetInputString(data));
354 return sb_error;
355}
356
357// Shouldn't really be settable after initialization as this could cause lots
358// of problems; don't want users trying to switch modes in the middle of a
359// debugging session.
361 LLDB_INSTRUMENT_VA(this, file);
362
364 if (!m_opaque_sp) {
365 error.ref() = Status::FromErrorString("invalid debugger");
366 return error;
367 }
368 if (!file) {
369 error.ref() = Status::FromErrorString("invalid file");
370 return error;
371 }
372 m_opaque_sp->SetInputFile(file.m_opaque_sp);
373 return error;
374}
375
377 LLDB_INSTRUMENT_VA(this, file_sp);
378 return SetInputFile(SBFile(file_sp));
379}
380
382 LLDB_INSTRUMENT_VA(this, file_sp);
383 return SetOutputFile(SBFile(file_sp));
384}
385
386void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
387 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
388 SetOutputFile((FileSP)std::make_shared<NativeFile>(
389 fh, File::eOpenOptionWriteOnly, transfer_ownership));
390}
391
393 LLDB_INSTRUMENT_VA(this, file);
395 if (!m_opaque_sp) {
396 error.ref() = Status::FromErrorString("invalid debugger");
397 return error;
398 }
399 if (!file) {
400 error.ref() = Status::FromErrorString("invalid file");
401 return error;
402 }
403 m_opaque_sp->SetOutputFile(file.m_opaque_sp);
404 return error;
405}
406
407void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
408 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
409 SetErrorFile((FileSP)std::make_shared<NativeFile>(
410 fh, File::eOpenOptionWriteOnly, transfer_ownership));
411}
412
414 LLDB_INSTRUMENT_VA(this, file_sp);
415 return SetErrorFile(SBFile(file_sp));
416}
417
419 LLDB_INSTRUMENT_VA(this, file);
421 if (!m_opaque_sp) {
422 error.ref() = Status::FromErrorString("invalid debugger");
423 return error;
424 }
425 if (!file) {
426 error.ref() = Status::FromErrorString("invalid file");
427 return error;
428 }
429 m_opaque_sp->SetErrorFile(file.m_opaque_sp);
430 return error;
431}
432
434 LLDB_INSTRUMENT_VA(this, setting);
435
437 if (!m_opaque_sp)
438 return data;
439
440 StreamString json_strm;
441 ExecutionContext exe_ctx(
442 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
443 if (setting && strlen(setting) > 0)
444 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
445 /*dump_mask*/ 0,
446 /*is_json*/ true);
447 else
448 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, /*dump_mask*/ 0,
449 /*is_json*/ true);
450
451 data.m_impl_up->SetObjectSP(StructuredData::ParseJSON(json_strm.GetString()));
452 return data;
453}
454
456 LLDB_INSTRUMENT_VA(this);
457 if (m_opaque_sp) {
458 File &file_sp = m_opaque_sp->GetInputFile();
459 return file_sp.GetStream();
460 }
461 return nullptr;
462}
463
465 LLDB_INSTRUMENT_VA(this);
466 if (m_opaque_sp) {
467 return SBFile(m_opaque_sp->GetInputFileSP());
468 }
469 return SBFile();
470}
471
473 LLDB_INSTRUMENT_VA(this);
474 if (m_opaque_sp)
475 return m_opaque_sp->GetOutputFileSP()->GetStream();
476 return nullptr;
477}
478
480 LLDB_INSTRUMENT_VA(this);
481 if (m_opaque_sp)
482 return SBFile(m_opaque_sp->GetOutputFileSP());
483 return SBFile();
484}
485
487 LLDB_INSTRUMENT_VA(this);
488
489 if (m_opaque_sp)
490 return m_opaque_sp->GetErrorFileSP()->GetStream();
491 return nullptr;
492}
493
495 LLDB_INSTRUMENT_VA(this);
496 SBFile file;
497 if (m_opaque_sp)
498 return SBFile(m_opaque_sp->GetErrorFileSP());
499 return SBFile();
500}
501
503 LLDB_INSTRUMENT_VA(this);
504
505 if (m_opaque_sp)
506 m_opaque_sp->SaveInputTerminalState();
507}
508
510 LLDB_INSTRUMENT_VA(this);
511
512 if (m_opaque_sp)
513 m_opaque_sp->RestoreInputTerminalState();
514}
516 LLDB_INSTRUMENT_VA(this);
517
518 SBCommandInterpreter sb_interpreter;
519 if (m_opaque_sp)
520 sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter());
521
522 return sb_interpreter;
523}
524
525void SBDebugger::HandleCommand(const char *command) {
526 LLDB_INSTRUMENT_VA(this, command);
527
528 if (m_opaque_sp) {
529 TargetSP target_sp(m_opaque_sp->GetSelectedTarget());
530 std::unique_lock<std::recursive_mutex> lock;
531 if (target_sp)
532 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
533
536
537 sb_interpreter.HandleCommand(command, result, false);
538
539 result.PutError(m_opaque_sp->GetErrorFileSP());
540 result.PutOutput(m_opaque_sp->GetOutputFileSP());
541
542 if (!m_opaque_sp->GetAsyncExecution()) {
543 SBProcess process(GetCommandInterpreter().GetProcess());
544 ProcessSP process_sp(process.GetSP());
545 if (process_sp) {
546 EventSP event_sp;
547 ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
548 while (lldb_listener_sp->GetEventForBroadcaster(
549 process_sp.get(), event_sp, std::chrono::seconds(0))) {
550 SBEvent event(event_sp);
551 HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile());
552 }
553 }
554 }
555 }
556}
557
559 LLDB_INSTRUMENT_VA(this);
560
561 SBListener sb_listener;
562 if (m_opaque_sp)
563 sb_listener.reset(m_opaque_sp->GetListener());
564
565 return sb_listener;
566}
567
568void SBDebugger::HandleProcessEvent(const SBProcess &process,
569 const SBEvent &event, SBFile out,
570 SBFile err) {
571 LLDB_INSTRUMENT_VA(this, process, event, out, err);
572
573 return HandleProcessEvent(process, event, out.m_opaque_sp, err.m_opaque_sp);
574}
575
576void SBDebugger::HandleProcessEvent(const SBProcess &process,
577 const SBEvent &event, FILE *out,
578 FILE *err) {
579 LLDB_INSTRUMENT_VA(this, process, event, out, err);
580
581 FileSP outfile =
582 std::make_shared<NativeFile>(out, File::eOpenOptionWriteOnly, false);
583 FileSP errfile =
584 std::make_shared<NativeFile>(err, File::eOpenOptionWriteOnly, false);
585 return HandleProcessEvent(process, event, outfile, errfile);
586}
587
588void SBDebugger::HandleProcessEvent(const SBProcess &process,
589 const SBEvent &event, FileSP out_sp,
590 FileSP err_sp) {
591
592 LLDB_INSTRUMENT_VA(this, process, event, out_sp, err_sp);
593
594 if (!process.IsValid())
595 return;
596
597 TargetSP target_sp(process.GetTarget().GetSP());
598 if (!target_sp)
599 return;
600
601 const uint32_t event_type = event.GetType();
602 char stdio_buffer[1024];
603 size_t len;
604
605 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
606
607 if (event_type &
609 // Drain stdout when we stop just in case we have any bytes
610 while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0)
611 if (out_sp)
612 out_sp->Write(stdio_buffer, len);
613 }
614
615 if (event_type &
617 // Drain stderr when we stop just in case we have any bytes
618 while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0)
619 if (err_sp)
620 err_sp->Write(stdio_buffer, len);
621 }
622
623 if (event_type & Process::eBroadcastBitStateChanged) {
624 StateType event_state = SBProcess::GetStateFromEvent(event);
625
626 if (event_state == eStateInvalid)
627 return;
628
629 bool is_stopped = StateIsStoppedState(event_state);
630 if (!is_stopped)
631 process.ReportEventState(event, out_sp);
632 }
633}
634
636 LLDB_INSTRUMENT_VA(this);
637
638 SBSourceManager sb_source_manager(*this);
639 return sb_source_manager;
640}
641
642bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
643 LLDB_INSTRUMENT_VA(arch_name, arch_name_len);
644
645 if (arch_name && arch_name_len) {
647
648 if (default_arch.IsValid()) {
649 const std::string &triple_str = default_arch.GetTriple().str();
650 if (!triple_str.empty())
651 ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str());
652 else
653 ::snprintf(arch_name, arch_name_len, "%s",
654 default_arch.GetArchitectureName());
655 return true;
656 }
657 }
658 if (arch_name && arch_name_len)
659 arch_name[0] = '\0';
660 return false;
661}
662
663bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
664 LLDB_INSTRUMENT_VA(arch_name);
665
666 if (arch_name) {
667 ArchSpec arch(arch_name);
668 if (arch.IsValid()) {
670 return true;
671 }
672 }
673 return false;
674}
675
677SBDebugger::GetScriptingLanguage(const char *script_language_name) {
678 LLDB_INSTRUMENT_VA(this, script_language_name);
679
680 if (!script_language_name)
683 llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr);
684}
685
688 LLDB_INSTRUMENT_VA(this, language);
690 if (m_opaque_sp) {
692 m_opaque_sp->GetScriptInterpreter(language);
693 if (interp) {
694 data.m_impl_up->SetObjectSP(interp->GetInterpreterInfo());
695 }
696 }
697 return data;
698}
699
702
704}
705
707 LLDB_INSTRUMENT_VA(state);
708
709 return lldb_private::StateAsCString(state);
710}
711
719
721 LLDB_INSTRUMENT_VA(state);
722
723 const bool result = lldb_private::StateIsRunningState(state);
724
725 return result;
726}
727
729 LLDB_INSTRUMENT_VA(state);
730
731 const bool result = lldb_private::StateIsStoppedState(state, false);
732
733 return result;
734}
735
737 const char *target_triple,
738 const char *platform_name,
739 bool add_dependent_modules,
740 lldb::SBError &sb_error) {
741 LLDB_INSTRUMENT_VA(this, filename, target_triple, platform_name,
742 add_dependent_modules, sb_error);
743
744 SBTarget sb_target;
745 TargetSP target_sp;
746 if (m_opaque_sp) {
747 sb_error.Clear();
748 OptionGroupPlatform platform_options(false);
749 platform_options.SetPlatformName(platform_name);
750
751 sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget(
752 *m_opaque_sp, filename, target_triple,
753 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
754 &platform_options, target_sp);
755
756 if (sb_error.Success())
757 sb_target.SetSP(target_sp);
758 } else {
759 sb_error = Status::FromErrorString("invalid debugger");
760 }
761
762 Log *log = GetLog(LLDBLog::API);
763 LLDB_LOGF(log,
764 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
765 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
766 "SBTarget(%p)",
767 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
768 platform_name, add_dependent_modules, sb_error.GetCString(),
769 static_cast<void *>(target_sp.get()));
770
771 return sb_target;
772}
773
776 const char *target_triple) {
777 LLDB_INSTRUMENT_VA(this, filename, target_triple);
778
779 SBTarget sb_target;
780 TargetSP target_sp;
781 if (m_opaque_sp) {
782 const bool add_dependent_modules = true;
783 Status error(m_opaque_sp->GetTargetList().CreateTarget(
784 *m_opaque_sp, filename, target_triple,
785 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
786 target_sp));
787 sb_target.SetSP(target_sp);
788 }
789
790 Log *log = GetLog(LLDBLog::API);
791 LLDB_LOGF(log,
792 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
793 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
794 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
795 static_cast<void *>(target_sp.get()));
796
797 return sb_target;
798}
799
801 const char *arch_cstr) {
802 LLDB_INSTRUMENT_VA(this, filename, arch_cstr);
803
804 Log *log = GetLog(LLDBLog::API);
805
806 SBTarget sb_target;
807 TargetSP target_sp;
808 if (m_opaque_sp) {
810 if (arch_cstr == nullptr) {
811 // The version of CreateTarget that takes an ArchSpec won't accept an
812 // empty ArchSpec, so when the arch hasn't been specified, we need to
813 // call the target triple version.
814 error = m_opaque_sp->GetTargetList().CreateTarget(
815 *m_opaque_sp, filename, arch_cstr, eLoadDependentsYes, nullptr,
816 target_sp);
817 } else {
818 PlatformSP platform_sp =
819 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
820 ArchSpec arch =
821 Platform::GetAugmentedArchSpec(platform_sp.get(), arch_cstr);
822 if (arch.IsValid())
823 error = m_opaque_sp->GetTargetList().CreateTarget(
824 *m_opaque_sp, filename, arch, eLoadDependentsYes, platform_sp,
825 target_sp);
826 else
827 error = Status::FromErrorStringWithFormat("invalid arch_cstr: %s",
828 arch_cstr);
829 }
830 if (error.Success())
831 sb_target.SetSP(target_sp);
832 }
833
834 LLDB_LOGF(log,
835 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
836 "arch=%s) => SBTarget(%p)",
837 static_cast<void *>(m_opaque_sp.get()),
838 filename ? filename : "<unspecified>",
839 arch_cstr ? arch_cstr : "<unspecified>",
840 static_cast<void *>(target_sp.get()));
841
842 return sb_target;
843}
844
845SBTarget SBDebugger::CreateTarget(const char *filename) {
846 LLDB_INSTRUMENT_VA(this, filename);
847
848 SBTarget sb_target;
849 TargetSP target_sp;
850 if (m_opaque_sp) {
852 const bool add_dependent_modules = true;
853 error = m_opaque_sp->GetTargetList().CreateTarget(
854 *m_opaque_sp, filename, "",
855 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
856 target_sp);
857
858 if (error.Success())
859 sb_target.SetSP(target_sp);
860 }
861 Log *log = GetLog(LLDBLog::API);
862 LLDB_LOGF(log,
863 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
864 static_cast<void *>(m_opaque_sp.get()), filename,
865 static_cast<void *>(target_sp.get()));
866 return sb_target;
867}
868
870 LLDB_INSTRUMENT_VA(this);
871
872 SBTarget sb_target;
873 if (m_opaque_sp) {
874 sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this());
875 }
876 Log *log = GetLog(LLDBLog::API);
877 LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
878 static_cast<void *>(m_opaque_sp.get()),
879 static_cast<void *>(sb_target.GetSP().get()));
880 return sb_target;
881}
882
884 LLDB_INSTRUMENT_VA(this);
885 if (m_opaque_sp) {
886 m_opaque_sp->DispatchClientTelemetry(*entry.m_impl_up);
887 } else {
888 Log *log = GetLog(LLDBLog::API);
889 LLDB_LOGF(log,
890 "Could not send telemetry from SBDebugger - debugger was null.");
891 }
892}
893
895 LLDB_INSTRUMENT_VA(this, target);
896
897 bool result = false;
898 if (m_opaque_sp) {
899 TargetSP target_sp(target.GetSP());
900 if (target_sp) {
901 // No need to lock, the target list is thread safe
902 result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
903 target_sp->Destroy();
904 target.Clear();
905 }
906 }
907
908 Log *log = GetLog(LLDBLog::API);
909 LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
910 static_cast<void *>(m_opaque_sp.get()),
911 static_cast<void *>(target.m_opaque_sp.get()), result);
912
913 return result;
914}
915
917 LLDB_INSTRUMENT_VA(this, idx);
918
919 SBTarget sb_target;
920 if (m_opaque_sp) {
921 // No need to lock, the target list is thread safe
922 sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx));
923 }
924 return sb_target;
925}
926
928 LLDB_INSTRUMENT_VA(this, target);
929
930 lldb::TargetSP target_sp = target.GetSP();
931 if (!target_sp)
932 return UINT32_MAX;
933
934 if (!m_opaque_sp)
935 return UINT32_MAX;
936
937 return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
938}
939
941 LLDB_INSTRUMENT_VA(this, id);
942 SBTarget sb_target;
943 if (m_opaque_sp) {
944 // No need to lock, the target list is thread safe
945 sb_target.SetSP(
946 m_opaque_sp->GetTargetList().FindTargetByGloballyUniqueID(id));
947 }
948 return sb_target;
949}
950
952 LLDB_INSTRUMENT_VA(this, pid);
953
954 SBTarget sb_target;
955 if (m_opaque_sp) {
956 // No need to lock, the target list is thread safe
957 sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
958 }
959 return sb_target;
960}
961
963 const char *arch_name) {
964 LLDB_INSTRUMENT_VA(this, filename, arch_name);
965
966 SBTarget sb_target;
967 if (m_opaque_sp && filename && filename[0]) {
968 // No need to lock, the target list is thread safe
970 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
971 TargetSP target_sp(
972 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
973 FileSpec(filename), arch_name ? &arch : nullptr));
974 sb_target.SetSP(target_sp);
975 }
976 return sb_target;
977}
978
980 SBTarget sb_target;
981 if (m_opaque_sp) {
982 // No need to lock, the target list is thread safe
983 sb_target.SetSP(
984 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
985 }
986 return sb_target;
987}
988
990 LLDB_INSTRUMENT_VA(this);
991
992 if (m_opaque_sp) {
993 // No need to lock, the target list is thread safe
994 return m_opaque_sp->GetTargetList().GetNumTargets();
995 }
996 return 0;
997}
998
1000 LLDB_INSTRUMENT_VA(this);
1001
1002 Log *log = GetLog(LLDBLog::API);
1003
1004 SBTarget sb_target;
1005 TargetSP target_sp;
1006 if (m_opaque_sp) {
1007 // No need to lock, the target list is thread safe
1008 target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget();
1009 sb_target.SetSP(target_sp);
1010 }
1011
1012 if (log) {
1013 SBStream sstr;
1014 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1015 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1016 static_cast<void *>(m_opaque_sp.get()),
1017 static_cast<void *>(target_sp.get()), sstr.GetData());
1018 }
1019
1020 return sb_target;
1021}
1022
1024 LLDB_INSTRUMENT_VA(this, sb_target);
1025
1026 Log *log = GetLog(LLDBLog::API);
1027
1028 TargetSP target_sp(sb_target.GetSP());
1029 if (m_opaque_sp) {
1030 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1031 }
1032 if (log) {
1033 SBStream sstr;
1034 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1035 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1036 static_cast<void *>(m_opaque_sp.get()),
1037 static_cast<void *>(target_sp.get()), sstr.GetData());
1038 }
1039}
1040
1042 LLDB_INSTRUMENT_VA(this);
1043
1044 Log *log = GetLog(LLDBLog::API);
1045
1046 SBPlatform sb_platform;
1047 DebuggerSP debugger_sp(m_opaque_sp);
1048 if (debugger_sp) {
1049 sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1050 }
1051 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1052 static_cast<void *>(m_opaque_sp.get()),
1053 static_cast<void *>(sb_platform.GetSP().get()),
1054 sb_platform.GetName());
1055 return sb_platform;
1056}
1057
1059 LLDB_INSTRUMENT_VA(this, sb_platform);
1060
1061 Log *log = GetLog(LLDBLog::API);
1062
1063 DebuggerSP debugger_sp(m_opaque_sp);
1064 if (debugger_sp) {
1065 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
1066 }
1067
1068 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1069 static_cast<void *>(m_opaque_sp.get()),
1070 static_cast<void *>(sb_platform.GetSP().get()),
1071 sb_platform.GetName());
1072}
1073
1075 LLDB_INSTRUMENT_VA(this);
1076
1077 if (m_opaque_sp) {
1078 // No need to lock, the platform list is thread safe
1079 return m_opaque_sp->GetPlatformList().GetSize();
1080 }
1081 return 0;
1082}
1083
1085 LLDB_INSTRUMENT_VA(this, idx);
1086
1087 SBPlatform sb_platform;
1088 if (m_opaque_sp) {
1089 // No need to lock, the platform list is thread safe
1090 sb_platform.SetSP(m_opaque_sp->GetPlatformList().GetAtIndex(idx));
1091 }
1092 return sb_platform;
1093}
1094
1096 LLDB_INSTRUMENT_VA(this);
1097
1098 uint32_t idx = 0;
1099 while (true) {
1101 break;
1102 }
1103 ++idx;
1104 }
1105 // +1 for the host platform, which should always appear first in the list.
1106 return idx + 1;
1107}
1108
1110 LLDB_INSTRUMENT_VA(this, idx);
1111
1113 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1114 llvm::StringRef name_str("name"), desc_str("description");
1115
1116 if (idx == 0) {
1117 PlatformSP host_platform_sp(Platform::GetHostPlatform());
1118 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1119 platform_dict->AddStringItem(
1120 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1121 } else if (idx > 0) {
1122 llvm::StringRef plugin_name =
1124 if (plugin_name.empty()) {
1125 return data;
1126 }
1127 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1128
1129 llvm::StringRef plugin_desc =
1131 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1132 }
1133
1134 data.m_impl_up->SetObjectSP(
1135 StructuredData::ObjectSP(platform_dict.release()));
1136 return data;
1137}
1138
1139void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
1140 LLDB_INSTRUMENT_VA(this, baton, data, data_len);
1141
1143}
1144
1145void SBDebugger::DispatchInput(const void *data, size_t data_len) {
1147
1148 // Log *log(GetLog (LLDBLog::API));
1149 //
1150 // if (log)
1151 // LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\",
1152 // size_t=%" PRIu64 ")",
1153 // m_opaque_sp.get(),
1154 // (int) data_len,
1155 // (const char *) data,
1156 // (uint64_t)data_len);
1157 //
1158 // if (m_opaque_sp)
1159 // m_opaque_sp->DispatchInput ((const char *) data, data_len);
1160}
1161
1163 LLDB_INSTRUMENT_VA(this);
1164
1165 if (m_opaque_sp)
1166 m_opaque_sp->DispatchInputInterrupt();
1167}
1168
1170 LLDB_INSTRUMENT_VA(this);
1171
1172 if (m_opaque_sp)
1173 m_opaque_sp->DispatchInputEndOfFile();
1174}
1175
1177 LLDB_INSTRUMENT_VA(this, reader);
1178}
1179
1180void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1181 bool spawn_thread) {
1182 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread);
1183
1184 if (m_opaque_sp) {
1186 options.SetAutoHandleEvents(auto_handle_events);
1187 options.SetSpawnThread(spawn_thread);
1188 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1189 }
1190}
1191
1192void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1193 bool spawn_thread,
1195 int &num_errors, bool &quit_requested,
1196 bool &stopped_for_crash)
1197
1198{
1199 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread, options,
1200 num_errors, quit_requested, stopped_for_crash);
1201
1202 if (m_opaque_sp) {
1203 options.SetAutoHandleEvents(auto_handle_events);
1204 options.SetSpawnThread(spawn_thread);
1205 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1207 interp.RunCommandInterpreter(options.ref());
1208 num_errors = result.GetNumErrors();
1209 quit_requested =
1211 stopped_for_crash =
1213 }
1214}
1215
1217 const SBCommandInterpreterRunOptions &options) {
1218 LLDB_INSTRUMENT_VA(this, options);
1219
1220 if (!m_opaque_sp)
1222
1223 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1225 interp.RunCommandInterpreter(options.ref());
1226
1227 return SBCommandInterpreterRunResult(result);
1228}
1229
1231 const char *repl_options) {
1232 LLDB_INSTRUMENT_VA(this, language, repl_options);
1233
1234 SBError error;
1235 if (m_opaque_sp)
1236 error.ref() = m_opaque_sp->RunREPL(language, repl_options);
1237 else
1238 error = Status::FromErrorString("invalid debugger");
1239 return error;
1240}
1241
1242void SBDebugger::reset(const DebuggerSP &debugger_sp) {
1243 m_opaque_sp = debugger_sp;
1244}
1245
1246Debugger *SBDebugger::get() const { return m_opaque_sp.get(); }
1247
1249 assert(m_opaque_sp.get());
1250 return *m_opaque_sp;
1251}
1252
1254
1257
1258 // No need to lock, the debugger list is thread safe
1259 SBDebugger sb_debugger;
1260 DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id);
1261 if (debugger_sp)
1262 sb_debugger.reset(debugger_sp);
1263 return sb_debugger;
1264}
1265
1267 LLDB_INSTRUMENT_VA(this);
1268
1269 if (!m_opaque_sp)
1270 return nullptr;
1271
1272 return ConstString(m_opaque_sp->GetInstanceName()).AsCString();
1273}
1274
1275SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
1276 const char *debugger_instance_name) {
1277 LLDB_INSTRUMENT_VA(var_name, value, debugger_instance_name);
1278
1279 SBError sb_error;
1280 DebuggerSP debugger_sp(
1281 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1282 Status error;
1283 if (debugger_sp) {
1284 ExecutionContext exe_ctx(
1285 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1286 error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign,
1287 var_name, value);
1288 } else {
1290 "invalid debugger instance name '%s'", debugger_instance_name);
1291 }
1292 if (error.Fail())
1293 sb_error.SetError(std::move(error));
1294 return sb_error;
1295}
1296
1299 const char *debugger_instance_name) {
1300 LLDB_INSTRUMENT_VA(var_name, debugger_instance_name);
1301
1302 DebuggerSP debugger_sp(
1303 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1304 Status error;
1305 if (debugger_sp) {
1306 ExecutionContext exe_ctx(
1307 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1308 lldb::OptionValueSP value_sp(
1309 debugger_sp->GetPropertyValue(&exe_ctx, var_name, error));
1310 if (value_sp) {
1311 StreamString value_strm;
1312 value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
1313 const std::string &value_str = std::string(value_strm.GetString());
1314 if (!value_str.empty()) {
1315 StringList string_list;
1316 string_list.SplitIntoLines(value_str);
1317 return SBStringList(&string_list);
1318 }
1319 }
1320 }
1321 return SBStringList();
1322}
1323
1325 LLDB_INSTRUMENT_VA(this);
1326
1327 return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1328}
1329
1330void SBDebugger::SetTerminalWidth(uint32_t term_width) {
1331 LLDB_INSTRUMENT_VA(this, term_width);
1332
1333 if (m_opaque_sp)
1334 m_opaque_sp->SetTerminalWidth(term_width);
1335}
1336
1338 LLDB_INSTRUMENT_VA(this);
1339
1340 return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1341}
1342
1343void SBDebugger::SetTerminalHeight(uint32_t term_height) {
1344 LLDB_INSTRUMENT_VA(this, term_height);
1345
1346 if (m_opaque_sp)
1347 m_opaque_sp->SetTerminalHeight(term_height);
1348}
1349
1350const char *SBDebugger::GetPrompt() const {
1351 LLDB_INSTRUMENT_VA(this);
1352
1353 Log *log = GetLog(LLDBLog::API);
1354
1355 LLDB_LOG(log, "SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1356 static_cast<void *>(m_opaque_sp.get()),
1357 (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
1358
1359 return (m_opaque_sp ? ConstString(m_opaque_sp->GetPrompt()).GetCString()
1360 : nullptr);
1361}
1362
1363void SBDebugger::SetPrompt(const char *prompt) {
1364 LLDB_INSTRUMENT_VA(this, prompt);
1365
1366 if (m_opaque_sp)
1367 m_opaque_sp->SetPrompt(llvm::StringRef(prompt));
1368}
1369
1371 LLDB_INSTRUMENT_VA(this);
1372
1373 return "GetReproducerPath has been deprecated";
1374}
1375
1377 LLDB_INSTRUMENT_VA(this);
1378
1379 return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
1380}
1381
1383 LLDB_INSTRUMENT_VA(this, script_lang);
1384
1385 if (m_opaque_sp) {
1386 m_opaque_sp->SetScriptLanguage(script_lang);
1387 }
1388}
1389
1391 LLDB_INSTRUMENT_VA(this);
1392
1393 return (m_opaque_sp ? m_opaque_sp->GetREPLLanguage() : eLanguageTypeUnknown);
1394}
1395
1397 LLDB_INSTRUMENT_VA(this, repl_lang);
1398
1399 if (m_opaque_sp) {
1400 m_opaque_sp->SetREPLLanguage(repl_lang);
1401 }
1402}
1403
1405 LLDB_INSTRUMENT_VA(this, value);
1406
1407 return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
1408}
1409
1411 LLDB_INSTRUMENT_VA(this);
1412
1413 return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
1414}
1415
1416bool SBDebugger::SetUseColor(bool value) {
1417 LLDB_INSTRUMENT_VA(this, value);
1418
1419 return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
1420}
1421
1423 LLDB_INSTRUMENT_VA(this);
1424
1425 return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
1426}
1427
1429 LLDB_INSTRUMENT_VA(this, value);
1430
1431 return (m_opaque_sp ? m_opaque_sp->SetShowInlineDiagnostics(value) : false);
1432}
1433
1435 LLDB_INSTRUMENT_VA(this, value);
1436
1437 return (m_opaque_sp ? m_opaque_sp->SetUseSourceCache(value) : false);
1438}
1439
1441 LLDB_INSTRUMENT_VA(this);
1442
1443 return (m_opaque_sp ? m_opaque_sp->GetUseSourceCache() : false);
1444}
1445
1447 LLDB_INSTRUMENT_VA(this, description);
1448
1449 Stream &strm = description.ref();
1450
1451 if (m_opaque_sp) {
1452 const char *name = m_opaque_sp->GetInstanceName().c_str();
1453 user_id_t id = m_opaque_sp->GetID();
1454 strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
1455 } else
1456 strm.PutCString("No value");
1457
1458 return true;
1459}
1460
1462 LLDB_INSTRUMENT_VA(this);
1463
1464 return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
1465}
1466
1467SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {
1468 LLDB_INSTRUMENT_VA(this, platform_name_cstr);
1469
1470 SBError sb_error;
1471 if (m_opaque_sp) {
1472 if (platform_name_cstr && platform_name_cstr[0]) {
1473 PlatformList &platforms = m_opaque_sp->GetPlatformList();
1474 if (PlatformSP platform_sp = platforms.GetOrCreate(platform_name_cstr))
1475 platforms.SetSelectedPlatform(platform_sp);
1476 else
1477 sb_error.ref() = Status::FromErrorString("platform not found");
1478 } else {
1479 sb_error.ref() = Status::FromErrorString("invalid platform name");
1480 }
1481 } else {
1482 sb_error.ref() = Status::FromErrorString("invalid debugger");
1483 }
1484 return sb_error;
1485}
1486
1487bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {
1488 LLDB_INSTRUMENT_VA(this, sysroot);
1489
1490 if (SBPlatform platform = GetSelectedPlatform()) {
1491 platform.SetSDKRoot(sysroot);
1492 return true;
1493 }
1494 return false;
1495}
1496
1498 LLDB_INSTRUMENT_VA(this);
1499
1500 return false;
1501}
1502
1504 LLDB_INSTRUMENT_VA(this, b);
1505}
1506
1507SBTypeCategory SBDebugger::GetCategory(const char *category_name) {
1508 LLDB_INSTRUMENT_VA(this, category_name);
1509
1510 if (!category_name || *category_name == 0)
1511 return SBTypeCategory();
1512
1513 TypeCategoryImplSP category_sp;
1514
1516 category_sp, false)) {
1517 return SBTypeCategory(category_sp);
1518 } else {
1519 return SBTypeCategory();
1520 }
1521}
1522
1524 LLDB_INSTRUMENT_VA(this, lang_type);
1525
1526 TypeCategoryImplSP category_sp;
1527 if (DataVisualization::Categories::GetCategory(lang_type, category_sp)) {
1528 return SBTypeCategory(category_sp);
1529 } else {
1530 return SBTypeCategory();
1531 }
1532}
1533
1534SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {
1535 LLDB_INSTRUMENT_VA(this, category_name);
1536
1537 if (!category_name || *category_name == 0)
1538 return SBTypeCategory();
1539
1540 TypeCategoryImplSP category_sp;
1541
1543 category_sp, true)) {
1544 return SBTypeCategory(category_sp);
1545 } else {
1546 return SBTypeCategory();
1547 }
1548}
1549
1550bool SBDebugger::DeleteCategory(const char *category_name) {
1551 LLDB_INSTRUMENT_VA(this, category_name);
1552
1553 if (!category_name || *category_name == 0)
1554 return false;
1555
1557}
1558
1564
1571
1573 LLDB_INSTRUMENT_VA(this);
1574
1575 return GetCategory("default");
1576}
1577
1579 LLDB_INSTRUMENT_VA(this, type_name);
1580
1581 SBTypeCategory default_category_sb = GetDefaultCategory();
1582 if (default_category_sb.GetEnabled())
1583 return default_category_sb.GetFormatForType(type_name);
1584 return SBTypeFormat();
1585}
1586
1588 LLDB_INSTRUMENT_VA(this, type_name);
1589
1590 if (!type_name.IsValid())
1591 return SBTypeSummary();
1593}
1594
1596 LLDB_INSTRUMENT_VA(this, type_name);
1597
1598 if (!type_name.IsValid())
1599 return SBTypeFilter();
1601}
1602
1604 LLDB_INSTRUMENT_VA(this, type_name);
1605
1606 if (!type_name.IsValid())
1607 return SBTypeSynthetic();
1608 return SBTypeSynthetic(
1610}
1611
1617
1618static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) {
1619 if (categories == nullptr)
1620 return {};
1621 size_t len = 0;
1622 while (categories[len] != nullptr)
1623 ++len;
1624 return llvm::ArrayRef(categories, len);
1625}
1626
1627bool SBDebugger::EnableLog(const char *channel, const char **categories) {
1628 LLDB_INSTRUMENT_VA(this, channel, categories);
1629
1630 if (m_opaque_sp) {
1631 uint32_t log_options =
1633 std::string error;
1634 llvm::raw_string_ostream error_stream(error);
1635 return m_opaque_sp->EnableLog(channel, GetCategoryArray(categories), "",
1636 log_options, /*buffer_size=*/0,
1637 eLogHandlerStream, error_stream);
1638 } else
1639 return false;
1640}
1641
1643 void *baton) {
1644 LLDB_INSTRUMENT_VA(this, log_callback, baton);
1645
1646 if (m_opaque_sp) {
1647 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1648 }
1649}
1650
1651void SBDebugger::SetDestroyCallback(
1652 lldb::SBDebuggerDestroyCallback destroy_callback, void *baton) {
1653 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1654 if (m_opaque_sp) {
1655 return m_opaque_sp->SetDestroyCallback(
1656 destroy_callback, baton);
1657 }
1658}
1659
1662 void *baton) {
1663 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1664
1665 if (m_opaque_sp)
1666 return m_opaque_sp->AddDestroyCallback(destroy_callback, baton);
1667
1669}
1670
1672 LLDB_INSTRUMENT_VA(this, token);
1673
1674 if (m_opaque_sp)
1675 return m_opaque_sp->RemoveDestroyCallback(token);
1676
1677 return false;
1678}
1679
1680SBTrace
1682 const SBFileSpec &trace_description_file) {
1683 LLDB_INSTRUMENT_VA(this, error, trace_description_file);
1684 return SBTrace::LoadTraceFromFile(error, *this, trace_description_file);
1685}
1686
1688 LLDB_INSTRUMENT_VA(this);
1689
1690 if (m_opaque_sp)
1691 m_opaque_sp->RequestInterrupt();
1692}
1694 LLDB_INSTRUMENT_VA(this);
1695
1696 if (m_opaque_sp)
1697 m_opaque_sp->CancelInterruptRequest();
1698}
1699
1701 LLDB_INSTRUMENT_VA(this);
1702
1703 if (m_opaque_sp)
1704 return m_opaque_sp->InterruptRequested();
1705 return false;
1706}
1707
static llvm::raw_ostream & error(Stream &strm)
#define LLDB_INSTRUMENT()
#define LLDB_INSTRUMENT_VA(...)
#define LLDB_LOG(log,...)
The LLDB_LOG* macros defined below are the way to emit log messages.
Definition Log.h:369
#define LLDB_LOGF(log,...)
Definition Log.h:376
#define LLDB_LOG_OPTION_PREPEND_TIMESTAMP
Definition Log.h:38
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME
Definition Log.h:40
static llvm::ArrayRef< const char * > GetCategoryArray(const char **categories)
static void DumpDiagnostics(void *cookie)
static llvm::ManagedStatic< SystemLifetimeManager > g_debugger_lifetime
lldb_private::CommandInterpreterRunOptions & ref() const
void reset(lldb_private::CommandInterpreter *)
void SourceInitFileInHomeDirectory(lldb::SBCommandReturnObject &result)
lldb_private::CommandInterpreter * get()
void SourceInitFileInGlobalDirectory(lldb::SBCommandReturnObject &result)
lldb::ReturnStatus HandleCommand(const char *command_line, lldb::SBCommandReturnObject &result, bool add_to_history=false)
static lldb::SBError SetInternalVariable(const char *var_name, const char *value, const char *debugger_instance_name)
Set an internal variable.
bool DeleteCategory(const char *category_name)
Delete a type category.
lldb::LanguageType GetREPLLanguage() const
Get the current REPL language.
lldb::SBTarget GetTargetAtIndex(uint32_t idx)
Get a target by index.
lldb::SBTarget CreateTarget(const char *filename, const char *target_triple, const char *platform_name, bool add_dependent_modules, lldb::SBError &error)
Create a target with the specified parameters.
SBTypeFilter GetFilterForType(SBTypeNameSpecifier type_name_spec)
Get the filter for a type.
SBError RunREPL(lldb::LanguageType language, const char *repl_options)
Run a REPL (Read-Eval-Print Loop) for the specified language.
bool DeleteTarget(lldb::SBTarget &target)
Delete a target from the debugger.
void SkipAppInitFiles(bool b)
Set whether to skip loading application-specific .lldbinit files.
lldb::SBDebugger & operator=(const lldb::SBDebugger &rhs)
Assignment operator.
static void Terminate()
Terminate LLDB and its subsystems.
lldb::SBPlatform GetPlatformAtIndex(uint32_t idx)
Get one of the currently active platforms.
void SkipLLDBInitFiles(bool b)
Set whether to skip loading .lldbinit files.
void SetAsync(bool b)
Set whether the debugger should run in asynchronous mode.
const void * data
Definition SBDebugger.h:478
bool SetUseExternalEditor(bool input)
Set whether to use an external editor.
bool GetCloseInputOnEOF() const
Get whether to close input on EOF (deprecated).
static bool GetDefaultArchitecture(char *arch_name, size_t arch_name_len)
Get the default architecture.
static void MemoryPressureDetected()
Notify the debugger that system memory pressure has been detected.
void SetPrompt(const char *prompt)
Set the command prompt string.
bool GetDescription(lldb::SBStream &description)
Get a description of this debugger.
void DispatchInput(const void *data, size_t data_len)
Dispatch input to the debugger.
friend class SBStructuredData
Definition SBDebugger.h:681
bool GetUseExternalEditor()
Get whether an external editor is being used.
static void PrintStackTraceOnError()
Configure LLDB to print a stack trace when it crashes.
static lldb::SBDebugger Create()
Create a new debugger instance (deprecated).
void SetInputFileHandle(FILE *f, bool transfer_ownership)
Set the input file handle for the debugger.
void RunCommandInterpreter(bool auto_handle_events, bool spawn_thread)
Run the command interpreter.
static const char * GetVersionString()
Get the LLDB version string.
lldb_private::Debugger & ref() const
lldb::SBStructuredData GetSetting(const char *setting=nullptr)
Get debugger settings as structured data.
const void size_t data_len
Definition SBDebugger.h:478
const char * GetReproducerPath() const
Get the path to the reproducer.
void SetOutputFileHandle(FILE *f, bool transfer_ownership)
Set the output file handle for the debugger.
static lldb::SBError InitializeWithErrorHandling()
Initialize the LLDB debugger subsystem with error handling.
friend class SBProcess
Definition SBDebugger.h:679
void SetTerminalWidth(uint32_t term_width)
Set the terminal width.
SBTypeSummary GetSummaryForType(SBTypeNameSpecifier type_name_spec)
Get the summary for a type.
void HandleCommand(const char *command)
Execute a command in the command interpreter.
lldb::SBCommandInterpreter GetCommandInterpreter()
Get the command interpreter for this debugger.
SBFile GetInputFile()
Get the input file for the debugger.
const char * GetPrompt() const
Get the command prompt string.
friend class SBInputReader
Definition SBDebugger.h:677
bool SetUseColor(bool use_color)
Set whether to use color in output.
bool GetAsync()
Get whether the debugger is running in asynchronous mode.
const lldb::DebuggerSP & get_sp() const
lldb::SBTarget FindTargetByGloballyUniqueID(lldb::user_id_t id)
Find a target with the specified unique ID.
static bool StateIsRunningState(lldb::StateType state)
Check if a state is a running state.
SBError SetErrorFile(SBFile file)
Set the error file for the debugger.
bool SetUseSourceCache(bool use_source_cache)
Set whether to use the source cache.
uint32_t GetNumCategories()
Get the number of type categories.
static lldb::SBStringList GetInternalVariableValue(const char *var_name, const char *debugger_instance_name)
Get the value of an internal variable.
friend class SBTarget
Definition SBDebugger.h:683
void Clear()
Clear this debugger instance.
SBTypeFormat GetFormatForType(SBTypeNameSpecifier type_name_spec)
Get the format for a type.
bool GetUseColor() const
Get whether color is being used in output.
static bool SupportsLanguage(lldb::LanguageType language)
Check if a specific language is supported by LLDB.
lldb::SBListener GetListener()
Get the listener associated with this debugger.
void SetLoggingCallback(lldb::LogOutputCallback log_callback, void *baton)
Set a callback for log output.
lldb::DebuggerSP m_opaque_sp
Definition SBDebugger.h:697
lldb::ScriptLanguage GetScriptLanguage() const
Get the current scripting language.
LLDB_DEPRECATED_FIXME("Use AddDestroyCallback and RemoveDestroyCallback", "AddDestroyCallback") void SetDestroyCallback(lldb lldb::callback_token_t AddDestroyCallback(lldb::SBDebuggerDestroyCallback destroy_callback, void *baton)
Set a callback for when the debugger is destroyed (deprecated).
void SetScriptLanguage(lldb::ScriptLanguage script_lang)
Set the current scripting language.
uint32_t GetNumAvailablePlatforms()
Get the number of available platforms.
lldb::SBTarget FindTargetWithLLDBProcess(const lldb::ProcessSP &processSP)
friend class SBListener
Definition SBDebugger.h:678
SBTypeSynthetic GetSyntheticForType(SBTypeNameSpecifier type_name_spec)
Get the synthetic for a type.
void DispatchClientTelemetry(const lldb::SBStructuredData &data)
Dispatch telemetry data from client to server.
SBTypeCategory GetCategoryAtIndex(uint32_t index)
Get a type category by index.
lldb::SBPlatform GetSelectedPlatform()
Get the selected platform.
static const char * GetBroadcasterClass()
Get the broadcaster class name.
lldb::SBTarget CreateTargetWithFileAndArch(const char *filename, const char *archname)
Create a target with the specified file and architecture.
bool IsValid() const
Check if this is a valid SBDebugger object.
static void Initialize()
Initialize LLDB and its subsystems.
static bool StateIsStoppedState(lldb::StateType state)
Check if a state is a stopped state.
lldb::SBError SetCurrentPlatform(const char *platform_name)
Set the current platform by name.
lldb::SBSourceManager GetSourceManager()
Get the source manager for this debugger.
SBTypeCategory GetCategory(const char *category_name)
Get a type category by name.
void ResetStatistics()
Clear collected statistics for targets belonging to this debugger.
void SetREPLLanguage(lldb::LanguageType repl_lang)
Set the current REPL language.
SBStructuredData GetScriptInterpreterInfo(ScriptLanguage language)
Get information about a script interpreter as structured data.
static SBDebugger FindDebuggerWithID(int id)
Find a debugger by ID. Returns an invalid debugger if not found.
bool SetShowInlineDiagnostics(bool b)
Set whether to show inline diagnostics.
uint32_t GetNumPlatforms()
Get the number of currently active platforms.
void DispatchInputEndOfFile()
Signal end-of-file to the current input dispatch.
uint32_t GetTerminalWidth() const
Get the terminal width.
void SetTerminalHeight(uint32_t term_height)
Set the terminal height.
bool InterruptRequested()
Check if an interrupt has been requested.
lldb::SBTarget FindTargetWithFileAndArch(const char *filename, const char *arch)
Find a target with the specified file and architecture.
static lldb::SBStructuredData GetProgressDataFromEvent(const lldb::SBEvent &event)
Get progress data from an event.
static const char * StateAsCString(lldb::StateType state)
Convert a state type to a string.
void PushInputReader(lldb::SBInputReader &reader)
Push an input reader onto the IO handler stack.
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.
lldb::SBTarget GetDummyTarget()
Get the dummy target.
bool EnableLog(const char *channel, const char **categories)
Enable logging for a specific channel and category.
static bool SetDefaultArchitecture(const char *arch_name)
Set the default architecture.
lldb_private::Debugger * get() const
void RestoreInputTerminalState()
Restore the previously saved terminal state.
SBFile GetOutputFile()
Get the output file for the debugger.
lldb::SBBroadcaster GetBroadcaster()
Get the broadcaster that allows subscribing to events from this debugger.
void SetSelectedTarget(SBTarget &target)
Set the selected target.
SBTypeCategory GetDefaultCategory()
Get the default type category.
bool GetUseSourceCache() const
Get whether the source cache is being used.
SBFile GetErrorFile()
Get the error file for the debugger.
uint32_t GetTerminalHeight() const
Get the terminal height.
LLDB_DEPRECATED_FIXME("Use HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, " "SBFile) or HandleProcessEvent(const SBProcess &, const SBEvent &, " "FileSP, FileSP)", "HandleProcessEvent(const SBProcess &, const SBEvent &, SBFile, SBFile)") void HandleProcessEvent(const lldb voi HandleProcessEvent)(const lldb::SBProcess &process, const lldb::SBEvent &event, SBFile out, SBFile err)
Handle a process event (deprecated).
Definition SBDebugger.h:304
lldb::SBStructuredData GetAvailablePlatformInfoAtIndex(uint32_t idx)
Get information about the available platform at the given index as structured data.
static SBStructuredData GetBuildConfiguration()
Get the build configuration as structured data.
SBTypeCategory CreateCategory(const char *category_name)
Create a new type category.
bool SetCurrentPlatformSDKRoot(const char *sysroot)
Set the SDK root for the current platform.
void SetErrorFileHandle(FILE *f, bool transfer_ownership)
Set the error file handle for the debugger.
SBTrace LoadTraceFromFile(SBError &error, const SBFileSpec &trace_description_file)
Load a trace from a trace description file.
void CancelInterruptRequest()
Cancel a previously requested interrupt.
uint32_t GetNumTargets()
Get the number of targets in the debugger.
FILE * GetInputFileHandle()
Get the input file handle for the debugger.
SBError SetInputFile(SBFile file)
Set the input file for the debugger.
void DispatchInputInterrupt()
Interrupt the current input dispatch.
SBError SetInputString(const char *data)
Set the input from a string.
uint32_t GetIndexOfTarget(lldb::SBTarget target)
Get the index of a target.
SBError SetOutputFile(SBFile file)
Set the output file for the debugger.
lldb::SBTarget GetSelectedTarget()
Get the currently selected target.
void SaveInputTerminalState()
Save the current terminal state.
FILE * GetErrorFileHandle()
Get the error file handle for the debugger.
void SetSelectedPlatform(lldb::SBPlatform &platform)
Set the selected platform.
friend class SBSourceManager
Definition SBDebugger.h:680
void reset(const lldb::DebuggerSP &debugger_sp)
friend class SBPlatform
Definition SBDebugger.h:682
FILE * GetOutputFileHandle()
Get the output file handle for the debugger.
const char * GetInstanceName()
Get the instance name of this debugger.
lldb::SBTarget FindTargetWithProcessID(lldb::pid_t pid)
Find a target with the specified process ID.
static void PrintDiagnosticsOnError()
Configure LLDB to print diagnostic information when it crashes.
void SetCloseInputOnEOF(bool b)
Set whether to close input on EOF (deprecated).
friend class SBCommandInterpreter
Definition SBDebugger.h:676
lldb::user_id_t GetID()
Get the unique ID of this debugger.
lldb::SBTarget CreateTargetWithFileAndTargetTriple(const char *filename, const char *target_triple)
Create a target with the specified file and target triple.
SBDebugger()
Default constructor creates an invalid SBDebugger instance.
bool RemoveDestroyCallback(lldb::callback_token_t token)
Remove a destroy callback.
static lldb::SBStructuredData GetDiagnosticFromEvent(const lldb::SBEvent &event)
Get diagnostic information from an event.
lldb::ScriptLanguage GetScriptingLanguage(const char *script_language_name)
Get the scripting language by name.
static void Destroy(lldb::SBDebugger &debugger)
Destroy a debugger instance.
void RequestInterrupt()
Request an interrupt of the current operation.
bool Success() const
Definition SBError.cpp:81
void SetError(uint32_t err, lldb::ErrorType type)
Definition SBError.cpp:124
lldb_private::Status & ref()
Definition SBError.cpp:191
const char * GetCString() const
Get the error string as a NULL terminated UTF8 c-string.
Definition SBError.cpp:55
void Clear()
Definition SBError.cpp:63
lldb_private::Event * get() const
Definition SBEvent.cpp:134
FileSP m_opaque_sp
Definition SBFile.h:54
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)
bool IsActive() const
void reset(lldb::ListenerSP listener_sp)
const char * GetName()
lldb::PlatformSP GetSP() const
void SetSP(const lldb::PlatformSP &platform_sp)
void ReportEventState(const lldb::SBEvent &event, FILE *out) const
lldb::ProcessSP GetSP() const
static lldb::StateType GetStateFromEvent(const lldb::SBEvent &event)
lldb::SBTarget GetTarget() const
size_t GetSTDOUT(char *dst, size_t dst_len) const
bool IsValid() const
size_t GetSTDERR(char *dst, size_t dst_len) const
lldb_private::Stream & ref()
Definition SBStream.cpp:178
const char * GetData()
Definition SBStream.cpp:44
StructuredDataImplUP m_impl_up
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
void SetSP(const lldb::TargetSP &target_sp)
Definition SBTarget.cpp:591
lldb::TargetSP GetSP() const
Definition SBTarget.cpp:589
lldb::TargetSP m_opaque_sp
Definition SBTarget.h:1072
static SBTrace LoadTraceFromFile(SBError &error, SBDebugger &debugger, const SBFileSpec &trace_description_file)
See SBDebugger::LoadTraceFromFile.
Definition SBTrace.cpp:31
SBTypeFormat GetFormatForType(SBTypeNameSpecifier)
lldb::TypeNameSpecifierImplSP GetSP()
An architecture specification class.
Definition ArchSpec.h:31
bool IsValid() const
Tests if this ArchSpec is valid.
Definition ArchSpec.h:366
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:468
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition ArchSpec.cpp:548
void SetAutoHandleEvents(bool auto_handle_events)
bool IsResult(lldb::CommandInterpreterResult result)
void SkipAppInitFiles(bool skip_app_init_files)
void SkipLLDBInitFiles(bool skip_lldbinit_files)
CommandInterpreterRunResult RunCommandInterpreter(CommandInterpreterRunOptions &options)
A uniqued constant string class.
Definition ConstString.h:40
const char * AsCString(const char *value_if_empty=nullptr) const
Get the string value as a C string.
const char * GetCString() const
Get the string value as a C string.
static bool Delete(ConstString category)
static lldb::TypeCategoryImplSP GetCategoryAtIndex(size_t)
static bool GetCategory(ConstString category, lldb::TypeCategoryImplSP &entry, bool allow_create=true)
static lldb::ScriptedSyntheticChildrenSP GetSyntheticForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeFilterImplSP GetFilterForType(lldb::TypeNameSpecifierImplSP type_sp)
static lldb::TypeSummaryImplSP GetSummaryForType(lldb::TypeNameSpecifierImplSP type_sp)
static void ResetStatistics(Debugger &debugger, Target *target)
Reset metrics associated with one or all targets in a debugger.
A class to manage flag bits.
Definition Debugger.h:80
static lldb::DebuggerSP FindDebuggerWithInstanceName(llvm::StringRef instance_name)
Definition Debugger.cpp:919
static StructuredData::DictionarySP GetBuildConfiguration()
Get the build configuration as structured data.
static llvm::StringRef GetStaticBroadcasterClass()
Definition Debugger.cpp:962
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
Definition Debugger.cpp:843
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition Debugger.cpp:887
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
bool Dump(llvm::raw_ostream &stream)
Gather diagnostics and print a message to the given output stream.
static Diagnostics & Instance()
"lldb/Target/ExecutionContext.h" A class that contains an execution context.
A file utility class.
Definition FileSpec.h:57
An abstract base class for files.
Definition File.h:36
virtual FILE * GetStream()
Get the underlying libc stream for this file, or NULL.
Definition File.cpp:128
@ eOpenOptionReadOnly
Definition File.h:51
@ eOpenOptionWriteOnly
Definition File.h:52
static size_t RemoveOrphanSharedModules(bool mandatory)
void SetPlatformName(const char *platform_name)
void SetSelectedPlatform(const lldb::PlatformSP &platform_sp)
Definition Platform.h:1111
lldb::PlatformSP GetOrCreate(llvm::StringRef name)
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:226
static lldb::PlatformSP GetHostPlatform()
Get the native host platform plug-in.
Definition Platform.cpp:134
static llvm::StringRef GetPlatformPluginDescriptionAtIndex(uint32_t idx)
static llvm::StringRef GetPlatformPluginNameAtIndex(uint32_t idx)
static const ProgressEventData * GetEventDataFromEvent(const Event *event_ptr)
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
virtual StructuredData::DictionarySP GetInterpreterInfo()
An error handling class.
Definition Status.h:118
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
Definition Status.cpp:106
static Status FromErrorString(const char *str)
Definition Status.h:141
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
Definition Status.cpp:137
llvm::StringRef GetString() const
A stream class that can stream formatted output to a file.
Definition Stream.h:28
size_t Printf(const char *format,...) __attribute__((format(printf
Output printf formatted output to the stream.
Definition Stream.cpp:134
size_t PutCString(llvm::StringRef cstr)
Output a C string to the stream.
Definition Stream.cpp:65
size_t SplitIntoLines(const std::string &lines)
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
static ObjectSP ParseJSON(llvm::StringRef json_text)
static ArchSpec GetDefaultArchitecture()
Definition Target.cpp:2805
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2809
static bool SupportsLanguageStatic(lldb::LanguageType language)
#define LLDB_INVALID_UID
#define UINT32_MAX
#define LLDB_INVALID_CALLBACK_TOKEN
Definition lldb-types.h:71
A class that represents a running process on the host machine.
Log * GetLog(Cat mask)
Retrieve the Log object for the channel associated with the given log enum.
Definition Log.h:332
const char * GetVersion()
Retrieves a string representing the complete LLDB version, which includes the lldb version number,...
Definition Version.cpp:38
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
bool StateIsRunningState(lldb::StateType state)
Check if a state represents a state where the process or thread is running.
Definition State.cpp:68
const char * StateAsCString(lldb::StateType state)
Converts a StateType to a C string.
Definition State.cpp:14
ScriptLanguage
Script interpreter types.
@ eScriptLanguageDefault
@ eScriptLanguageNone
@ eDescriptionLevelBrief
@ eCommandInterpreterResultInferiorCrash
Stopped because the corresponding option was set and the inferior crashed.
@ eCommandInterpreterResultQuitRequested
Stopped because quit was requested.
class LLDB_API SBTypeCategory
Definition SBDefines.h:122
std::shared_ptr< lldb_private::Platform > PlatformSP
class LLDB_API SBFile
Definition SBDefines.h:74
StateType
Process and Thread States.
LanguageType
Programming language type.
@ eLanguageTypeUnknown
Unknown or invalid language value.
class LLDB_API SBTypeFilter
Definition SBDefines.h:125
class LLDB_API SBTypeFormat
Definition SBDefines.h:126
std::shared_ptr< lldb_private::Process > ProcessSP
std::shared_ptr< lldb_private::Debugger > DebuggerSP
std::shared_ptr< lldb_private::Event > EventSP
uint64_t pid_t
Definition lldb-types.h:83
std::shared_ptr< lldb_private::Listener > ListenerSP
int32_t callback_token_t
Definition lldb-types.h:81
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
uint64_t user_id_t
Definition lldb-types.h:82
class LLDB_API SBStringList
Definition SBDefines.h:110
void(* SBDebuggerDestroyCallback)(lldb::user_id_t debugger_id, void *baton)
Definition SBDefines.h:146
void(* LogOutputCallback)(const char *, void *baton)
Definition lldb-types.h:73
std::shared_ptr< lldb_private::Target > TargetSP
class LLDB_API SBError
Definition SBDefines.h:69
std::shared_ptr< lldb_private::File > FileSP
std::shared_ptr< lldb_private::OptionValue > OptionValueSP
class LLDB_API SBTypeSynthetic
Definition SBDefines.h:133
class LLDB_API SBCommandInterpreterRunResult
Definition SBDefines.h:59
InputReaderGranularity
Token size/granularities for Input Readers.
class LLDB_API SBTypeSummary
Definition SBDefines.h:131
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)