11#include "lldb/Host/Config.h"
63 "Couldn't cast lldb::SBEvent to lldb_private::Event.");
74 return m_interpreter.GetOpaqueTypeFromSBStream(*sb_stream);
76 "Couldn't cast lldb::SBStream to lldb_private::Stream.");
87 return m_interpreter.GetOpaqueTypeFromSBFrame(*sb_frame);
89 "Couldn't cast lldb::SBFrame to lldb_private::StackFrame.");
100 return m_interpreter.GetOpaqueTypeFromSBThread(*sb_thread);
102 "Couldn't cast lldb::SBThread to lldb_private::Thread.");
114 return m_interpreter.GetOpaqueTypeFromSBSymbolContext(*sb_symbol_context);
116 "Couldn't cast lldb::SBSymbolContext to lldb_private::SymbolContext.");
130 "Couldn't cast lldb::SBData to lldb::DataExtractorSP.");
134 return m_interpreter.GetDataExtractorFromSBData(*sb_data);
144 if (!sb_breakpoint) {
146 "Couldn't cast lldb::SBBreakpoint to lldb::BreakpointSP.");
150 return m_interpreter.GetOpaqueTypeFromSBBreakpoint(*sb_breakpoint);
163 "Couldn't cast lldb::SBBreakpointLocation to "
164 "lldb::BreakpointLocationSP.");
168 return m_interpreter.GetOpaqueTypeFromSBBreakpointLocation(*sb_break_loc);
177 if (!sb_attach_info) {
179 "Couldn't cast lldb::SBAttachInfo to lldb::ProcessAttachInfoSP.");
183 return m_interpreter.GetOpaqueTypeFromSBAttachInfo(*sb_attach_info);
192 if (!sb_launch_info) {
194 "Couldn't cast lldb::SBLaunchInfo to lldb::ProcessLaunchInfoSP.");
198 return m_interpreter.GetOpaqueTypeFromSBLaunchInfo(*sb_launch_info);
202std::optional<MemoryRegionInfo>
210 if (!sb_mem_reg_info) {
212 "Couldn't cast lldb::SBMemoryRegionInfo to "
213 "lldb_private::MemoryRegionInfo.");
217 return m_interpreter.GetOpaqueTypeFromSBMemoryRegionInfo(*sb_mem_reg_info);
231 "Couldn't cast lldb::SBExecutionContext to "
232 "lldb::ExecutionContextRefSP.");
236 return m_interpreter.GetOpaqueTypeFromSBExecutionContext(*sb_exe_ctx);
245 if (!unsigned_or_err) {
249 unsigned long long unsigned_val = *unsigned_or_err;
251 error =
Status(
"value too large for lldb::DescriptionLevel.");
265 if (!sb_frame_list) {
267 "couldn't cast lldb::SBFrameList to lldb::StackFrameListSP.");
271 return m_interpreter.GetOpaqueTypeFromSBFrameList(*sb_frame_list);
282 "couldn't cast lldb::SBValue to lldb::ValueObjectSP");
286 return m_interpreter.GetOpaqueTypeFromSBValue(*sb_value);
297 "couldn't cast lldb::SBTarget to lldb::TargetSP");
301 return m_interpreter.GetOpaqueTypeFromSBTarget(*sb_target);
311 if (!sb_value_list) {
313 "couldn't cast lldb::SBValueList to lldb::ValueObjectListSP");
318 for (uint32_t i = 0, e = sb_value_list->
GetSize(); i < e; ++i) {
320 out->Append(m_interpreter.GetOpaqueTypeFromSBValue(value));
static llvm::raw_ostream & error(Stream &strm)
lldb::SBValue GetValueAtIndex(uint32_t index)
Represents a list of SBFrame objects.
ScriptedInterface()=default
ScriptInterpreterPythonImpl & m_interpreter
T ExtractValueFromPythonObject(python::PythonObject &p, Status &error)
ScriptedPythonInterface(ScriptInterpreterPythonImpl &interpreter)
static Status FromErrorStringWithFormat(const char *format,...) __attribute__((format(printf
static Status FromErrorString(const char *str)
static Status FromError(llvm::Error error)
Avoid using this in new code. Migrate APIs to llvm::Expected instead.
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Array > ArraySP
Defines a symbol context baton that can be handed other debug core functions.
StructuredData::DictionarySP CreateStructuredDictionary() const
StructuredData::ArraySP CreateStructuredArray() const
llvm::Expected< unsigned long long > AsUnsignedLongLong() const
void * LLDBSWIGPython_CastPyObjectToSBExecutionContext(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBFrameList(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBThread(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBData(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBTarget(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBSymbolContext(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBStream(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBMemoryRegionInfo(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBBreakpointLocation(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBError(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBAttachInfo(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBLaunchInfo(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBValueList(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBValue(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBEvent(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBBreakpoint(PyObject *data)
void * LLDBSWIGPython_CastPyObjectToSBFrame(PyObject *data)
A class that represents a running process on the host machine.
std::shared_ptr< lldb_private::StackFrame > StackFrameSP
std::shared_ptr< lldb_private::BreakpointLocation > BreakpointLocationSP
DescriptionLevel
Description levels for "void GetDescription(Stream *, DescriptionLevel)" calls.
std::shared_ptr< lldb_private::Thread > ThreadSP
std::shared_ptr< lldb_private::ValueObject > ValueObjectSP
std::shared_ptr< lldb_private::ProcessAttachInfo > ProcessAttachInfoSP
std::shared_ptr< lldb_private::Stream > StreamSP
std::shared_ptr< lldb_private::Breakpoint > BreakpointSP
std::shared_ptr< lldb_private::ValueObjectList > ValueObjectListSP
class LLDB_API SBMemoryRegionInfo
std::shared_ptr< lldb_private::Target > TargetSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
std::shared_ptr< lldb_private::StackFrameList > StackFrameListSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP