[Go to site: main page, start]

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"
42#include "lldb/Core/Progress.h"
45#include "lldb/Host/Config.h"
47#include "lldb/Host/XML.h"
52#include "lldb/Target/Process.h"
54#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
171 if (m_opaque_sp)
172 return SBBroadcaster(&m_opaque_sp->GetBroadcaster(), false);
173
174 return SBBroadcaster();
175}
176
181
184
186 if (auto e = g_debugger_lifetime->Initialize(
187 std::make_unique<SystemInitializerFull>())) {
188 error.SetError(Status::FromError(std::move(e)));
189 }
190 return error;
191}
192
195
196 llvm::EnablePrettyStackTrace();
197 static std::string executable =
198 llvm::sys::fs::getMainExecutable(nullptr, nullptr);
199 llvm::sys::PrintStackTraceOnErrorSignal(executable);
200}
201
202static void DumpDiagnostics(void *cookie) {
203 Diagnostics::Instance().Dump(llvm::errs());
204}
205
208
209 llvm::sys::AddSignalHandler(&DumpDiagnostics, nullptr);
210}
211
214
215 g_debugger_lifetime->Terminate();
216}
217
219 LLDB_INSTRUMENT_VA(this);
220
221 if (m_opaque_sp)
222 m_opaque_sp->ClearIOHandlers();
223
224 m_opaque_sp.reset();
225}
226
229
230 return SBDebugger::Create(false, nullptr, nullptr);
231}
232
233SBDebugger SBDebugger::Create(bool source_init_files) {
234 LLDB_INSTRUMENT_VA(source_init_files);
235
236 return SBDebugger::Create(source_init_files, nullptr, nullptr);
237}
238
239SBDebugger SBDebugger::Create(bool source_init_files,
240 lldb::LogOutputCallback callback, void *baton)
241
242{
243 LLDB_INSTRUMENT_VA(source_init_files, callback, baton);
244
245 SBDebugger debugger;
246
247 // Currently we have issues if this function is called simultaneously on two
248 // different threads. The issues mainly revolve around the fact that the
249 // lldb_private::FormatManager uses global collections and having two threads
250 // parsing the .lldbinit files can cause mayhem. So to get around this for
251 // now we need to use a mutex to prevent bad things from happening.
252 static std::recursive_mutex g_mutex;
253 std::lock_guard<std::recursive_mutex> guard(g_mutex);
254
255 debugger.reset(Debugger::CreateInstance(callback, baton));
256
258 if (source_init_files) {
259 interp.get()->SkipLLDBInitFiles(false);
260 interp.get()->SkipAppInitFiles(false);
262 interp.SourceInitFileInGlobalDirectory(result);
263 interp.SourceInitFileInHomeDirectory(result, false);
264 } else {
265 interp.get()->SkipLLDBInitFiles(true);
266 interp.get()->SkipAppInitFiles(true);
267 }
268 return debugger;
269}
270
272 LLDB_INSTRUMENT_VA(debugger);
273
275
276 if (debugger.m_opaque_sp.get() != nullptr)
277 debugger.m_opaque_sp.reset();
278}
279
282
283 // Since this function can be call asynchronously, we allow it to be non-
284 // mandatory. We have seen deadlocks with this function when called so we
285 // need to safeguard against this until we can determine what is causing the
286 // deadlocks.
287
288 const bool mandatory = false;
289
291}
292
294 LLDB_INSTRUMENT_VA(this);
295 return this->operator bool();
296}
297SBDebugger::operator bool() const {
298 LLDB_INSTRUMENT_VA(this);
299
300 return m_opaque_sp.get() != nullptr;
301}
302
304 LLDB_INSTRUMENT_VA(this, b);
305
306 if (m_opaque_sp)
307 m_opaque_sp->SetAsyncExecution(b);
308}
309
311 LLDB_INSTRUMENT_VA(this);
312
313 return (m_opaque_sp ? m_opaque_sp->GetAsyncExecution() : false);
314}
315
317 LLDB_INSTRUMENT_VA(this, b);
318
319 if (m_opaque_sp)
320 m_opaque_sp->GetCommandInterpreter().SkipLLDBInitFiles(b);
321}
322
324 LLDB_INSTRUMENT_VA(this, b);
325
326 if (m_opaque_sp)
327 m_opaque_sp->GetCommandInterpreter().SkipAppInitFiles(b);
328}
329
330void SBDebugger::SetInputFileHandle(FILE *fh, bool transfer_ownership) {
331 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
332 if (m_opaque_sp)
333 m_opaque_sp->SetInputFile((FileSP)std::make_shared<NativeFile>(
334 fh, File::eOpenOptionReadOnly, transfer_ownership));
335}
336
339 SBError sb_error;
340 if (data == nullptr) {
341 sb_error = Status::FromErrorString("String data is null");
342 return sb_error;
343 }
344
345 size_t size = strlen(data);
346 if (size == 0) {
347 sb_error = Status::FromErrorString("String data is empty");
348 return sb_error;
349 }
350
351 if (!m_opaque_sp) {
352 sb_error = Status::FromErrorString("invalid debugger");
353 return sb_error;
354 }
355
356 sb_error.SetError(m_opaque_sp->SetInputString(data));
357 return sb_error;
358}
359
360// Shouldn't really be settable after initialization as this could cause lots
361// of problems; don't want users trying to switch modes in the middle of a
362// debugging session.
364 LLDB_INSTRUMENT_VA(this, file);
365
367 if (!m_opaque_sp) {
368 error.ref() = Status::FromErrorString("invalid debugger");
369 return error;
370 }
371 if (!file) {
372 error.ref() = Status::FromErrorString("invalid file");
373 return error;
374 }
375 m_opaque_sp->SetInputFile(file.m_opaque_sp);
376 return error;
377}
378
380 LLDB_INSTRUMENT_VA(this, file_sp);
381 return SetInputFile(SBFile(file_sp));
382}
383
385 LLDB_INSTRUMENT_VA(this, file_sp);
386 return SetOutputFile(SBFile(file_sp));
387}
388
389void SBDebugger::SetOutputFileHandle(FILE *fh, bool transfer_ownership) {
390 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
391 SetOutputFile((FileSP)std::make_shared<NativeFile>(
392 fh, File::eOpenOptionWriteOnly, transfer_ownership));
393}
394
396 LLDB_INSTRUMENT_VA(this, file);
398 if (!m_opaque_sp) {
399 error.ref() = Status::FromErrorString("invalid debugger");
400 return error;
401 }
402 if (!file) {
403 error.ref() = Status::FromErrorString("invalid file");
404 return error;
405 }
406 m_opaque_sp->SetOutputFile(file.m_opaque_sp);
407 return error;
408}
409
410void SBDebugger::SetErrorFileHandle(FILE *fh, bool transfer_ownership) {
411 LLDB_INSTRUMENT_VA(this, fh, transfer_ownership);
412 SetErrorFile((FileSP)std::make_shared<NativeFile>(
413 fh, File::eOpenOptionWriteOnly, transfer_ownership));
414}
415
417 LLDB_INSTRUMENT_VA(this, file_sp);
418 return SetErrorFile(SBFile(file_sp));
419}
420
422 LLDB_INSTRUMENT_VA(this, file);
424 if (!m_opaque_sp) {
425 error.ref() = Status::FromErrorString("invalid debugger");
426 return error;
427 }
428 if (!file) {
429 error.ref() = Status::FromErrorString("invalid file");
430 return error;
431 }
432 m_opaque_sp->SetErrorFile(file.m_opaque_sp);
433 return error;
434}
435
437 LLDB_INSTRUMENT_VA(this, setting);
438
440 if (!m_opaque_sp)
441 return data;
442
443 StreamString json_strm;
444 ExecutionContext exe_ctx(
445 m_opaque_sp->GetCommandInterpreter().GetExecutionContext());
446 if (setting && strlen(setting) > 0)
447 m_opaque_sp->DumpPropertyValue(&exe_ctx, json_strm, setting,
448 /*dump_mask*/ 0,
449 /*is_json*/ true);
450 else
451 m_opaque_sp->DumpAllPropertyValues(&exe_ctx, json_strm, /*dump_mask*/ 0,
452 /*is_json*/ true);
453
454 data.m_impl_up->SetObjectSP(StructuredData::ParseJSON(json_strm.GetString()));
455 return data;
456}
457
459 LLDB_INSTRUMENT_VA(this);
460 if (m_opaque_sp) {
461 File &file_sp = m_opaque_sp->GetInputFile();
462 return file_sp.GetStream();
463 }
464 return nullptr;
465}
466
468 LLDB_INSTRUMENT_VA(this);
469 if (m_opaque_sp) {
470 return SBFile(m_opaque_sp->GetInputFileSP());
471 }
472 return SBFile();
473}
474
476 LLDB_INSTRUMENT_VA(this);
477 if (m_opaque_sp)
478 return m_opaque_sp->GetOutputFileSP()->GetStream();
479 return nullptr;
480}
481
483 LLDB_INSTRUMENT_VA(this);
484 if (m_opaque_sp)
485 return SBFile(m_opaque_sp->GetOutputFileSP());
486 return SBFile();
487}
488
490 LLDB_INSTRUMENT_VA(this);
491
492 if (m_opaque_sp)
493 return m_opaque_sp->GetErrorFileSP()->GetStream();
494 return nullptr;
495}
496
498 LLDB_INSTRUMENT_VA(this);
499 SBFile file;
500 if (m_opaque_sp)
501 return SBFile(m_opaque_sp->GetErrorFileSP());
502 return SBFile();
503}
504
506 LLDB_INSTRUMENT_VA(this);
507
508 if (m_opaque_sp)
509 m_opaque_sp->SaveInputTerminalState();
510}
511
513 LLDB_INSTRUMENT_VA(this);
514
515 if (m_opaque_sp)
516 m_opaque_sp->RestoreInputTerminalState();
517}
519 LLDB_INSTRUMENT_VA(this);
520
521 SBCommandInterpreter sb_interpreter;
522 if (m_opaque_sp)
523 sb_interpreter.reset(&m_opaque_sp->GetCommandInterpreter());
524
525 return sb_interpreter;
526}
527
528void SBDebugger::HandleCommand(const char *command) {
529 LLDB_INSTRUMENT_VA(this, command);
530
531 if (m_opaque_sp) {
532 TargetSP target_sp(
533 m_opaque_sp->GetCommandInterpreter().GetSelectedTarget());
534 TargetAPIMutex api_lock;
535 std::unique_lock<TargetAPIMutex> guard;
536 if (target_sp) {
537 api_lock = TargetAPIMutex(target_sp->GetAPIMutex());
538 guard = std::unique_lock<TargetAPIMutex>(api_lock);
539 }
540
543
544 sb_interpreter.HandleCommand(command, result, false);
545
546 result.PutError(m_opaque_sp->GetErrorFileSP());
547 result.PutOutput(m_opaque_sp->GetOutputFileSP());
548
549 if (!m_opaque_sp->GetAsyncExecution()) {
550 SBProcess process(GetCommandInterpreter().GetProcess());
551 ProcessSP process_sp(process.GetSP());
552 if (process_sp) {
553 EventSP event_sp;
554 ListenerSP lldb_listener_sp = m_opaque_sp->GetListener();
555 while (lldb_listener_sp->GetEventForBroadcaster(
556 process_sp.get(), event_sp, std::chrono::seconds(0))) {
557 SBEvent event(event_sp);
558 HandleProcessEvent(process, event, GetOutputFile(), GetErrorFile());
559 }
560 }
561 }
562 }
563}
564
566 LLDB_INSTRUMENT_VA(this);
567
568 SBListener sb_listener;
569 if (m_opaque_sp)
570 sb_listener.reset(m_opaque_sp->GetListener());
571
572 return sb_listener;
573}
574
575void SBDebugger::HandleProcessEvent(const SBProcess &process,
576 const SBEvent &event, SBFile out,
577 SBFile err) {
578 LLDB_INSTRUMENT_VA(this, process, event, out, err);
579
580 return HandleProcessEvent(process, event, out.m_opaque_sp, err.m_opaque_sp);
581}
582
583void SBDebugger::HandleProcessEvent(const SBProcess &process,
584 const SBEvent &event, FILE *out,
585 FILE *err) {
586 LLDB_INSTRUMENT_VA(this, process, event, out, err);
587
588 FileSP outfile =
589 std::make_shared<NativeFile>(out, File::eOpenOptionWriteOnly, false);
590 FileSP errfile =
591 std::make_shared<NativeFile>(err, File::eOpenOptionWriteOnly, false);
592 return HandleProcessEvent(process, event, outfile, errfile);
593}
594
595void SBDebugger::HandleProcessEvent(const SBProcess &process,
596 const SBEvent &event, FileSP out_sp,
597 FileSP err_sp) {
598
599 LLDB_INSTRUMENT_VA(this, process, event, out_sp, err_sp);
600
601 if (!process.IsValid())
602 return;
603
604 TargetSP target_sp(process.GetTarget().GetSP());
605 if (!target_sp)
606 return;
607
608 const uint32_t event_type = event.GetType();
609 char stdio_buffer[1024];
610 size_t len;
611
612 TargetAPIMutex api_lock = target_sp->GetAPIMutex();
613 std::lock_guard<TargetAPIMutex> guard(api_lock);
614
615 if (event_type &
617 // Drain stdout when we stop just in case we have any bytes
618 while ((len = process.GetSTDOUT(stdio_buffer, sizeof(stdio_buffer))) > 0)
619 if (out_sp)
620 out_sp->Write(stdio_buffer, len);
621 }
622
623 if (event_type &
625 // Drain stderr when we stop just in case we have any bytes
626 while ((len = process.GetSTDERR(stdio_buffer, sizeof(stdio_buffer))) > 0)
627 if (err_sp)
628 err_sp->Write(stdio_buffer, len);
629 }
630
631 if (event_type & Process::eBroadcastBitStateChanged) {
632 StateType event_state = SBProcess::GetStateFromEvent(event);
633
634 if (event_state == eStateInvalid)
635 return;
636
637 bool is_stopped = StateIsStoppedState(event_state);
638 if (!is_stopped)
639 process.ReportEventState(event, out_sp);
640 }
641}
642
644 LLDB_INSTRUMENT_VA(this);
645
646 SBSourceManager sb_source_manager(*this);
647 return sb_source_manager;
648}
649
650bool SBDebugger::GetDefaultArchitecture(char *arch_name, size_t arch_name_len) {
651 LLDB_INSTRUMENT_VA(arch_name, arch_name_len);
652
653 if (arch_name && arch_name_len) {
655
656 if (default_arch.IsValid()) {
657 const std::string &triple_str = default_arch.GetTriple().str();
658 if (!triple_str.empty())
659 ::snprintf(arch_name, arch_name_len, "%s", triple_str.c_str());
660 else
661 ::snprintf(arch_name, arch_name_len, "%s",
662 default_arch.GetArchitectureName());
663 return true;
664 }
665 }
666 if (arch_name && arch_name_len)
667 arch_name[0] = '\0';
668 return false;
669}
670
671bool SBDebugger::SetDefaultArchitecture(const char *arch_name) {
672 LLDB_INSTRUMENT_VA(arch_name);
673
674 if (arch_name) {
675 ArchSpec arch(arch_name);
676 if (arch.IsValid()) {
678 return true;
679 }
680 }
681 return false;
682}
683
685SBDebugger::GetScriptingLanguage(const char *script_language_name) {
686 LLDB_INSTRUMENT_VA(this, script_language_name);
687
688 if (!script_language_name)
691 llvm::StringRef(script_language_name), eScriptLanguageDefault, nullptr);
692}
693
696 LLDB_INSTRUMENT_VA(this, language);
698 if (m_opaque_sp) {
700 m_opaque_sp->GetScriptInterpreter(language);
701 if (interp) {
702 data.m_impl_up->SetObjectSP(interp->GetInterpreterInfo());
703 }
704 }
705 return data;
706}
707
710
712}
713
715 LLDB_INSTRUMENT_VA(state);
716
717 return lldb_private::StateAsCString(state);
718}
719
727
729 LLDB_INSTRUMENT_VA(state);
730
731 const bool result = lldb_private::StateIsRunningState(state);
732
733 return result;
734}
735
737 LLDB_INSTRUMENT_VA(state);
738
739 const bool result = lldb_private::StateIsStoppedState(state, false);
740
741 return result;
742}
743
745 const char *target_triple,
746 const char *platform_name,
747 bool add_dependent_modules,
748 lldb::SBError &sb_error) {
749 LLDB_INSTRUMENT_VA(this, filename, target_triple, platform_name,
750 add_dependent_modules, sb_error);
751
752 SBTarget sb_target;
753 TargetSP target_sp;
754 if (m_opaque_sp) {
755 sb_error.Clear();
756 OptionGroupPlatform platform_options(false);
757 platform_options.SetPlatformName(platform_name);
758
759 sb_error.ref() = m_opaque_sp->GetTargetList().CreateTarget(
760 *m_opaque_sp, filename, target_triple,
761 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo,
762 &platform_options, target_sp);
763
764 if (sb_error.Success())
765 sb_target.SetSP(target_sp);
766 } else {
767 sb_error = Status::FromErrorString("invalid debugger");
768 }
769
770 Log *log = GetLog(LLDBLog::API);
771 LLDB_LOGF(log,
772 "SBDebugger(%p)::CreateTarget (filename=\"%s\", triple=%s, "
773 "platform_name=%s, add_dependent_modules=%u, error=%s) => "
774 "SBTarget(%p)",
775 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
776 platform_name, add_dependent_modules, sb_error.GetCString(),
777 static_cast<void *>(target_sp.get()));
778
779 return sb_target;
780}
781
784 const char *target_triple) {
785 LLDB_INSTRUMENT_VA(this, filename, target_triple);
786
787 SBTarget sb_target;
788 TargetSP target_sp;
789 if (m_opaque_sp) {
790 const bool add_dependent_modules = true;
791 Status error(m_opaque_sp->GetTargetList().CreateTarget(
792 *m_opaque_sp, filename, target_triple,
793 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
794 target_sp));
795 sb_target.SetSP(target_sp);
796 }
797
798 Log *log = GetLog(LLDBLog::API);
799 LLDB_LOGF(log,
800 "SBDebugger(%p)::CreateTargetWithFileAndTargetTriple "
801 "(filename=\"%s\", triple=%s) => SBTarget(%p)",
802 static_cast<void *>(m_opaque_sp.get()), filename, target_triple,
803 static_cast<void *>(target_sp.get()));
804
805 return sb_target;
806}
807
809 const char *arch_cstr) {
810 LLDB_INSTRUMENT_VA(this, filename, arch_cstr);
811
812 Log *log = GetLog(LLDBLog::API);
813
814 SBTarget sb_target;
815 TargetSP target_sp;
816 if (m_opaque_sp) {
818 if (arch_cstr == nullptr) {
819 // The version of CreateTarget that takes an ArchSpec won't accept an
820 // empty ArchSpec, so when the arch hasn't been specified, we need to
821 // call the target triple version.
822 error = m_opaque_sp->GetTargetList().CreateTarget(
823 *m_opaque_sp, filename, arch_cstr, eLoadDependentsYes, nullptr,
824 target_sp);
825 } else {
826 PlatformSP platform_sp =
827 m_opaque_sp->GetPlatformList().GetSelectedPlatform();
828 ArchSpec arch =
829 Platform::GetAugmentedArchSpec(platform_sp.get(), arch_cstr);
830 if (arch.IsValid())
831 error = m_opaque_sp->GetTargetList().CreateTarget(
832 *m_opaque_sp, filename, arch, eLoadDependentsYes, platform_sp,
833 target_sp);
834 else
835 error = Status::FromErrorStringWithFormat("invalid arch_cstr: %s",
836 arch_cstr);
837 }
838 if (error.Success())
839 sb_target.SetSP(target_sp);
840 }
841
842 LLDB_LOGF(log,
843 "SBDebugger(%p)::CreateTargetWithFileAndArch (filename=\"%s\", "
844 "arch=%s) => SBTarget(%p)",
845 static_cast<void *>(m_opaque_sp.get()),
846 filename ? filename : "<unspecified>",
847 arch_cstr ? arch_cstr : "<unspecified>",
848 static_cast<void *>(target_sp.get()));
849
850 return sb_target;
851}
852
853SBTarget SBDebugger::CreateTarget(const char *filename) {
854 LLDB_INSTRUMENT_VA(this, filename);
855
856 SBTarget sb_target;
857 TargetSP target_sp;
858 if (m_opaque_sp) {
860 const bool add_dependent_modules = true;
861 error = m_opaque_sp->GetTargetList().CreateTarget(
862 *m_opaque_sp, filename, "",
863 add_dependent_modules ? eLoadDependentsYes : eLoadDependentsNo, nullptr,
864 target_sp);
865
866 if (error.Success())
867 sb_target.SetSP(target_sp);
868 }
869 Log *log = GetLog(LLDBLog::API);
870 LLDB_LOGF(log,
871 "SBDebugger(%p)::CreateTarget (filename=\"%s\") => SBTarget(%p)",
872 static_cast<void *>(m_opaque_sp.get()), filename,
873 static_cast<void *>(target_sp.get()));
874 return sb_target;
875}
876
878 LLDB_INSTRUMENT_VA(this);
879
880 SBTarget sb_target;
881 if (m_opaque_sp) {
882 sb_target.SetSP(m_opaque_sp->GetDummyTarget().shared_from_this());
883 }
884 Log *log = GetLog(LLDBLog::API);
885 LLDB_LOGF(log, "SBDebugger(%p)::GetDummyTarget() => SBTarget(%p)",
886 static_cast<void *>(m_opaque_sp.get()),
887 static_cast<void *>(sb_target.GetSP().get()));
888 return sb_target;
889}
890
892 LLDB_INSTRUMENT_VA(this);
893 if (m_opaque_sp) {
894 m_opaque_sp->DispatchClientTelemetry(*entry.m_impl_up);
895 } else {
896 Log *log = GetLog(LLDBLog::API);
897 LLDB_LOGF(log,
898 "Could not send telemetry from SBDebugger - debugger was null.");
899 }
900}
901
903 LLDB_INSTRUMENT_VA(this, target);
904
905 bool result = false;
906 if (m_opaque_sp) {
907 TargetSP target_sp(target.GetSP());
908 if (target_sp) {
909 // No need to lock, the target list is thread safe
910 result = m_opaque_sp->GetTargetList().DeleteTarget(target_sp);
911 target_sp->Destroy();
912 target.Clear();
913 }
914 }
915
916 Log *log = GetLog(LLDBLog::API);
917 LLDB_LOGF(log, "SBDebugger(%p)::DeleteTarget (SBTarget(%p)) => %i",
918 static_cast<void *>(m_opaque_sp.get()),
919 static_cast<void *>(target.m_opaque_sp.get()), result);
920
921 return result;
922}
923
925 LLDB_INSTRUMENT_VA(this, idx);
926
927 SBTarget sb_target;
928 if (m_opaque_sp) {
929 // No need to lock, the target list is thread safe
930 sb_target.SetSP(m_opaque_sp->GetTargetList().GetTargetAtIndex(idx));
931 }
932 return sb_target;
933}
934
936 LLDB_INSTRUMENT_VA(this, target);
937
938 lldb::TargetSP target_sp = target.GetSP();
939 if (!target_sp)
940 return UINT32_MAX;
941
942 if (!m_opaque_sp)
943 return UINT32_MAX;
944
945 return m_opaque_sp->GetTargetList().GetIndexOfTarget(target.GetSP());
946}
947
949 LLDB_INSTRUMENT_VA(this, id);
950 SBTarget sb_target;
951 if (m_opaque_sp) {
952 // No need to lock, the target list is thread safe
953 sb_target.SetSP(
954 m_opaque_sp->GetTargetList().FindTargetByGloballyUniqueID(id));
955 }
956 return sb_target;
957}
958
960 LLDB_INSTRUMENT_VA(this, pid);
961
962 SBTarget sb_target;
963 if (m_opaque_sp) {
964 // No need to lock, the target list is thread safe
965 sb_target.SetSP(m_opaque_sp->GetTargetList().FindTargetWithProcessID(pid));
966 }
967 return sb_target;
968}
969
971 const char *arch_name) {
972 LLDB_INSTRUMENT_VA(this, filename, arch_name);
973
974 SBTarget sb_target;
975 if (m_opaque_sp && filename && filename[0]) {
976 // No need to lock, the target list is thread safe
978 m_opaque_sp->GetPlatformList().GetSelectedPlatform().get(), arch_name);
979 TargetSP target_sp(
980 m_opaque_sp->GetTargetList().FindTargetWithExecutableAndArchitecture(
981 FileSpec(filename), arch_name ? &arch : nullptr));
982 sb_target.SetSP(target_sp);
983 }
984 return sb_target;
985}
986
988 SBTarget sb_target;
989 if (m_opaque_sp) {
990 // No need to lock, the target list is thread safe
991 sb_target.SetSP(
992 m_opaque_sp->GetTargetList().FindTargetWithProcess(process_sp.get()));
993 }
994 return sb_target;
995}
996
998 LLDB_INSTRUMENT_VA(this);
999
1000 if (m_opaque_sp) {
1001 // No need to lock, the target list is thread safe
1002 return m_opaque_sp->GetTargetList().GetNumTargets();
1003 }
1004 return 0;
1005}
1006
1008 LLDB_INSTRUMENT_VA(this);
1009
1010 Log *log = GetLog(LLDBLog::API);
1011
1012 SBTarget sb_target;
1013 TargetSP target_sp;
1014 if (m_opaque_sp) {
1015 // No need to lock, the target list is thread safe
1016 target_sp = m_opaque_sp->GetTargetList().GetSelectedTarget();
1017 sb_target.SetSP(target_sp);
1018 }
1019
1020 if (log) {
1021 SBStream sstr;
1022 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1023 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedTarget () => SBTarget(%p): %s",
1024 static_cast<void *>(m_opaque_sp.get()),
1025 static_cast<void *>(target_sp.get()), sstr.GetData());
1026 }
1027
1028 return sb_target;
1029}
1030
1032 LLDB_INSTRUMENT_VA(this, sb_target);
1033
1034 Log *log = GetLog(LLDBLog::API);
1035
1036 TargetSP target_sp(sb_target.GetSP());
1037 if (m_opaque_sp) {
1038 m_opaque_sp->GetTargetList().SetSelectedTarget(target_sp);
1039 }
1040 if (log) {
1041 SBStream sstr;
1042 sb_target.GetDescription(sstr, eDescriptionLevelBrief);
1043 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedTarget () => SBTarget(%p): %s",
1044 static_cast<void *>(m_opaque_sp.get()),
1045 static_cast<void *>(target_sp.get()), sstr.GetData());
1046 }
1047}
1048
1050 LLDB_INSTRUMENT_VA(this);
1051
1052 Log *log = GetLog(LLDBLog::API);
1053
1054 SBPlatform sb_platform;
1055 DebuggerSP debugger_sp(m_opaque_sp);
1056 if (debugger_sp) {
1057 sb_platform.SetSP(debugger_sp->GetPlatformList().GetSelectedPlatform());
1058 }
1059 LLDB_LOGF(log, "SBDebugger(%p)::GetSelectedPlatform () => SBPlatform(%p): %s",
1060 static_cast<void *>(m_opaque_sp.get()),
1061 static_cast<void *>(sb_platform.GetSP().get()),
1062 sb_platform.GetName());
1063 return sb_platform;
1064}
1065
1067 LLDB_INSTRUMENT_VA(this, sb_platform);
1068
1069 Log *log = GetLog(LLDBLog::API);
1070
1071 DebuggerSP debugger_sp(m_opaque_sp);
1072 if (debugger_sp) {
1073 debugger_sp->GetPlatformList().SetSelectedPlatform(sb_platform.GetSP());
1074 }
1075
1076 LLDB_LOGF(log, "SBDebugger(%p)::SetSelectedPlatform (SBPlatform(%p) %s)",
1077 static_cast<void *>(m_opaque_sp.get()),
1078 static_cast<void *>(sb_platform.GetSP().get()),
1079 sb_platform.GetName());
1080}
1081
1083 LLDB_INSTRUMENT_VA(this);
1084
1085 if (m_opaque_sp) {
1086 // No need to lock, the platform list is thread safe
1087 return m_opaque_sp->GetPlatformList().GetSize();
1088 }
1089 return 0;
1090}
1091
1093 LLDB_INSTRUMENT_VA(this, idx);
1094
1095 SBPlatform sb_platform;
1096 if (m_opaque_sp) {
1097 // No need to lock, the platform list is thread safe
1098 sb_platform.SetSP(m_opaque_sp->GetPlatformList().GetAtIndex(idx));
1099 }
1100 return sb_platform;
1101}
1102
1104 LLDB_INSTRUMENT_VA(this);
1105
1106 uint32_t idx = 0;
1107 while (true) {
1109 break;
1110 }
1111 ++idx;
1112 }
1113 // +1 for the host platform, which should always appear first in the list.
1114 return idx + 1;
1115}
1116
1118 LLDB_INSTRUMENT_VA(this, idx);
1119
1121 auto platform_dict = std::make_unique<StructuredData::Dictionary>();
1122 llvm::StringRef name_str("name"), desc_str("description");
1123
1124 if (idx == 0) {
1125 PlatformSP host_platform_sp(Platform::GetHostPlatform());
1126 platform_dict->AddStringItem(name_str, host_platform_sp->GetPluginName());
1127 platform_dict->AddStringItem(
1128 desc_str, llvm::StringRef(host_platform_sp->GetDescription()));
1129 } else if (idx > 0) {
1130 llvm::StringRef plugin_name =
1132 if (plugin_name.empty()) {
1133 return data;
1134 }
1135 platform_dict->AddStringItem(name_str, llvm::StringRef(plugin_name));
1136
1137 llvm::StringRef plugin_desc =
1139 platform_dict->AddStringItem(desc_str, llvm::StringRef(plugin_desc));
1140 }
1141
1142 data.m_impl_up->SetObjectSP(
1143 StructuredData::ObjectSP(platform_dict.release()));
1144 return data;
1145}
1146
1147void SBDebugger::DispatchInput(void *baton, const void *data, size_t data_len) {
1148 LLDB_INSTRUMENT_VA(this, baton, data, data_len);
1149
1151}
1152
1153void SBDebugger::DispatchInput(const void *data, size_t data_len) {
1155
1156 // Log *log(GetLog (LLDBLog::API));
1157 //
1158 // if (log)
1159 // LLDB_LOGF(log, "SBDebugger(%p)::DispatchInput (data=\"%.*s\",
1160 // size_t=%" PRIu64 ")",
1161 // m_opaque_sp.get(),
1162 // (int) data_len,
1163 // (const char *) data,
1164 // (uint64_t)data_len);
1165 //
1166 // if (m_opaque_sp)
1167 // m_opaque_sp->DispatchInput ((const char *) data, data_len);
1168}
1169
1171 LLDB_INSTRUMENT_VA(this);
1172
1173 if (m_opaque_sp)
1174 m_opaque_sp->DispatchInputInterrupt();
1175}
1176
1178 LLDB_INSTRUMENT_VA(this);
1179
1180 if (m_opaque_sp)
1181 m_opaque_sp->DispatchInputEndOfFile();
1182}
1183
1185 LLDB_INSTRUMENT_VA(this, reader);
1186}
1187
1188void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1189 bool spawn_thread) {
1190 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread);
1191
1192 if (m_opaque_sp) {
1194 options.SetAutoHandleEvents(auto_handle_events);
1195 options.SetSpawnThread(spawn_thread);
1196 m_opaque_sp->GetCommandInterpreter().RunCommandInterpreter(options);
1197 }
1198}
1199
1200void SBDebugger::RunCommandInterpreter(bool auto_handle_events,
1201 bool spawn_thread,
1203 int &num_errors, bool &quit_requested,
1204 bool &stopped_for_crash)
1205
1206{
1207 LLDB_INSTRUMENT_VA(this, auto_handle_events, spawn_thread, options,
1208 num_errors, quit_requested, stopped_for_crash);
1209
1210 if (m_opaque_sp) {
1211 options.SetAutoHandleEvents(auto_handle_events);
1212 options.SetSpawnThread(spawn_thread);
1213 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1215 interp.RunCommandInterpreter(options.ref());
1216 num_errors = result.GetNumErrors();
1217 quit_requested =
1219 stopped_for_crash =
1221 }
1222}
1223
1225 const SBCommandInterpreterRunOptions &options) {
1226 LLDB_INSTRUMENT_VA(this, options);
1227
1228 if (!m_opaque_sp)
1230
1231 CommandInterpreter &interp = m_opaque_sp->GetCommandInterpreter();
1233 interp.RunCommandInterpreter(options.ref());
1234
1235 return SBCommandInterpreterRunResult(result);
1236}
1237
1239 const char *repl_options) {
1240 LLDB_INSTRUMENT_VA(this, language, repl_options);
1241
1242 SBError error;
1243 if (m_opaque_sp)
1244 error.ref() = m_opaque_sp->RunREPL(language, repl_options);
1245 else
1246 error = Status::FromErrorString("invalid debugger");
1247 return error;
1248}
1249
1250void SBDebugger::reset(const DebuggerSP &debugger_sp) {
1251 m_opaque_sp = debugger_sp;
1252}
1253
1254Debugger *SBDebugger::get() const { return m_opaque_sp.get(); }
1255
1257 assert(m_opaque_sp.get());
1258 return *m_opaque_sp;
1259}
1260
1262
1265
1266 // No need to lock, the debugger list is thread safe
1267 SBDebugger sb_debugger;
1268 DebuggerSP debugger_sp = Debugger::FindDebuggerWithID(id);
1269 if (debugger_sp)
1270 sb_debugger.reset(debugger_sp);
1271 return sb_debugger;
1272}
1273
1275 LLDB_INSTRUMENT_VA(this);
1276
1277 if (!m_opaque_sp)
1278 return nullptr;
1279
1280 return ConstString(m_opaque_sp->GetInstanceName()).AsCString(nullptr);
1281}
1282
1283SBError SBDebugger::SetInternalVariable(const char *var_name, const char *value,
1284 const char *debugger_instance_name) {
1285 LLDB_INSTRUMENT_VA(var_name, value, debugger_instance_name);
1286
1287 SBError sb_error;
1288 DebuggerSP debugger_sp(
1289 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1290 Status error;
1291 if (debugger_sp) {
1292 ExecutionContext exe_ctx(
1293 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1294 error = debugger_sp->SetPropertyValue(&exe_ctx, eVarSetOperationAssign,
1295 var_name, value);
1296 } else {
1298 "invalid debugger instance name '%s'", debugger_instance_name);
1299 }
1300 if (error.Fail())
1301 sb_error.SetError(std::move(error));
1302 return sb_error;
1303}
1304
1307 const char *debugger_instance_name) {
1308 LLDB_INSTRUMENT_VA(var_name, debugger_instance_name);
1309
1310 DebuggerSP debugger_sp(
1311 Debugger::FindDebuggerWithInstanceName(debugger_instance_name));
1312 Status error;
1313 if (debugger_sp) {
1314 ExecutionContext exe_ctx(
1315 debugger_sp->GetCommandInterpreter().GetExecutionContext());
1316 lldb::OptionValueSP value_sp(
1317 debugger_sp->GetPropertyValue(&exe_ctx, var_name, error));
1318 if (value_sp) {
1319 StreamString value_strm;
1320 value_sp->DumpValue(&exe_ctx, value_strm, OptionValue::eDumpOptionValue);
1321 const std::string &value_str = std::string(value_strm.GetString());
1322 if (!value_str.empty()) {
1323 StringList string_list;
1324 string_list.SplitIntoLines(value_str);
1325 return SBStringList(&string_list);
1326 }
1327 }
1328 }
1329 return SBStringList();
1330}
1331
1333 LLDB_INSTRUMENT_VA(this);
1334
1335 return (m_opaque_sp ? m_opaque_sp->GetTerminalWidth() : 0);
1336}
1337
1338void SBDebugger::SetTerminalWidth(uint32_t term_width) {
1339 LLDB_INSTRUMENT_VA(this, term_width);
1340
1341 if (m_opaque_sp)
1342 m_opaque_sp->SetTerminalWidth(term_width);
1343}
1344
1346 LLDB_INSTRUMENT_VA(this);
1347
1348 return (m_opaque_sp ? m_opaque_sp->GetTerminalHeight() : 0);
1349}
1350
1351void SBDebugger::SetTerminalHeight(uint32_t term_height) {
1352 LLDB_INSTRUMENT_VA(this, term_height);
1353
1354 if (m_opaque_sp)
1355 m_opaque_sp->SetTerminalHeight(term_height);
1356}
1357
1358void SBDebugger::SetTerminalDimensions(uint32_t term_width,
1359 uint32_t term_height) {
1360 LLDB_INSTRUMENT_VA(this, term_width, term_height);
1361
1362 if (m_opaque_sp)
1363 m_opaque_sp->SetTerminalDimensions(term_width, term_height);
1364}
1365
1366const char *SBDebugger::GetPrompt() const {
1367 LLDB_INSTRUMENT_VA(this);
1368
1369 Log *log = GetLog(LLDBLog::API);
1370
1371 LLDB_LOG(log, "SBDebugger({0:x})::GetPrompt () => \"{1}\"",
1372 static_cast<void *>(m_opaque_sp.get()),
1373 (m_opaque_sp ? m_opaque_sp->GetPrompt() : ""));
1374
1375 return (m_opaque_sp ? ConstString(m_opaque_sp->GetPrompt()).GetCString()
1376 : nullptr);
1377}
1378
1379void SBDebugger::SetPrompt(const char *prompt) {
1380 LLDB_INSTRUMENT_VA(this, prompt);
1381
1382 if (m_opaque_sp)
1383 m_opaque_sp->SetPrompt(llvm::StringRef(prompt));
1384}
1385
1387 LLDB_INSTRUMENT_VA(this);
1388
1389 return "GetReproducerPath has been deprecated";
1390}
1391
1393 LLDB_INSTRUMENT_VA(this);
1394
1395 return (m_opaque_sp ? m_opaque_sp->GetScriptLanguage() : eScriptLanguageNone);
1396}
1397
1399 LLDB_INSTRUMENT_VA(this, script_lang);
1400
1401 if (m_opaque_sp) {
1402 m_opaque_sp->SetScriptLanguage(script_lang);
1403 }
1404}
1405
1407 LLDB_INSTRUMENT_VA(this);
1408
1409 return (m_opaque_sp ? m_opaque_sp->GetREPLLanguage() : eLanguageTypeUnknown);
1410}
1411
1413 LLDB_INSTRUMENT_VA(this, repl_lang);
1414
1415 if (m_opaque_sp) {
1416 m_opaque_sp->SetREPLLanguage(repl_lang);
1417 }
1418}
1419
1421 LLDB_INSTRUMENT_VA(this, value);
1422
1423 return (m_opaque_sp ? m_opaque_sp->SetUseExternalEditor(value) : false);
1424}
1425
1427 LLDB_INSTRUMENT_VA(this);
1428
1429 return (m_opaque_sp ? m_opaque_sp->GetUseExternalEditor() : false);
1430}
1431
1432bool SBDebugger::SetUseColor(bool value) {
1433 LLDB_INSTRUMENT_VA(this, value);
1434
1435 return (m_opaque_sp ? m_opaque_sp->SetUseColor(value) : false);
1436}
1437
1439 LLDB_INSTRUMENT_VA(this);
1440
1441 return (m_opaque_sp ? m_opaque_sp->GetUseColor() : false);
1442}
1443
1445 LLDB_INSTRUMENT_VA(this, value);
1446
1447 return (m_opaque_sp ? m_opaque_sp->SetShowInlineDiagnostics(value) : false);
1448}
1449
1451 LLDB_INSTRUMENT_VA(this, value);
1452
1453 return (m_opaque_sp ? m_opaque_sp->SetUseSourceCache(value) : false);
1454}
1455
1457 LLDB_INSTRUMENT_VA(this);
1458
1459 return (m_opaque_sp ? m_opaque_sp->GetUseSourceCache() : false);
1460}
1461
1463 LLDB_INSTRUMENT_VA(this, description);
1464
1465 Stream &strm = description.ref();
1466
1467 if (m_opaque_sp) {
1468 const char *name = m_opaque_sp->GetInstanceName().c_str();
1469 user_id_t id = m_opaque_sp->GetID();
1470 strm.Printf("Debugger (instance: \"%s\", id: %" PRIu64 ")", name, id);
1471 } else
1472 strm.PutCString("No value");
1473
1474 return true;
1475}
1476
1478 LLDB_INSTRUMENT_VA(this);
1479
1480 return (m_opaque_sp ? m_opaque_sp->GetID() : LLDB_INVALID_UID);
1481}
1482
1483SBError SBDebugger::SetCurrentPlatform(const char *platform_name_cstr) {
1484 LLDB_INSTRUMENT_VA(this, platform_name_cstr);
1485
1486 SBError sb_error;
1487 if (m_opaque_sp) {
1488 if (platform_name_cstr && platform_name_cstr[0]) {
1489 PlatformList &platforms = m_opaque_sp->GetPlatformList();
1490 if (PlatformSP platform_sp = platforms.GetOrCreate(platform_name_cstr))
1491 platforms.SetSelectedPlatform(platform_sp);
1492 else
1493 sb_error.ref() = Status::FromErrorString("platform not found");
1494 } else {
1495 sb_error.ref() = Status::FromErrorString("invalid platform name");
1496 }
1497 } else {
1498 sb_error.ref() = Status::FromErrorString("invalid debugger");
1499 }
1500 return sb_error;
1501}
1502
1503bool SBDebugger::SetCurrentPlatformSDKRoot(const char *sysroot) {
1504 LLDB_INSTRUMENT_VA(this, sysroot);
1505
1506 if (SBPlatform platform = GetSelectedPlatform()) {
1507 platform.SetSDKRoot(sysroot);
1508 return true;
1509 }
1510 return false;
1511}
1512
1514 LLDB_INSTRUMENT_VA(this);
1515
1516 return false;
1517}
1518
1520 LLDB_INSTRUMENT_VA(this, b);
1521}
1522
1523SBTypeCategory SBDebugger::GetCategory(const char *category_name) {
1524 LLDB_INSTRUMENT_VA(this, category_name);
1525
1526 if (!category_name || *category_name == 0)
1527 return SBTypeCategory();
1528
1529 TypeCategoryImplSP category_sp;
1530
1532 category_sp, false)) {
1533 return SBTypeCategory(category_sp);
1534 } else {
1535 return SBTypeCategory();
1536 }
1537}
1538
1540 LLDB_INSTRUMENT_VA(this, lang_type);
1541
1542 TypeCategoryImplSP category_sp;
1543 if (DataVisualization::Categories::GetCategory(lang_type, category_sp)) {
1544 return SBTypeCategory(category_sp);
1545 } else {
1546 return SBTypeCategory();
1547 }
1548}
1549
1550SBTypeCategory SBDebugger::CreateCategory(const char *category_name) {
1551 LLDB_INSTRUMENT_VA(this, category_name);
1552
1553 if (!category_name || *category_name == 0)
1554 return SBTypeCategory();
1555
1556 TypeCategoryImplSP category_sp;
1557
1559 category_sp, true)) {
1560 return SBTypeCategory(category_sp);
1561 } else {
1562 return SBTypeCategory();
1563 }
1564}
1565
1566bool SBDebugger::DeleteCategory(const char *category_name) {
1567 LLDB_INSTRUMENT_VA(this, category_name);
1568
1569 if (!category_name || *category_name == 0)
1570 return false;
1571
1573}
1574
1580
1587
1589 LLDB_INSTRUMENT_VA(this);
1590
1591 return GetCategory("default");
1592}
1593
1595 LLDB_INSTRUMENT_VA(this, type_name);
1596
1597 SBTypeCategory default_category_sb = GetDefaultCategory();
1598 if (default_category_sb.GetEnabled())
1599 return default_category_sb.GetFormatForType(type_name);
1600 return SBTypeFormat();
1601}
1602
1604 LLDB_INSTRUMENT_VA(this, type_name);
1605
1606 if (!type_name.IsValid())
1607 return SBTypeSummary();
1609}
1610
1612 LLDB_INSTRUMENT_VA(this, type_name);
1613
1614 if (!type_name.IsValid())
1615 return SBTypeFilter();
1617}
1618
1620 LLDB_INSTRUMENT_VA(this, type_name);
1621
1622 if (!type_name.IsValid())
1623 return SBTypeSynthetic();
1624 return SBTypeSynthetic(
1626}
1627
1633
1634static llvm::ArrayRef<const char *> GetCategoryArray(const char **categories) {
1635 if (categories == nullptr)
1636 return {};
1637 size_t len = 0;
1638 while (categories[len] != nullptr)
1639 ++len;
1640 return llvm::ArrayRef(categories, len);
1641}
1642
1643bool SBDebugger::EnableLog(const char *channel, const char **categories) {
1644 LLDB_INSTRUMENT_VA(this, channel, categories);
1645
1646 if (m_opaque_sp) {
1647 uint32_t log_options =
1649 llvm::Error err = m_opaque_sp->EnableLog(
1650 channel, GetCategoryArray(categories), "", log_options,
1651 /*buffer_size=*/0, eLogHandlerStream);
1652 bool succeeded = !bool(err);
1653 llvm::consumeError(std::move(err));
1654 return succeeded;
1655 } else
1656 return false;
1657}
1658
1660 void *baton) {
1661 LLDB_INSTRUMENT_VA(this, log_callback, baton);
1662
1663 if (m_opaque_sp) {
1664 return m_opaque_sp->SetLoggingCallback(log_callback, baton);
1665 }
1666}
1667
1668void SBDebugger::SetDestroyCallback(
1669 lldb::SBDebuggerDestroyCallback destroy_callback, void *baton) {
1670 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1671 if (m_opaque_sp) {
1672 return m_opaque_sp->SetDestroyCallback(
1673 destroy_callback, baton);
1674 }
1675}
1676
1679 void *baton) {
1680 LLDB_INSTRUMENT_VA(this, destroy_callback, baton);
1681
1682 if (m_opaque_sp)
1683 return m_opaque_sp->AddDestroyCallback(destroy_callback, baton);
1684
1686}
1687
1689 LLDB_INSTRUMENT_VA(this, token);
1690
1691 if (m_opaque_sp)
1692 return m_opaque_sp->RemoveDestroyCallback(token);
1693
1694 return false;
1695}
1696
1697SBTrace
1699 const SBFileSpec &trace_description_file) {
1700 LLDB_INSTRUMENT_VA(this, error, trace_description_file);
1701 return SBTrace::LoadTraceFromFile(error, *this, trace_description_file);
1702}
1703
1705 LLDB_INSTRUMENT_VA(this);
1706
1707 if (m_opaque_sp)
1708 m_opaque_sp->RequestInterrupt();
1709}
1711 LLDB_INSTRUMENT_VA(this);
1712
1713 if (m_opaque_sp)
1714 m_opaque_sp->CancelInterruptRequest();
1715}
1716
1718 LLDB_INSTRUMENT_VA(this);
1719
1720 if (m_opaque_sp)
1721 return m_opaque_sp->InterruptRequested();
1722 return false;
1723}
1724
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:375
#define LLDB_LOGF(log,...)
Definition Log.h:389
#define LLDB_LOG_OPTION_PREPEND_TIMESTAMP
Definition Log.h:41
#define LLDB_LOG_OPTION_PREPEND_THREAD_NAME
Definition Log.h:43
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:692
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:690
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.
void SetTerminalDimensions(uint32_t term_width, uint32_t term_height)
Set the terminal width and height together.
friend class SBInputReader
Definition SBDebugger.h:688
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:694
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:708
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:689
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.
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:691
void reset(const lldb::DebuggerSP &debugger_sp)
friend class SBPlatform
Definition SBDebugger.h:693
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:687
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:179
const char * GetData()
Definition SBStream.cpp:45
StructuredDataImplUP m_impl_up
bool GetDescription(lldb::SBStream &description, lldb::DescriptionLevel description_level)
void SetSP(const lldb::TargetSP &target_sp)
Definition SBTarget.cpp:602
lldb::TargetSP GetSP() const
Definition SBTarget.cpp:600
lldb::TargetSP m_opaque_sp
Definition SBTarget.h:1082
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:452
llvm::Triple & GetTriple()
Architecture triple accessor.
Definition ArchSpec.h:544
const char * GetArchitectureName() const
Returns a static string representing the current architecture.
Definition ArchSpec.cpp:740
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)
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:941
static lldb::DebuggerSP FindDebuggerWithID(lldb::user_id_t id)
static void Destroy(lldb::DebuggerSP &debugger_sp)
Definition Debugger.cpp:985
static StructuredData::DictionarySP GetAsStructuredData(const Event *event_ptr)
bool Dump(llvm::raw_ostream &stream)
Write the diagnostic log into a directory 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:56
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:1210
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)
A Lockable handle over a Target's API mutex, returned by Target::GetAPIMutex() and backing the public...
static ArchSpec GetDefaultArchitecture()
Definition Target.cpp:2904
static void SetDefaultArchitecture(const ArchSpec &arch)
Definition Target.cpp:2908
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:338
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
class LLDB_API SBBroadcaster
Definition SBDefines.h:55
@ 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:123
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:126
class LLDB_API SBTypeFormat
Definition SBDefines.h:127
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:84
std::shared_ptr< lldb_private::Listener > ListenerSP
int32_t callback_token_t
Definition lldb-types.h:82
std::shared_ptr< lldb_private::TypeCategoryImpl > TypeCategoryImplSP
uint64_t user_id_t
Definition lldb-types.h:83
class LLDB_API SBStringList
Definition SBDefines.h:111
void(* SBDebuggerDestroyCallback)(lldb::user_id_t debugger_id, void *baton)
Definition SBDefines.h:147
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:134
class LLDB_API SBCommandInterpreterRunResult
Definition SBDefines.h:59
InputReaderGranularity
Token size/granularities for Input Readers.
class LLDB_API SBTypeSummary
Definition SBDefines.h:132
static lldb::ScriptLanguage ToScriptLanguage(llvm::StringRef s, lldb::ScriptLanguage fail_value, bool *success_ptr)