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(nullptr);
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
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(
530 m_opaque_sp->GetCommandInterpreter().GetSelectedTarget());
531 std::unique_lock<std::recursive_mutex> lock;
532 if (target_sp)
533 lock = std::unique_lock<std::recursive_mutex>(target_sp->GetAPIMutex());
534
537
538 sb_interpreter.HandleCommand(command, result, false);
539
540 result.PutError(m_opaque_sp->GetErrorFileSP());
541 result.PutOutput(m_opaque_sp->GetOutputFileSP());
542
543 if (!m_opaque_sp->GetAsyncExecution()) {
544 SBProcess process(GetCommandInterpreter().GetProcess());
545 ProcessSP process_sp(process.GetSP());
546 if (process_sp) {
547 EventSP event_sp;
548 ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
549 while (lldb_listener_sp->GetEventForBroadcaster(
550 process_sp.get(), event_sp, std::chrono::seconds(0))) {
551 SBEvent event(event_sp);
552 HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile());
553 }
554 }
555 }
556 }
557}
558
560 LLDB_INSTRUMENT_VA(this);
561
562 SBListener sb_listener;
563 if (m_opaque_sp)
564 sb_listener.reset(m_opaque_sp->GetListener());
565
566 return sb_listener;
567}
568
569void SBDebugger::HandleProcessEvent(const SBProcess &process,
570 const SBEvent &event, SBFile out,
571 SBFile err) {
572 LLDB_INSTRUMENT_VA(this, process, event, out, err);
573
574 return HandleProcessEvent(process, event, out.m_opaque_sp, err.m_opaque_sp);
575}
576
577void SBDebugger::HandleProcessEvent(const SBProcess &process,
578 const SBEvent &event, FILE *out,
579 FILE *err) {
580 LLDB_INSTRUMENT_VA(this, process, event, out, err);
581
582 FileSP outfile =
583 std::make_shared<NativeFile>(out, File::eOpenOptionWriteOnly, false);
584 FileSP errfile =
585 std::make_shared<NativeFile>(err, File::eOpenOptionWriteOnly, false);
586 return HandleProcessEvent(process, event, outfile, errfile);
587}
588
589void SBDebugger::HandleProcessEvent(const SBProcess &process,
590 const SBEvent &event, FileSP out_sp,
591 FileSP err_sp) {
592
593 LLDB_INSTRUMENT_VA(this, process, event, out_sp, err_sp);
594
595 if (!process.IsValid())
596 return;
597
598 TargetSP target_sp(process.GetTarget().GetSP());
599 if (!target_sp)
600 return;
601
602 const uint32_t event_type = event.GetType();
603 char stdio_buffer[1024];
604 size_t len;
605
606 std::lock_guard<std::recursive_mutex> guard(target_sp->GetAPIMutex());
607
608 if (event_type &
610 // Drain stdout when we stop just in case we have any bytes
611 while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0)
612 if (out_sp)
613 out_sp->Write(stdio_buffer, len);
614 }
615
616 if (event_type &
618 // Drain stderr when we stop just in case we have any bytes
619 while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0)
620 if (err_sp)
621 err_sp->Write(stdio_buffer, len);
622 }
623
624 if (event_type & Process::eBroadcastBitStateChanged) {
625 StateType event_state = SBProcess::GetStateFromEvent(event);
626
627 if (event_state == eStateInvalid)
628 return;
629
630 bool is_stopped = StateIsStoppedState(event_state);
631 if (!is_stopped)
632 process.ReportEventState(event, out_sp);
633 }
634}
635
637 LLDB_INSTRUMENT_VA(this);
638
639 SBSourceManager sb_source_manager(*this);
640 return sb_source_manager;
641}
642
643bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
644 LLDB_INSTRUMENT_VA(arch_name, arch_name_len);
645
646 if (arch_name && arch_name_len) {
648
649 if (default_arch.IsValid()) {
650 const std::string &triple_str = default_arch.GetTriple().str();
651 if (!triple_str.empty())
652 ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str());
653 else
654 ::snprintf(arch_name, arch_name_len, "%s",
655 default_arch.GetArchitectureName());
656 return true;
657 }
658 }
659 if (arch_name && arch_name_len)
660 arch_name[0] = '\0';
661 return false;
662}
663
664bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
665 LLDB_INSTRUMENT_VA(arch_name);
666
667 if (arch_name) {
668 ArchSpec arch(arch_name);
669 if (arch.IsValid()) {
671 return true;
672 }
673 }
674 return false;
675}
676
678SBDebugger::GetScriptingLanguage(const char *script_language_name) {
679 LLDB_INSTRUMENT_VA(this, script_language_name);
680
681 if (!script_language_name)
684 llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr);
685}
686
689 LLDB_INSTRUMENT_VA(this, language);
691 if (m_opaque_sp) {
693 m_opaque_sp->GetScriptInterpreter(language);
694 if (interp) {
695 data.m_impl_up->SetObjectSP(interp->GetInterpreterInfo());
696 }
697 }
698 return data;
699}
700
703
705}
706
708 LLDB_INSTRUMENT_VA(state);
709
710 return lldb_private::StateAsCString(state);
711}
712
720
722 LLDB_INSTRUMENT_VA(state);
723
724 const bool result = lldb_private::StateIsRunningState(state);
725
726 return result;
727}
728
730 LLDB_INSTRUMENT_VA(state);
731
732 const bool result = lldb_private::StateIsStoppedState(state, false);
733
734 return result;
735}
736
738 const char *target_triple,
739 const char *platform_name,
740 bool add_dependent_modules,
741 lldb::SBError &sb_error) {
742 LLDB_INSTRUMENT_VA(this, filename, target_triple, platform_name,
743 add_dependent_modules, sb_error);
744
745 SBTarget sb_target;
746 TargetSP target_sp;
747 if (m_opaque_sp) {
748 sb_error.Clear();
749 OptionGroupPlatform platform_options(false);
750 platform_options.SetPlatformName(platform_name);
751
752 sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget(
753 *m_opaque_sp, filename, target_triple,
754 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
755 &platform_options, target_sp);
756
757 if (sb_error.Success())
758 sb_target.SetSP(target_sp);
759 } else {
760 sb_error = Status::FromErrorString("invalid debugger");
761 }
762
763 Log *log = GetLog(LLDBLog::API);
764 LLDB_LOGF(log,
765 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
766 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
767 "SBTarget(%p)",
768 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
769 platform_name, add_dependent_modules, sb_error.GetCString(),
770 static_cast<void *>(target_sp.get()));
771
772 return sb_target;
773}
774
777 const char *target_triple) {
778 LLDB_INSTRUMENT_VA(this, filename, target_triple);
779
780 SBTarget sb_target;
781 TargetSP target_sp;
782 if (m_opaque_sp) {
783 const bool add_dependent_modules = true;
784 Status error(m_opaque_sp->GetTargetList().CreateTarget(
785 *m_opaque_sp, filename, target_triple,
786 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
787 target_sp));
788 sb_target.SetSP(target_sp);
789 }
790
791 Log *log = GetLog(LLDBLog::API);
792 LLDB_LOGF(log,
793 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
794 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
795 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
796 static_cast<void *>(target_sp.get()));
797
798 return sb_target;
799}
800
802 const char *arch_cstr) {
803 LLDB_INSTRUMENT_VA(this, filename, arch_cstr);
804
805 Log *log = GetLog(LLDBLog::API);
806
807 SBTarget sb_target;
808 TargetSP target_sp;
809 if (m_opaque_sp) {
811 if (arch_cstr == nullptr) {
812 // The version of CreateTarget that takes an ArchSpec won't accept an
813 // empty ArchSpec, so when the arch hasn't been specified, we need to
814 // call the target triple version.
815 error = m_opaque_sp->GetTargetList().CreateTarget(
816 *m_opaque_sp, filename, arch_cstr, eLoadDependentsYes, nullptr,
817 target_sp);
818 } else {
819 PlatformSP platform_sp =
820 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
821 ArchSpec arch =
822 Platform::GetAugmentedArchSpec(platform_sp.get(), arch_cstr);
823 if (arch.IsValid())
824 error = m_opaque_sp->GetTargetList().CreateTarget(
825 *m_opaque_sp, filename, arch, eLoadDependentsYes, platform_sp,
826 target_sp);
827 else
828 error = Status::FromErrorStringWithFormat("invalid arch_cstr: %s",
829 arch_cstr);
830 }
831 if (error.Success())
832 sb_target.SetSP(target_sp);
833 }
834
835 LLDB_LOGF(log,
836 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
837 "arch=%s) => SBTarget(%p)",
838 static_cast<void *>(m_opaque_sp.get()),
839 filename ? filename : "<unspecified>",
840 arch_cstr ? arch_cstr : "<unspecified>",
841 static_cast<void *>(target_sp.get()));
842
843 return sb_target;
844}
845
846SBTarget SBDebugger::CreateTarget(const char *filename) {
847 LLDB_INSTRUMENT_VA(this, filename);
848
849 SBTarget sb_target;
850 TargetSP target_sp;
851 if (m_opaque_sp) {
853 const bool add_dependent_modules = true;
854 error = m_opaque_sp->GetTargetList().CreateTarget(
855 *m_opaque_sp, filename, "",
856 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
857 target_sp);
858
859 if (error.Success())
860 sb_target.SetSP(target_sp);
861 }
862 Log *log = GetLog(LLDBLog::API);
863 LLDB_LOGF(log,
864 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
865 static_cast<void *>(m_opaque_sp.get()), filename,
866 static_cast<void *>(target_sp.get()));
867 return sb_target;
868}
869
871 LLDB_INSTRUMENT_VA(this);
872
873 SBTarget sb_target;
874 if (m_opaque_sp) {
875 sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this());
876 }
877 Log *log = GetLog(LLDBLog::API);
878 LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
879 static_cast<void *>(m_opaque_sp.get()),
880 static_cast<void *>(sb_target.GetSP().get()));
881 return sb_target;
882}
883
885 LLDB_INSTRUMENT_VA(this);
886 if (m_opaque_sp) {
887 m_opaque_sp->DispatchClientTelemetry(*entry.m_impl_up);
888 } else {
889 Log *log = GetLog(LLDBLog::API);
890 LLDB_LOGF(log,
891 "Could not send telemetry from SBDebugger - debugger was null.");
892 }
893}
894
896 LLDB_INSTRUMENT_VA(this, target);
897
898 bool result = false;
899 if (m_opaque_sp) {
900 TargetSP target_sp(target.GetSP());
901 if (target_sp) {
902 // No need to lock, the target list is thread safe
903 result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
904 target_sp->Destroy();
905 target.Clear();
906 }
907 }
908
909 Log *log = GetLog(LLDBLog::API);
910 LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
911 static_cast<void *>(m_opaque_sp.get()),
912 static_cast<void *>(target.m_opaque_sp.get()), result);
913
914 return result;
915}
916
918 LLDB_INSTRUMENT_VA(this, idx);
919
920 SBTarget sb_target;
921 if (m_opaque_sp) {
922 // No need to lock, the target list is thread safe
923 sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx));
924 }
925 return sb_target;
926}
927
929 LLDB_INSTRUMENT_VA(this, target);
930
931 lldb::TargetSP target_sp = target.GetSP();
932 if (!target_sp)
933 return UINT32_MAX;
934
935 if (!m_opaque_sp)
936 return UINT32_MAX;
937
938 return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
939}
940
942 LLDB_INSTRUMENT_VA(this, id);
943 SBTarget sb_target;
944 if (m_opaque_sp) {
945 // No need to lock, the target list is thread safe
946 sb_target.SetSP(
947 m_opaque_sp->GetTargetList().FindTargetByGloballyUniqueID(id));
948 }
949 return sb_target;
950}
951
953 LLDB_INSTRUMENT_VA(this, pid);
954
955 SBTarget sb_target;
956 if (m_opaque_sp) {
957 // No need to lock, the target list is thread safe
958 sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
959 }
960 return sb_target;
961}
962
964 const char *arch_name) {
965 LLDB_INSTRUMENT_VA(this, filename, arch_name);
966
967 SBTarget sb_target;
968 if (m_opaque_sp && filename && filename[0]) {
969 // No need to lock, the target list is thread safe
971 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
972 TargetSP target_sp(
973 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
974 FileSpec(filename), arch_name ? &arch : nullptr));
975 sb_target.SetSP(target_sp);
976 }
977 return sb_target;
978}
979
981 SBTarget sb_target;
982 if (m_opaque_sp) {
983 // No need to lock, the target list is thread safe
984 sb_target.SetSP(
985 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
986 }
987 return sb_target;
988}
989
991 LLDB_INSTRUMENT_VA(this);
992
993 if (m_opaque_sp) {
994 // No need to lock, the target list is thread safe
995 return m_opaque_sp->GetTargetList().GetNumTargets();
996 }
997 return 0;
998}
999
1001 LLDB_INSTRUMENT_VA(this);
1002
1003 Log *log = GetLog(LLDBLog::API);
1004
1005 SBTarget sb_target;
1006 TargetSP target_sp;
1007 if (m_opaque_sp) {
1008 // No need to lock, the target list is thread safe
1009 target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget();
1010 sb_target.SetSP(target_sp);
1011 }
1012
1013 if (log) {
1014 SBStream sstr;
1015 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1016 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1017 static_cast<void *>(m_opaque_sp.get()),
1018 static_cast<void *>(target_sp.get()), sstr.GetData());
1019 }
1020
1021 return sb_target;
1022}
1023
1025 LLDB_INSTRUMENT_VA(this, sb_target);
1026
1027 Log *log = GetLog(LLDBLog::API);
1028
1029 TargetSP target_sp(sb_target.GetSP());
1030 if (m_opaque_sp) {
1031 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1032 }
1033 if (log) {
1034 SBStream sstr;
1035 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1036 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1037 static_cast<void *>(m_opaque_sp.get()),
1038 static_cast<void *>(target_sp.get()), sstr.GetData());
1039 }
1040}
1041
1043 LLDB_INSTRUMENT_VA(this);
1044
1045 Log *log = GetLog(LLDBLog::API);
1046
1047 SBPlatform sb_platform;
1048 DebuggerSP debugger_sp(m_opaque_sp);
1049 if (debugger_sp) {
1050 sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1051 }
1052 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1053 static_cast<void *>(m_opaque_sp.get()),
1054 static_cast<void *>(sb_platform.GetSP().get()),
1055 sb_platform.GetName());
1056 return sb_platform;
1057}
1058
1060 LLDB_INSTRUMENT_VA(this, sb_platform);
1061
1062 Log *log = GetLog(LLDBLog::API);
1063
1064 DebuggerSP debugger_sp(m_opaque_sp);
1065 if (debugger_sp) {
1066 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
1067 }
1068
1069 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1070 static_cast<void *>(m_opaque_sp.get()),
1071 static_cast<void *>(sb_platform.GetSP().get()),
1072 sb_platform.GetName());
1073}
1074
1076 LLDB_INSTRUMENT_VA(this);
1077
1078 if (m_opaque_sp) {
1079 // No need to lock, the platform list is thread safe
1080 return m_opaque_sp->GetPlatformList().GetSize();
1081 }
1082 return 0;
1083}
1084
1086 LLDB_INSTRUMENT_VA(this, idx);
1087
1088 SBPlatform sb_platform;
1089 if (m_opaque_sp) {
1090 // No need to lock, the platform list is thread safe
1091 sb_platform.SetSP(m_opaque_sp->GetPlatformList().GetAtIndex(idx));
1092 }
1093 return sb_platform;
1094}
1095
1097 LLDB_INSTRUMENT_VA(this);
1098
1099 uint32_t idx = 0;
1100 while (true) {
1102 break;
1103 }
1104 ++idx;
1105 }
1106 // +1 for the host platform, which should always appear first in the list.
1107 return idx + 1;
1108}
1109
1111 LLDB_INSTRUMENT_VA(this, idx);
1112
1114 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1115 llvm::StringRef name_str("name"), desc_str("description");
1116
1117 if (idx == 0) {
1118 PlatformSP host_platform_sp(Platform::GetHostPlatform());
1119 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1120 platform_dict->AddStringItem(
1121 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1122 } else if (idx > 0) {
1123 llvm::StringRef plugin_name =
1125 if (plugin_name.empty()) {
1126 return data;
1127 }
1128 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1129
1130 llvm::StringRef plugin_desc =
1132 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1133 }
1134
1135 data.m_impl_up->SetObjectSP(
1136 StructuredData::ObjectSP(platform_dict.release()));
1137 return data;
1138}
1139
1140void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
1141 LLDB_INSTRUMENT_VA(this, baton, data, data_len);
1142
1144}
1145
1146void SBDebugger::DispatchInput(const void *data, size_t data_len) {
1148
1149 // Log *log(GetLog (LLDBLog::API));
1150 //
1151 // if (log)
1152 // LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\",
1153 // size_t=%" PRIu64 ")",
1154 // m_opaque_sp.get(),
1155 // (int) data_len,
1156 // (const char *) data,
1157 // (uint64_t)data_len);
1158 //
1159 // if (m_opaque_sp)
1160 // m_opaque_sp->DispatchInput ((const char *) data, data_len);
1161}
1162
1164 LLDB_INSTRUMENT_VA(this);
1165
1166 if (m_opaque_sp)
1167 m_opaque_sp->DispatchInputInterrupt();
1168}
1169
1171 LLDB_INSTRUMENT_VA(this);
1172
1173 if (m_opaque_sp)
1174 m_opaque_sp->DispatchInputEndOfFile();
1175}
1176
1178 LLDB_INSTRUMENT_VA(this, reader);
1179}
1180
1181void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1182 bool spawn_thread) {
1183 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread);
1184
1185 if (m_opaque_sp) {
1187 options.SetAutoHandleEvents(auto_handle_events);
1188 options.SetSpawnThread(spawn_thread);
1189 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1190 }
1191}
1192
1193void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1194 bool spawn_thread,
1196 int &num_errors, bool &quit_requested,
1197 bool &stopped_for_crash)
1198
1199{
1200 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread, options,
1201 num_errors, quit_requested, stopped_for_crash);
1202
1203 if (m_opaque_sp) {
1204 options.SetAutoHandleEvents(auto_handle_events);
1205 options.SetSpawnThread(spawn_thread);
1206 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1208 interp.RunCommandInterpreter(options.ref());
1209 num_errors = result.GetNumErrors();
1210 quit_requested =
1212 stopped_for_crash =
1214 }
1215}
1216
1218 const SBCommandInterpreterRunOptions &options) {
1219 LLDB_INSTRUMENT_VA(this, options);
1220
1221 if (!m_opaque_sp)
1223
1224 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1226 interp.RunCommandInterpreter(options.ref());
1227
1228 return SBCommandInterpreterRunResult(result);
1229}
1230
1232 const char *repl_options) {
1233 LLDB_INSTRUMENT_VA(this, language, repl_options);
1234
1235 SBError error;
1236 if (m_opaque_sp)
1237 error.ref() = m_opaque_sp->RunREPL(language, repl_options);
1238 else
1239 error = Status::FromErrorString("invalid debugger");
1240 return error;
1241}
1242
1243void SBDebugger::reset(const DebuggerSP &debugger_sp) {
1244 m_opaque_sp = debugger_sp;
1245}
1246
1247Debugger *SBDebugger::get() const { return m_opaque_sp.get(); }
1248
1250 assert(m_opaque_sp.get());
1251 return *m_opaque_sp;
1252}
1253
1255
1258
1259 // No need to lock, the debugger list is thread safe
1260 SBDebugger sb_debugger;
1261 DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id);
1262 if (debugger_sp)
1263 sb_debugger.reset(debugger_sp);
1264 return sb_debugger;
1265}
1266
1268 LLDB_INSTRUMENT_VA(this);
1269
1270 if (!m_opaque_sp)
1271 return nullptr;
1272
1273 return ConstString(m_opaque_sp->GetInstanceName()).AsCString(nullptr);
1274}
1275
1276SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
1277 const char *debugger_instance_name) {
1278 LLDB_INSTRUMENT_VA(var_name, value, debugger_instance_name);
1279
1280 SBError sb_error;
1281 DebuggerSP debugger_sp(
1282 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1283 Status error;
1284 if (debugger_sp) {
1285 ExecutionContext exe_ctx(
1286 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1287 error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign,
1288 var_name, value);
1289 } else {
1291 "invalid debugger instance name '%s'", debugger_instance_name);
1292 }
1293 if (error.Fail())
1294 sb_error.SetError(std::move(error));
1295 return sb_error;
1296}
1297
1300 const char *debugger_instance_name) {
1301 LLDB_INSTRUMENT_VA(var_name, debugger_instance_name);
1302
1303 DebuggerSP debugger_sp(
1304 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1305 Status error;
1306 if (debugger_sp) {
1307 ExecutionContext exe_ctx(
1308 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1309 lldb::OptionValueSP value_sp(
1310 debugger_sp->GetPropertyValue(&exe_ctx, var_name, error));
1311 if (value_sp) {
1312 StreamString value_strm;
1313 value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
1314 const std::string &value_str = std::string(value_strm.GetString());
1315 if (!value_str.empty()) {
1316 StringList string_list;
1317 string_list.SplitIntoLines(value_str);
1318 return SBStringList(&string_list);
1319 }
1320 }
1321 }
1322 return SBStringList();
1323}
1324
1326 LLDB_INSTRUMENT_VA(this);
1327
1328 return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1329}
1330
1331void SBDebugger::SetTerminalWidth(uint32_t term_width) {
1332 LLDB_INSTRUMENT_VA(this, term_width);
1333
1334 if (m_opaque_sp)
1335 m_opaque_sp->SetTerminalWidth(term_width);
1336}
1337
1339 LLDB_INSTRUMENT_VA(this);
1340
1341 return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1342}
1343
1344void SBDebugger::SetTerminalHeight(uint32_t term_height) {
1345 LLDB_INSTRUMENT_VA(this, term_height);
1346
1347 if (m_opaque_sp)
1348 m_opaque_sp->SetTerminalHeight(term_height);
1349}
1350
1351const char *SBDebugger::GetPrompt() const {
1352 LLDB_INSTRUMENT_VA(this);
1353
1354 Log *log = GetLog(LLDBLog::API);
1355
1356 LLDB_LOG(log, "SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1357 static_cast<void *>(m_opaque_sp.get()),
1358 (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
1359
1360 return (m_opaque_sp ? ConstString(m_opaque_sp->GetPrompt()).GetCString()
1361 : nullptr);
1362}
1363
1364void SBDebugger::SetPrompt(const char *prompt) {
1365 LLDB_INSTRUMENT_VA(this, prompt);
1366
1367 if (m_opaque_sp)
1368 m_opaque_sp->SetPrompt(llvm::StringRef(prompt));
1369}
1370
1372 LLDB_INSTRUMENT_VA(this);
1373
1374 return "GetReproducerPath has been deprecated";
1375}
1376
1378 LLDB_INSTRUMENT_VA(this);
1379
1380 return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
1381}
1382
1384 LLDB_INSTRUMENT_VA(this, script_lang);
1385
1386 if (m_opaque_sp) {
1387 m_opaque_sp->SetScriptLanguage(script_lang);
1388 }
1389}
1390
1392 LLDB_INSTRUMENT_VA(this);
1393
1394 return (m_opaque_sp ? m_opaque_sp->GetREPLLanguage() : eLanguageTypeUnknown);
1395}
1396
1398 LLDB_INSTRUMENT_VA(this, repl_lang);
1399
1400 if (m_opaque_sp) {
1401 m_opaque_sp->SetREPLLanguage(repl_lang);
1402 }
1403}
1404
1406 LLDB_INSTRUMENT_VA(this, value);
1407
1408 return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
1409}
1410
1412 LLDB_INSTRUMENT_VA(this);
1413
1414 return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
1415}
1416
1417bool SBDebugger::SetUseColor(bool value) {
1418 LLDB_INSTRUMENT_VA(this, value);
1419
1420 return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
1421}
1422
1424 LLDB_INSTRUMENT_VA(this);
1425
1426 return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
1427}
1428
1430 LLDB_INSTRUMENT_VA(this, value);
1431
1432 return (m_opaque_sp ? m_opaque_sp->SetShowInlineDiagnostics(value) : false);
1433}
1434
1436 LLDB_INSTRUMENT_VA(this, value);
1437
1438 return (m_opaque_sp ? m_opaque_sp->SetUseSourceCache(value) : false);
1439}
1440
1442 LLDB_INSTRUMENT_VA(this);
1443
1444 return (m_opaque_sp ? m_opaque_sp->GetUseSourceCache() : false);
1445}
1446
1448 LLDB_INSTRUMENT_VA(this, description);
1449
1450 Stream &strm = description.ref();
1451
1452 if (m_opaque_sp) {
1453 const char *name = m_opaque_sp->GetInstanceName().c_str();
1454 user_id_t id = m_opaque_sp->GetID();
1455 strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
1456 } else
1457 strm.PutCString("No value");
1458
1459 return true;
1460}
1461
1463 LLDB_INSTRUMENT_VA(this);
1464
1465 return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
1466}
1467
1468SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {
1469 LLDB_INSTRUMENT_VA(this, platform_name_cstr);
1470
1471 SBError sb_error;
1472 if (m_opaque_sp) {
1473 if (platform_name_cstr && platform_name_cstr[0]) {
1474 PlatformList &platforms = m_opaque_sp->GetPlatformList();
1475 if (PlatformSP platform_sp = platforms.GetOrCreate(platform_name_cstr))
1476 platforms.SetSelectedPlatform(platform_sp);
1477 else
1478 sb_error.ref() = Status::FromErrorString("platform not found");
1479 } else {
1480 sb_error.ref() = Status::FromErrorString("invalid platform name");
1481 }
1482 } else {
1483 sb_error.ref() = Status::FromErrorString("invalid debugger");
1484 }
1485 return sb_error;
1486}
1487
1488bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {
1489 LLDB_INSTRUMENT_VA(this, sysroot);
1490
1491 if (SBPlatform platform = GetSelectedPlatform()) {
1492 platform.SetSDKRoot(sysroot);
1493 return true;
1494 }
1495 return false;
1496}
1497
1499 LLDB_INSTRUMENT_VA(this);
1500
1501 return false;
1502}
1503
1505 LLDB_INSTRUMENT_VA(this, b);
1506}
1507
1508SBTypeCategory SBDebugger::GetCategory(const char *category_name) {
1509 LLDB_INSTRUMENT_VA(this, category_name);
1510
1511 if (!category_name || *category_name == 0)
1512 return SBTypeCategory();
1513
1514 TypeCategoryImplSP category_sp;
1515
1517 category_sp, false)) {
1518 return SBTypeCategory(category_sp);
1519 } else {
1520 return SBTypeCategory();
1521 }
1522}
1523
1525 LLDB_INSTRUMENT_VA(this, lang_type);
1526
1527 TypeCategoryImplSP category_sp;
1528 if (DataVisualization::Categories::GetCategory(lang_type, category_sp)) {
1529 return SBTypeCategory(category_sp);
1530 } else {
1531 return SBTypeCategory();
1532 }
1533}
1534
1535SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {
1536 LLDB_INSTRUMENT_VA(this, category_name);
1537
1538 if (!category_name || *category_name == 0)
1539 return SBTypeCategory();
1540
1541 TypeCategoryImplSP category_sp;
1542
1544 category_sp, true)) {
1545 return SBTypeCategory(category_sp);
1546 } else {
1547 return SBTypeCategory();
1548 }
1549}
1550
1551bool SBDebugger::DeleteCategory(const char *category_name) {
1552 LLDB_INSTRUMENT_VA(this, category_name);
1553
1554 if (!category_name || *category_name == 0)
1555 return false;
1556
1558}
1559
1565
1572
1574 LLDB_INSTRUMENT_VA(this);
1575
1576 return GetCategory("default");
1577}
1578
1580 LLDB_INSTRUMENT_VA(this, type_name);
1581
1582 SBTypeCategory default_category_sb = GetDefaultCategory();
1583 if (default_category_sb.GetEnabled())
1584 return default_category_sb.GetFormatForType(type_name);
1585 return SBTypeFormat();
1586}
1587
1589 LLDB_INSTRUMENT_VA(this, type_name);
1590
1591 if (!type_name.IsValid())
1592 return SBTypeSummary();
1594}
1595
1597 LLDB_INSTRUMENT_VA(this, type_name);
1598
1599 if (!type_name.IsValid())
1600 return SBTypeFilter();
1602}
1603
1605 LLDB_INSTRUMENT_VA(this, type_name);
1606
1607 if (!type_name.IsValid())
1608 return SBTypeSynthetic();
1609 return SBTypeSynthetic(
1611}
1612
1618
1619static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) {
1620 if (categories == nullptr)
1621 return {};
1622 size_t len = 0;
1623 while (categories[len] != nullptr)
1624 ++len;
1625 return llvm::ArrayRef(categories, len);
1626}
1627
1628bool SBDebugger::EnableLog(const char *channel, const char **categories) {
1629 LLDB_INSTRUMENT_VA(this, channel, categories);
1630
1631 if (m_opaque_sp) {
1632 uint32_t log_options =
1634 std::string error;
1635 llvm::raw_string_ostream error_stream(error);
1636 return m_opaque_sp->EnableLog(channel, GetCategoryArray(categories), "",
1637 log_options, /*buffer_size=*/0,
1638 eLogHandlerStream, error_stream);
1639 } else
1640 return false;
1641}
1642
1644 void *baton) {
1645 LLDB_INSTRUMENT_VA(this, log_callback, baton);
1646
1647 if (m_opaque_sp) {
1648 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1649 }
1650}
1651
1652void SBDebugger::SetDestroyCallback(
1653 lldb::SBDebuggerDestroyCallback destroy_callback, void *baton) {
1654 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1655 if (m_opaque_sp) {
1656 return m_opaque_sp->SetDestroyCallback(
1657 destroy_callback, baton);
1658 }
1659}
1660
1663 void *baton) {
1664 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1665
1666 if (m_opaque_sp)
1667 return m_opaque_sp->AddDestroyCallback(destroy_callback, baton);
1668
1670}
1671
1673 LLDB_INSTRUMENT_VA(this, token);
1674
1675 if (m_opaque_sp)
1676 return m_opaque_sp->RemoveDestroyCallback(token);
1677
1678 return false;
1679}
1680
1681SBTrace
1683 const SBFileSpec &trace_description_file) {
1684 LLDB_INSTRUMENT_VA(this, error, trace_description_file);
1685 return SBTrace::LoadTraceFromFile(error, *this, trace_description_file);
1686}
1687
1689 LLDB_INSTRUMENT_VA(this);
1690
1691 if (m_opaque_sp)
1692 m_opaque_sp->RequestInterrupt();
1693}
1695 LLDB_INSTRUMENT_VA(this);
1696
1697 if (m_opaque_sp)
1698 m_opaque_sp->CancelInterruptRequest();
1699}
1700
1702 LLDB_INSTRUMENT_VA(this);
1703
1704 if (m_opaque_sp)
1705 return m_opaque_sp->InterruptRequested();
1706 return false;
1707}
1708
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:364
#define LLDB_LOGF(log,...)
Definition Log.h:378
#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:480
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:683
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:480
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:681
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:679
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
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:685
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:699
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:680
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:306
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:682
void reset(const lldb::DebuggerSP &debugger_sp)
friend class SBPlatform
Definition SBDebugger.h:684
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:678
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.
lldb::SBTarget FindTargetByGloballyUniqueID(lldb::user_id_t id) const
Find a target with the specified unique ID.
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:596
lldb::TargetSP GetSP() const
Definition SBTarget.cpp:594
lldb::TargetSP m_opaque_sp
Definition SBTarget.h:1074
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:32
bool IsValid() const
Tests if this ArchSpec is valid.
Definition ArchSpec.h:370
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:460
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition ArchSpec.cpp:557
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 * GetCString() const
Get the string value as a C string.
const char * AsCString(const char *value_if_empty) 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:100
static lldb::DebuggerSP FindDebuggerWithInstanceName(llvm::StringRef instance_name)
Definition Debugger.cpp:998
static StructuredData::DictionarySP GetBuildConfiguration()
Get the build configuration as structured data.
static llvm::StringRef GetStaticBroadcasterClass()
static lldb::DebuggerSP CreateInstance(lldb::LogOutputCallback log_callback=nullptr, void *baton=nullptr)
Definition Debugger.cpp:922
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition Debugger.cpp:966
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 FileBase.h:34
virtual FILE * GetStream()
Get the underlying libc stream for this file, or NULL.
Definition File.cpp:121
static size_t RemoveOrphanSharedModules(bool mandatory)
void SetPlatformName(const char *platform_name)
void SetSelectedPlatform(const lldb::PlatformSP &platform_sp)
Definition Platform.h:1193
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:321
static lldb::PlatformSP GetHostPlatform()
Get the native host platform plug-in.
Definition Platform.cpp:139
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:136
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:63
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:2865
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2869
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:327
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)