Skip to content

Commit b6960e2

Browse files
rchamalaRahul Reddy Chamala
andauthored
[lldb][ResolveSourceFileCallback] Update SBModule (#120832)
Summary: RFC https://discourse.llvm.org/t/rfc-python-callback-for-source-file-resolution/83545 SBModule will be used for resolve source file callback as Python function arguments. This diff allows these things. Can be instantiated from SBPlatform. Can be passed to/from Python. Test Plan: N/A. The next set of diffs in the stack have unittests and shell test validation Co-authored-by: Rahul Reddy Chamala <[email protected]>
1 parent 55391f8 commit b6960e2

File tree

3 files changed

+9
-0
lines changed

3 files changed

+9
-0
lines changed

lldb/bindings/python/python-swigsafecast.swig

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessSP process_sp) {
2323
SWIGTYPE_p_lldb__SBProcess);
2424
}
2525

26+
PythonObject SWIGBridge::ToSWIGWrapper(lldb::ModuleSP module_sp) {
27+
return ToSWIGHelper(new lldb::SBModule(std::move(module_sp)),
28+
SWIGTYPE_p_lldb__SBModule);
29+
}
30+
2631
PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp) {
2732
return ToSWIGHelper(new lldb::SBThreadPlan(std::move(thread_plan_sp)),
2833
SWIGTYPE_p_lldb__SBThreadPlan);

lldb/include/lldb/API/SBModule.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,9 +301,12 @@ class LLDB_API SBModule {
301301
friend class SBFrame;
302302
friend class SBSection;
303303
friend class SBSymbolContext;
304+
friend class SBPlatform;
304305
friend class SBTarget;
305306
friend class SBType;
306307

308+
friend class lldb_private::python::SWIGBridge;
309+
307310
explicit SBModule(const lldb::ModuleSP &module_sp);
308311

309312
ModuleSP GetSP() const;

lldb/source/Plugins/ScriptInterpreter/Python/SWIGPythonBridge.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ class SWIGBridge {
8484
static PythonObject ToSWIGWrapper(lldb::ValueObjectSP value_sp);
8585
static PythonObject ToSWIGWrapper(lldb::TargetSP target_sp);
8686
static PythonObject ToSWIGWrapper(lldb::ProcessSP process_sp);
87+
static PythonObject ToSWIGWrapper(lldb::ModuleSP module_sp);
8788
static PythonObject ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp);
8889
static PythonObject ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp);
8990
static PythonObject ToSWIGWrapper(Status &&status);

0 commit comments

Comments
 (0)