LLDB mainline
ScriptInterpreterPython.cpp File Reference
#include "lldb-python.h"
#include "Interfaces/ScriptInterpreterPythonInterfaces.h"
#include "PythonDataObjects.h"
#include "PythonReadline.h"
#include "SWIGPythonBridge.h"
#include "ScriptInterpreterPythonImpl.h"
#include "lldb/API/SBError.h"
#include "lldb/API/SBExecutionContext.h"
#include "lldb/API/SBFrame.h"
#include "lldb/API/SBValue.h"
#include "lldb/Breakpoint/StoppointCallbackContext.h"
#include "lldb/Breakpoint/WatchpointOptions.h"
#include "lldb/Core/Debugger.h"
#include "lldb/Core/PluginManager.h"
#include "lldb/Core/ThreadedCommunication.h"
#include "lldb/DataFormatters/TypeSummary.h"
#include "lldb/Host/FileSystem.h"
#include "lldb/Host/HostInfo.h"
#include "lldb/Host/Pipe.h"
#include "lldb/Host/StreamFile.h"
#include "lldb/Interpreter/CommandInterpreter.h"
#include "lldb/Interpreter/CommandReturnObject.h"
#include "lldb/Target/Thread.h"
#include "lldb/Target/ThreadPlan.h"
#include "lldb/Utility/Instrumentation.h"
#include "lldb/Utility/LLDBLog.h"
#include "lldb/Utility/Timer.h"
#include "lldb/ValueObject/ValueObject.h"
#include "lldb/lldb-enumerations.h"
#include "lldb/lldb-forward.h"
#include "llvm/ADT/STLExtras.h"
#include "llvm/ADT/StringRef.h"
#include "llvm/Support/Error.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/FormatAdapters.h"
#include <cstdio>
#include <cstdlib>
#include <memory>
#include <mutex>
#include <optional>
#include <string>

Go to the source code of this file.

Macros

#define LLDBSwigPyInit   PyInit__lldb
#define LLDB_USE_PYTHON_SET_INTERRUPT   1

Functions

PyObject * PyInit__lldb (void)
static ScriptInterpreterPythonImplGetPythonInterpreter (Debugger &debugger)
static std::string GenerateUniqueName (const char *base_name_wanted, uint32_t &functions_counter, const void *name_token=nullptr)
uint64_t replace_all (std::string &str, const std::string &oldStr, const std::string &newStr)

Variables

static const char GetInterpreterInfoScript []
static const char python_exe_relative_path [] = LLDB_PYTHON_EXE_RELATIVE_PATH

Macro Definition Documentation

◆ LLDB_USE_PYTHON_SET_INTERRUPT

#define LLDB_USE_PYTHON_SET_INTERRUPT   1

Definition at line 71 of file ScriptInterpreterPython.cpp.

◆ LLDBSwigPyInit

#define LLDBSwigPyInit   PyInit__lldb

Definition at line 65 of file ScriptInterpreterPython.cpp.

Function Documentation

◆ GenerateUniqueName()

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

Definition at line 729 of file ScriptInterpreterPython.cpp.

◆ GetPythonInterpreter()

ScriptInterpreterPythonImpl * GetPythonInterpreter ( Debugger & debugger)
static

◆ PyInit__lldb()

PyObject * PyInit__lldb ( void )

References PyInit__lldb().

Referenced by PyInit__lldb().

◆ replace_all()

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

Definition at line 2209 of file ScriptInterpreterPython.cpp.

References error().

Variable Documentation

◆ GetInterpreterInfoScript

const char GetInterpreterInfoScript[]
static
Initial value:
= R"(
import os
import sys
def main(lldb_python_dir, python_exe_relative_path):
info = {
"lldb-pythonpath": lldb_python_dir,
"language": "python",
"prefix": sys.prefix,
"executable": os.path.join(sys.prefix, python_exe_relative_path)
}
return info
)"

Definition at line 231 of file ScriptInterpreterPython.cpp.

Referenced by lldb_private::ScriptInterpreterPython::GetInterpreterInfo().

◆ python_exe_relative_path

const char python_exe_relative_path[] = LLDB_PYTHON_EXE_RELATIVE_PATH
static