Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
d46bcbd
[lldb/ScriptInterpreter] Fix typo in AbstractMethodCheckerPayload (NF…
medismailben Dec 1, 2025
1317654
[lldb] Handle staticmethod/classmethod descriptors in ScriptedPythonI…
medismailben Dec 1, 2025
08431e0
[lldb/ScriptInterpreter] Add a way to retrieve script module file pat…
medismailben Dec 1, 2025
cd248f2
[lldb/ScriptInterpreter] Fix typo in GetScriptedModulePath (NFC)
medismailben Dec 4, 2025
a76d31e
[lldb] Introduce SBFrameList for lazy frame iteration (#166651)
medismailben Nov 6, 2025
7f2f9bc
[lldb/Target] Add SyntheticFrameProvider class (#166664)
medismailben Nov 6, 2025
a9234ca
[lldb/Interpreter] Implement ScriptedFrameProvider{,Python}Interface …
medismailben Nov 6, 2025
a69518a
[lldb/Target] Track containing StackFrameList to avoid circular depen…
medismailben Dec 2, 2025
39156e0
[lldb/Target] Add BorrowedStackFrame and make StackFrame methods virt…
medismailben Dec 2, 2025
21ccd97
Reland "[lldb] Introduce ScriptedFrameProvider for real threads (#161…
medismailben Dec 2, 2025
b52bfc9
[lldb/test] Fix scripted frame provider tests on ARM32
medismailben Dec 3, 2025
e54c730
[lldb/test] XFAIL TestFrameProviderCircularDependency.py on Windows
medismailben Dec 3, 2025
e6727d2
[lldb/test] Add missing import for decorator (NFC)
medismailben Dec 3, 2025
c00975a
[lldb/test] Skip ScriptedFrameProviders tests on arm32 (NFC)
medismailben Dec 3, 2025
add9aad
[lldb/test] Add missing import for decorator (NFC)
medismailben Dec 3, 2025
99b2c79
[lldb/docs] Add ScriptingFrameProvider documentation to the website
medismailben Dec 3, 2025
7b6a6bf
[lldb] Add support for synthetic LineEntry objects without valid addr…
medismailben Dec 4, 2025
6d82a21
[lldb] Add support for PC-less scripted frames (#170805)
medismailben Dec 5, 2025
a4fcf1b
[lldb] Regenerate python static bindings
medismailben Dec 6, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions lldb/bindings/interface/SBFrameListExtensions.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
%extend lldb::SBFrameList {

#ifdef SWIGPYTHON
%nothreadallow;
#endif
std::string lldb::SBFrameList::__str__ (){
lldb::SBStream description;
if (!$self->GetDescription(description))
return std::string("<empty> lldb.SBFrameList()");
const char *desc = description.GetData();
size_t desc_len = description.GetSize();
if (desc_len > 0 && (desc[desc_len-1] == '\n' || desc[desc_len-1] == '\r'))
--desc_len;
return std::string(desc, desc_len);
}
#ifdef SWIGPYTHON
%clearnothreadallow;
#endif

#ifdef SWIGPYTHON
%pythoncode %{
def __iter__(self):
'''Iterate over all frames in a lldb.SBFrameList object.'''
return lldb_iter(self, 'GetSize', 'GetFrameAtIndex')

def __len__(self):
return int(self.GetSize())

def __getitem__(self, key):
if type(key) is not int:
return None
if key < 0:
count = len(self)
if -count <= key < count:
key %= count

frame = self.GetFrameAtIndex(key)
return frame if frame.IsValid() else None
%}
#endif
}
3 changes: 2 additions & 1 deletion lldb/bindings/interface/SBThreadExtensions.i
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ STRING_EXTENSION_OUTSIDE(SBThread)
def get_thread_frames(self):
'''An accessor function that returns a list() that contains all frames in a lldb.SBThread object.'''
frames = []
for frame in self:
frame_list = self.GetFrames()
for frame in frame_list:
frames.append(frame)
return frames

Expand Down
2 changes: 2 additions & 0 deletions lldb/bindings/interfaces.swig
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@
%include "lldb/API/SBFileSpecList.h"
%include "lldb/API/SBFormat.h"
%include "lldb/API/SBFrame.h"
%include "lldb/API/SBFrameList.h"
%include "lldb/API/SBFunction.h"
%include "lldb/API/SBHostOS.h"
%include "lldb/API/SBInstruction.h"
Expand Down Expand Up @@ -192,6 +193,7 @@
%include "./interface/SBFileSpecExtensions.i"
%include "./interface/SBFileSpecListExtensions.i"
%include "./interface/SBFrameExtensions.i"
%include "./interface/SBFrameListExtensions.i"
%include "./interface/SBFunctionExtensions.i"
%include "./interface/SBInstructionExtensions.i"
%include "./interface/SBInstructionListExtensions.i"
Expand Down
1 change: 1 addition & 0 deletions lldb/bindings/python/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
"plugins"
FILES
"${LLDB_SOURCE_DIR}/examples/python/templates/parsed_cmd.py"
"${LLDB_SOURCE_DIR}/examples/python/templates/scripted_frame_provider.py"
"${LLDB_SOURCE_DIR}/examples/python/templates/scripted_process.py"
"${LLDB_SOURCE_DIR}/examples/python/templates/scripted_platform.py"
"${LLDB_SOURCE_DIR}/examples/python/templates/operating_system.py"
Expand Down
5 changes: 5 additions & 0 deletions lldb/bindings/python/python-swigsafecast.swig
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@ PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp) {
SWIGTYPE_p_lldb__SBThreadPlan);
}

PythonObject SWIGBridge::ToSWIGWrapper(lldb::StackFrameListSP frames_sp) {
return ToSWIGHelper(new lldb::SBFrameList(std::move(frames_sp)),
SWIGTYPE_p_lldb__SBFrameList);
}

PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp) {
return ToSWIGHelper(new lldb::SBBreakpoint(std::move(breakpoint_sp)),
SWIGTYPE_p_lldb__SBBreakpoint);
Expand Down
24 changes: 24 additions & 0 deletions lldb/bindings/python/python-wrapper.swig
Original file line number Diff line number Diff line change
Expand Up @@ -422,6 +422,18 @@ void *lldb_private::python::LLDBSWIGPython_CastPyObjectToSBBreakpoint(PyObject *
return sb_ptr;
}

void *lldb_private::python::LLDBSWIGPython_CastPyObjectToSBThread(PyObject * data) {
lldb::SBThread *sb_ptr = nullptr;

int valid_cast =
SWIG_ConvertPtr(data, (void **)&sb_ptr, SWIGTYPE_p_lldb__SBThread, 0);

if (valid_cast == -1)
return NULL;

return sb_ptr;
}

void *lldb_private::python::LLDBSWIGPython_CastPyObjectToSBFrame(PyObject * data) {
lldb::SBFrame *sb_ptr = nullptr;

Expand Down Expand Up @@ -556,6 +568,18 @@ void *lldb_private::python::LLDBSWIGPython_CastPyObjectToSBExecutionContext(PyOb
return sb_ptr;
}

void *lldb_private::python::LLDBSWIGPython_CastPyObjectToSBFrameList(PyObject *data) {
lldb::SBFrameList *sb_ptr = NULL;

int valid_cast = SWIG_ConvertPtr(data, (void **)&sb_ptr,
SWIGTYPE_p_lldb__SBFrameList, 0);

if (valid_cast == -1)
return NULL;

return sb_ptr;
}

bool lldb_private::python::SWIGBridge::LLDBSwigPythonCallCommand(
const char *python_function_name, const char *session_dictionary_name,
lldb::DebuggerSP debugger, const char *args,
Expand Down
Loading