LLDB  mainline
Macros | Functions | Variables
ScriptInterpreterPython.cpp File Reference
#include "lldb-python.h"
#include "PythonDataObjects.h"
#include "PythonExceptionState.h"
#include "ScriptInterpreterPythonImpl.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBValue.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Breakpoint/WatchpointOptions.h"
#include "lldb/Core/Communication.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/ValueObject.h"
#include "lldb/DataFormatters/TypeSummary.h"
#include "lldb/Host/ConnectionFileDescriptor.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Utility/Timer.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/FileSystem.h"
#include <memory>
#include <mutex>
#include <stdio.h>
#include <stdlib.h>
#include <string>
Include dependency graph for ScriptInterpreterPython.cpp:

Go to the source code of this file.

Macros

#define LLDBSwigPyInit   init_lldb
 

Functions

void init_lldb (void)
 
bool LLDBSwigPythonBreakpointCallbackFunction (const char *python_function_name, const char *session_dictionary_name, const lldb::StackFrameSP &sb_frame, const lldb::BreakpointLocationSP &sb_bp_loc)
 
bool LLDBSwigPythonWatchpointCallbackFunction (const char *python_function_name, const char *session_dictionary_name, const lldb::StackFrameSP &sb_frame, const lldb::WatchpointSP &sb_wp)
 
bool LLDBSwigPythonCallTypeScript (const char *python_function_name, void *session_dictionary, const lldb::ValueObjectSP &valobj_sp, void **pyfunct_wrapper, const lldb::TypeSummaryOptionsSP &options_sp, std::string &retval)
 
void * LLDBSwigPythonCreateSyntheticProvider (const char *python_class_name, const char *session_dictionary_name, const lldb::ValueObjectSP &valobj_sp)
 
void * LLDBSwigPythonCreateCommandObject (const char *python_class_name, const char *session_dictionary_name, const lldb::DebuggerSP debugger_sp)
 
void * LLDBSwigPythonCreateScriptedThreadPlan (const char *python_class_name, const char *session_dictionary_name, const lldb::ThreadPlanSP &thread_plan_sp)
 
bool LLDBSWIGPythonCallThreadPlan (void *implementor, const char *method_name, Event *event_sp, bool &got_error)
 
void * LLDBSwigPythonCreateScriptedBreakpointResolver (const char *python_class_name, const char *session_dictionary_name, lldb_private::StructuredDataImpl *args, lldb::BreakpointSP &bkpt_sp)
 
unsigned int LLDBSwigPythonCallBreakpointResolver (void *implementor, const char *method_name, lldb_private::SymbolContext *sym_ctx)
 
size_t LLDBSwigPython_CalculateNumChildren (void *implementor, uint32_t max)
 
void * LLDBSwigPython_GetChildAtIndex (void *implementor, uint32_t idx)
 
int LLDBSwigPython_GetIndexOfChildWithName (void *implementor, const char *child_name)
 
void * LLDBSWIGPython_CastPyObjectToSBValue (void *data)
 
lldb::ValueObjectSP LLDBSWIGPython_GetValueObjectSPFromSBValue (void *data)
 
bool LLDBSwigPython_UpdateSynthProviderInstance (void *implementor)
 
bool LLDBSwigPython_MightHaveChildrenSynthProviderInstance (void *implementor)
 
void * LLDBSwigPython_GetValueSynthProviderInstance (void *implementor)
 
bool LLDBSwigPythonCallCommand (const char *python_function_name, const char *session_dictionary_name, lldb::DebuggerSP &debugger, const char *args, lldb_private::CommandReturnObject &cmd_retobj, lldb::ExecutionContextRefSP exe_ctx_ref_sp)
 
bool LLDBSwigPythonCallCommandObject (void *implementor, lldb::DebuggerSP &debugger, const char *args, lldb_private::CommandReturnObject &cmd_retobj, lldb::ExecutionContextRefSP exe_ctx_ref_sp)
 
bool LLDBSwigPythonCallModuleInit (const char *python_module_name, const char *session_dictionary_name, lldb::DebuggerSP &debugger)
 
void * LLDBSWIGPythonCreateOSPlugin (const char *python_class_name, const char *session_dictionary_name, const lldb::ProcessSP &process_sp)
 
void * LLDBSWIGPython_CreateFrameRecognizer (const char *python_class_name, const char *session_dictionary_name)
 
void * LLDBSwigPython_GetRecognizedArguments (void *implementor, const lldb::StackFrameSP &frame_sp)
 
bool LLDBSWIGPythonRunScriptKeywordProcess (const char *python_function_name, const char *session_dictionary_name, lldb::ProcessSP &process, std::string &output)
 
bool LLDBSWIGPythonRunScriptKeywordThread (const char *python_function_name, const char *session_dictionary_name, lldb::ThreadSP &thread, std::string &output)
 
bool LLDBSWIGPythonRunScriptKeywordTarget (const char *python_function_name, const char *session_dictionary_name, lldb::TargetSP &target, std::string &output)
 
bool LLDBSWIGPythonRunScriptKeywordFrame (const char *python_function_name, const char *session_dictionary_name, lldb::StackFrameSP &frame, std::string &output)
 
bool LLDBSWIGPythonRunScriptKeywordValue (const char *python_function_name, const char *session_dictionary_name, lldb::ValueObjectSP &value, std::string &output)
 
void * LLDBSWIGPython_GetDynamicSetting (void *module, const char *setting, const lldb::TargetSP &target_sp)
 
static std::string GenerateUniqueName (const char *base_name_wanted, uint32_t &functions_counter, const void *name_token=nullptr)
 
static void ReadThreadBytesReceived (void *baton, const void *src, size_t src_len)
 
template<typename T >
const char * GetPythonValueFormatString (T t)
 
template<>
const char * GetPythonValueFormatString (char *)
 
template<>
const char * GetPythonValueFormatString (char)
 
template<>
const char * GetPythonValueFormatString (unsigned char)
 
template<>
const char * GetPythonValueFormatString (short)
 
template<>
const char * GetPythonValueFormatString (int)
 
template<>
const char * GetPythonValueFormatString (long)
 
template<>
const char * GetPythonValueFormatString (unsigned long long)
 
template<>
const char * GetPythonValueFormatString (float t)
 
template<>
const char * GetPythonValueFormatString (double t)
 
uint64_t replace_all (std::string &str, const std::string &oldStr, const std::string &newStr)
 

Variables

static bool g_initialized = false
 

Macro Definition Documentation

◆ LLDBSwigPyInit

#define LLDBSwigPyInit   init_lldb

Function Documentation

◆ GenerateUniqueName()

static std::string GenerateUniqueName ( const char *  base_name_wanted,
uint32_t functions_counter,
const void *  name_token = nullptr 
)
static

◆ GetPythonValueFormatString() [1/10]

template<typename T >
const char* GetPythonValueFormatString ( t)

◆ GetPythonValueFormatString() [2/10]

template<>
const char* GetPythonValueFormatString ( char *  )

Definition at line 1717 of file ScriptInterpreterPython.cpp.

◆ GetPythonValueFormatString() [3/10]

template<>
const char* GetPythonValueFormatString ( char  )

Definition at line 1718 of file ScriptInterpreterPython.cpp.

◆ GetPythonValueFormatString() [4/10]

template<>
const char * GetPythonValueFormatString ( unsigned  char)

Definition at line 1719 of file ScriptInterpreterPython.cpp.

◆ GetPythonValueFormatString() [5/10]

template<>
const char* GetPythonValueFormatString ( short  )

Definition at line 1722 of file ScriptInterpreterPython.cpp.

References GetPythonValueFormatString().

◆ GetPythonValueFormatString() [6/10]

template<>
const char* GetPythonValueFormatString ( int  )

Definition at line 1726 of file ScriptInterpreterPython.cpp.

References GetPythonValueFormatString().

◆ GetPythonValueFormatString() [7/10]

template<>
const char * GetPythonValueFormatString ( long long  )

Definition at line 1728 of file ScriptInterpreterPython.cpp.

References GetPythonValueFormatString().

◆ GetPythonValueFormatString() [8/10]

template<>
const char* GetPythonValueFormatString ( unsigned long  long)

Definition at line 1733 of file ScriptInterpreterPython.cpp.

◆ GetPythonValueFormatString() [9/10]

template<>
const char* GetPythonValueFormatString ( float  t)

Definition at line 1736 of file ScriptInterpreterPython.cpp.

◆ GetPythonValueFormatString() [10/10]

template<>
const char* GetPythonValueFormatString ( double  t)

Definition at line 1737 of file ScriptInterpreterPython.cpp.

◆ init_lldb()

void init_lldb ( void  )

◆ LLDBSwigPython_CalculateNumChildren()

size_t LLDBSwigPython_CalculateNumChildren ( void *  implementor,
uint32_t  max 
)

◆ LLDBSWIGPython_CastPyObjectToSBValue()

void* LLDBSWIGPython_CastPyObjectToSBValue ( void *  data)

◆ LLDBSWIGPython_CreateFrameRecognizer()

void* LLDBSWIGPython_CreateFrameRecognizer ( const char *  python_class_name,
const char *  session_dictionary_name 
)

◆ LLDBSwigPython_GetChildAtIndex()

void* LLDBSwigPython_GetChildAtIndex ( void *  implementor,
uint32_t  idx 
)

◆ LLDBSWIGPython_GetDynamicSetting()

void* LLDBSWIGPython_GetDynamicSetting ( void *  module,
const char *  setting,
const lldb::TargetSP &  target_sp 
)

◆ LLDBSwigPython_GetIndexOfChildWithName()

int LLDBSwigPython_GetIndexOfChildWithName ( void *  implementor,
const char *  child_name 
)

◆ LLDBSwigPython_GetRecognizedArguments()

void* LLDBSwigPython_GetRecognizedArguments ( void *  implementor,
const lldb::StackFrameSP &  frame_sp 
)

◆ LLDBSWIGPython_GetValueObjectSPFromSBValue()

lldb::ValueObjectSP LLDBSWIGPython_GetValueObjectSPFromSBValue ( void *  data)

◆ LLDBSwigPython_GetValueSynthProviderInstance()

void* LLDBSwigPython_GetValueSynthProviderInstance ( void *  implementor)

◆ LLDBSwigPython_MightHaveChildrenSynthProviderInstance()

bool LLDBSwigPython_MightHaveChildrenSynthProviderInstance ( void *  implementor)

◆ LLDBSwigPython_UpdateSynthProviderInstance()

bool LLDBSwigPython_UpdateSynthProviderInstance ( void *  implementor)

◆ LLDBSwigPythonBreakpointCallbackFunction()

bool LLDBSwigPythonBreakpointCallbackFunction ( const char *  python_function_name,
const char *  session_dictionary_name,
const lldb::StackFrameSP &  sb_frame,
const lldb::BreakpointLocationSP &  sb_bp_loc 
)

◆ LLDBSwigPythonCallBreakpointResolver()

unsigned int LLDBSwigPythonCallBreakpointResolver ( void *  implementor,
const char *  method_name,
lldb_private::SymbolContext sym_ctx 
)

◆ LLDBSwigPythonCallCommand()

bool LLDBSwigPythonCallCommand ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::DebuggerSP &  debugger,
const char *  args,
lldb_private::CommandReturnObject cmd_retobj,
lldb::ExecutionContextRefSP  exe_ctx_ref_sp 
)

◆ LLDBSwigPythonCallCommandObject()

bool LLDBSwigPythonCallCommandObject ( void *  implementor,
lldb::DebuggerSP &  debugger,
const char *  args,
lldb_private::CommandReturnObject cmd_retobj,
lldb::ExecutionContextRefSP  exe_ctx_ref_sp 
)

◆ LLDBSwigPythonCallModuleInit()

bool LLDBSwigPythonCallModuleInit ( const char *  python_module_name,
const char *  session_dictionary_name,
lldb::DebuggerSP &  debugger 
)

◆ LLDBSWIGPythonCallThreadPlan()

bool LLDBSWIGPythonCallThreadPlan ( void *  implementor,
const char *  method_name,
Event event_sp,
bool &  got_error 
)

◆ LLDBSwigPythonCallTypeScript()

bool LLDBSwigPythonCallTypeScript ( const char *  python_function_name,
void *  session_dictionary,
const lldb::ValueObjectSP &  valobj_sp,
void **  pyfunct_wrapper,
const lldb::TypeSummaryOptionsSP &  options_sp,
std::string &  retval 
)

◆ LLDBSwigPythonCreateCommandObject()

void* LLDBSwigPythonCreateCommandObject ( const char *  python_class_name,
const char *  session_dictionary_name,
const lldb::DebuggerSP  debugger_sp 
)

◆ LLDBSWIGPythonCreateOSPlugin()

void* LLDBSWIGPythonCreateOSPlugin ( const char *  python_class_name,
const char *  session_dictionary_name,
const lldb::ProcessSP &  process_sp 
)

◆ LLDBSwigPythonCreateScriptedBreakpointResolver()

void* LLDBSwigPythonCreateScriptedBreakpointResolver ( const char *  python_class_name,
const char *  session_dictionary_name,
lldb_private::StructuredDataImpl args,
lldb::BreakpointSP &  bkpt_sp 
)

◆ LLDBSwigPythonCreateScriptedThreadPlan()

void* LLDBSwigPythonCreateScriptedThreadPlan ( const char *  python_class_name,
const char *  session_dictionary_name,
const lldb::ThreadPlanSP &  thread_plan_sp 
)

◆ LLDBSwigPythonCreateSyntheticProvider()

void* LLDBSwigPythonCreateSyntheticProvider ( const char *  python_class_name,
const char *  session_dictionary_name,
const lldb::ValueObjectSP &  valobj_sp 
)

◆ LLDBSWIGPythonRunScriptKeywordFrame()

bool LLDBSWIGPythonRunScriptKeywordFrame ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::StackFrameSP &  frame,
std::string &  output 
)

◆ LLDBSWIGPythonRunScriptKeywordProcess()

bool LLDBSWIGPythonRunScriptKeywordProcess ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::ProcessSP &  process,
std::string &  output 
)

◆ LLDBSWIGPythonRunScriptKeywordTarget()

bool LLDBSWIGPythonRunScriptKeywordTarget ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::TargetSP &  target,
std::string &  output 
)

◆ LLDBSWIGPythonRunScriptKeywordThread()

bool LLDBSWIGPythonRunScriptKeywordThread ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::ThreadSP &  thread,
std::string &  output 
)

◆ LLDBSWIGPythonRunScriptKeywordValue()

bool LLDBSWIGPythonRunScriptKeywordValue ( const char *  python_function_name,
const char *  session_dictionary_name,
lldb::ValueObjectSP &  value,
std::string &  output 
)

◆ LLDBSwigPythonWatchpointCallbackFunction()

bool LLDBSwigPythonWatchpointCallbackFunction ( const char *  python_function_name,
const char *  session_dictionary_name,
const lldb::StackFrameSP &  sb_frame,
const lldb::WatchpointSP &  sb_wp 
)

◆ ReadThreadBytesReceived()

static void ReadThreadBytesReceived ( void *  baton,
const void *  src,
size_t  src_len 
)
static

◆ replace_all()

uint64_t replace_all ( std::string &  str,
const std::string &  oldStr,
const std::string &  newStr 
)

Variable Documentation

◆ g_initialized

bool g_initialized = false
static