35 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
38 "This script interpreter does not support breakpoint callbacks.");
44 "This script interpreter does not support watchpoint callbacks.");
56 "This script interpreter does not support importing modules.");
71 llvm_unreachable(
"Unhandled ScriptInterpreter!");
91 return std::make_shared<ProcessLaunchInfo>(
97 if (
error.m_opaque_up)
98 return error.m_opaque_up->Clone();
105 return event.m_opaque_ptr;
111 lldb::StreamSP s = std::make_shared<lldb_private::StreamString>();
112 *s << reinterpret_cast<StreamString *>(stream.
m_opaque_up.get())->m_packet;
126std::optional<MemoryRegionInfo>
152 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
153 const char *callback_text) {
158 if (!
error.Success())
165 std::vector<std::reference_wrapper<BreakpointOptions>> &bp_options_vec,
171 if (!
error.Success())
177std::unique_ptr<ScriptInterpreterLocker>
179 return std::make_unique<ScriptInterpreterLocker>();
184 if (src && src_len) {
186 strm->
Write(src, src_len);
191llvm::Expected<std::unique_ptr<ScriptInterpreterIORedirect>>
195 return std::unique_ptr<ScriptInterpreterIORedirect>(
201 return nullin.takeError();
206 return nullin.takeError();
208 return std::unique_ptr<ScriptInterpreterIORedirect>(
213 std::unique_ptr<File> input, std::unique_ptr<File> output)
234 std::unique_ptr<ConnectionGenericFile> conn_up =
235 std::make_unique<ConnectionGenericFile>(read_file,
true);
237 std::unique_ptr<ConnectionFileDescriptor> conn_up =
238 std::make_unique<ConnectionFileDescriptor>(
242 if (conn_up->IsConnected()) {
255 ::setbuf(outfile_handle,
nullptr);
static llvm::raw_ostream & error(Stream &strm)
static void ReadThreadBytesReceived(void *baton, const void *src, size_t src_len)
ProcessAttachInfoSP m_opaque_sp
lldb::BreakpointWP m_opaque_wp
lldb::DataExtractorSP m_opaque_sp
lldb::ExecutionContextRefSP m_exe_ctx_sp
std::shared_ptr< lldb_private::SBLaunchInfoImpl > m_opaque_sp
lldb::MemoryRegionInfoUP m_opaque_up
std::unique_ptr< lldb_private::Stream > m_opaque_up
std::unique_ptr< lldb_private::SymbolContext > m_opaque_up
"lldb/Breakpoint/BreakpointOptions.h" Class that manages the options on a breakpoint or breakpoint lo...
void SetImmediateErrorFile(lldb::FileSP file_sp)
void void AppendError(llvm::StringRef in_string)
void SetImmediateOutputFile(lldb::FileSP file_sp)
Stream & GetOutputStream()
A class to manage flag bits.
lldb::FileSP GetInputFileSP()
lldb::FileSP GetErrorFileSP()
lldb::FileSP GetOutputFileSP()
void AdoptTopIOHandlerFilesIfInvalid(lldb::FileSP &in, lldb::LockableStreamFileSP &out, lldb::LockableStreamFileSP &err)
static const char * DEV_NULL
int Open(const char *path, int flags, int mode=0600)
Wraps open in a platform-independent way.
static FileSystem & Instance()
Status CreateNew() override
int ReleaseReadFileDescriptor() override
int ReleaseWriteFileDescriptor() override
lldb::FileSP m_input_file_sp
ThreadedCommunication m_communication
~ScriptInterpreterIORedirect()
void Flush()
Flush our output and error file handles.
ScriptInterpreterIORedirect(std::unique_ptr< File > input, std::unique_ptr< File > output)
static llvm::Expected< std::unique_ptr< ScriptInterpreterIORedirect > > Create(bool enable_io, Debugger &debugger, CommandReturnObject *result)
Create an IO redirect.
lldb::LockableStreamFileSP m_error_file_sp
LockableStreamFile::Mutex m_output_mutex
lldb::LockableStreamFileSP m_output_file_sp
static lldb::ScriptLanguage StringToLanguage(const llvm::StringRef &string)
virtual void CollectDataForBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &options, CommandReturnObject &result)
lldb::ProcessAttachInfoSP GetOpaqueTypeFromSBAttachInfo(const lldb::SBAttachInfo &attach_info) const
lldb::StreamSP GetOpaqueTypeFromSBStream(const lldb::SBStream &stream) const
lldb::ExecutionContextRefSP GetOpaqueTypeFromSBExecutionContext(const lldb::SBExecutionContext &exe_ctx) const
SymbolContext GetOpaqueTypeFromSBSymbolContext(const lldb::SBSymbolContext &sym_ctx) const
Event * GetOpaqueTypeFromSBEvent(const lldb::SBEvent &event) const
Status SetBreakpointCommandCallback(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *callback_text)
Set the specified text as the callback for the breakpoint.
lldb::ProcessLaunchInfoSP GetOpaqueTypeFromSBLaunchInfo(const lldb::SBLaunchInfo &launch_info) const
virtual bool LoadScriptingModule(const char *filename, const LoadScriptOptions &options, lldb_private::Status &error, StructuredData::ObjectSP *module_sp=nullptr, FileSpec extra_search_dir={}, lldb::TargetSP loaded_into_target_sp={})
static std::string LanguageToString(lldb::ScriptLanguage language)
Status GetStatusFromSBError(const lldb::SBError &error) const
std::optional< MemoryRegionInfo > GetOpaqueTypeFromSBMemoryRegionInfo(const lldb::SBMemoryRegionInfo &mem_region) const
virtual std::unique_ptr< ScriptInterpreterLocker > AcquireInterpreterLock()
virtual StructuredData::DictionarySP GetInterpreterInfo()
Status SetBreakpointCommandCallbackFunction(std::vector< std::reference_wrapper< BreakpointOptions > > &bp_options_vec, const char *function_name, StructuredData::ObjectSP extra_args_sp)
lldb::BreakpointSP GetOpaqueTypeFromSBBreakpoint(const lldb::SBBreakpoint &breakpoint) const
lldb::ScriptLanguage m_script_lang
lldb::DataExtractorSP GetDataExtractorFromSBData(const lldb::SBData &data) const
ScriptInterpreter(Debugger &debugger, lldb::ScriptLanguage script_lang)
virtual void CollectDataForWatchpointCommandCallback(WatchpointOptions *wp_options, CommandReturnObject &result)
static Status FromErrorString(const char *str)
A stream class that can stream formatted output to a file.
size_t Write(const void *src, size_t src_len)
Output character bytes to the stream.
virtual void Flush()=0
Flush the stream.
std::shared_ptr< Dictionary > DictionarySP
std::shared_ptr< Object > ObjectSP
Defines a symbol context baton that can be handed other debug core functions.
"lldb/Breakpoint/WatchpointOptions.h" Class that manages the options on a watchpoint.
A class that represents a running process on the host machine.
ScriptLanguage
Script interpreter types.
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::Target > TargetSP
std::shared_ptr< lldb_private::DataExtractor > DataExtractorSP
std::shared_ptr< lldb_private::ProcessLaunchInfo > ProcessLaunchInfoSP
std::shared_ptr< lldb_private::ExecutionContextRef > ExecutionContextRefSP