1 namespace lldb_private {
4 PythonObject ToSWIGHelper(void *obj, swig_type_info *info) {
5 return {PyRefType::Owned, SWIG_NewPointerObj(obj, info, SWIG_POINTER_OWN)};
8 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBValue> value_sb) {
9 return ToSWIGHelper(value_sb.release(), SWIGTYPE_p_lldb__SBValue);
12 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ValueObjectSP value_sp) {
13 return ToSWIGWrapper(std::unique_ptr<lldb::SBValue>(new lldb::SBValue(value_sp)));
16 PythonObject SWIGBridge::ToSWIGWrapper(lldb::TargetSP target_sp) {
17 return ToSWIGHelper(new lldb::SBTarget(std::move(target_sp)),
18 SWIGTYPE_p_lldb__SBTarget);
21 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessSP process_sp) {
22 return ToSWIGHelper(new lldb::SBProcess(std::move(process_sp)),
23 SWIGTYPE_p_lldb__SBProcess);
26 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp) {
27 return ToSWIGHelper(new lldb::SBThreadPlan(std::move(thread_plan_sp)),
28 SWIGTYPE_p_lldb__SBThreadPlan);
31 PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp) {
32 return ToSWIGHelper(new lldb::SBBreakpoint(std::move(breakpoint_sp)),
33 SWIGTYPE_p_lldb__SBBreakpoint);
36 PythonObject SWIGBridge::ToSWIGWrapper(const Status& status) {
37 return ToSWIGHelper(new lldb::SBError(status), SWIGTYPE_p_lldb__SBError);
40 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStream> stream_sb) {
41 return ToSWIGHelper(stream_sb.release(), SWIGTYPE_p_lldb__SBStream);
44 PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData> data_sb) {
45 return ToSWIGHelper(data_sb.release(), SWIGTYPE_p_lldb__SBStructuredData);
48 PythonObject SWIGBridge::ToSWIGWrapper(const StructuredDataImpl &data_impl) {
49 return ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData>(new lldb::SBStructuredData(data_impl)));
52 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadSP thread_sp) {
53 return ToSWIGHelper(new lldb::SBThread(std::move(thread_sp)),
54 SWIGTYPE_p_lldb__SBThread);
57 PythonObject SWIGBridge::ToSWIGWrapper(lldb::StackFrameSP frame_sp) {
58 return ToSWIGHelper(new lldb::SBFrame(std::move(frame_sp)),
59 SWIGTYPE_p_lldb__SBFrame);
62 PythonObject SWIGBridge::ToSWIGWrapper(lldb::DebuggerSP debugger_sp) {
63 return ToSWIGHelper(new lldb::SBDebugger(std::move(debugger_sp)),
64 SWIGTYPE_p_lldb__SBDebugger);
67 PythonObject SWIGBridge::ToSWIGWrapper(lldb::WatchpointSP watchpoint_sp) {
68 return ToSWIGHelper(new lldb::SBWatchpoint(std::move(watchpoint_sp)),
69 SWIGTYPE_p_lldb__SBWatchpoint);
72 PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointLocationSP bp_loc_sp) {
73 return ToSWIGHelper(new lldb::SBBreakpointLocation(std::move(bp_loc_sp)),
74 SWIGTYPE_p_lldb__SBBreakpointLocation);
77 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ExecutionContextRefSP ctx_sp) {
78 return ToSWIGHelper(new lldb::SBExecutionContext(std::move(ctx_sp)),
79 SWIGTYPE_p_lldb__SBExecutionContext);
82 PythonObject SWIGBridge::ToSWIGWrapper(lldb::TypeImplSP type_impl_sp) {
83 return ToSWIGHelper(new lldb::SBType(type_impl_sp), SWIGTYPE_p_lldb__SBType);
86 PythonObject SWIGBridge::ToSWIGWrapper(const TypeSummaryOptions &summary_options) {
87 return ToSWIGHelper(new lldb::SBTypeSummaryOptions(summary_options),
88 SWIGTYPE_p_lldb__SBTypeSummaryOptions);
91 PythonObject SWIGBridge::ToSWIGWrapper(const SymbolContext &sym_ctx) {
92 return ToSWIGHelper(new lldb::SBSymbolContext(sym_ctx),
93 SWIGTYPE_p_lldb__SBSymbolContext);
96 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessLaunchInfoSP launch_info_sp) {
97 return ToSWIGHelper(new lldb::ProcessLaunchInfoSP(std::move(launch_info_sp)),
98 SWIGTYPE_p_lldb__SBLaunchInfo);
101 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessAttachInfoSP attach_info_sp) {
102 return ToSWIGHelper(new lldb::ProcessAttachInfoSP(std::move(attach_info_sp)),
103 SWIGTYPE_p_lldb__SBAttachInfo);
106 PythonObject SWIGBridge::ToSWIGWrapper(lldb::DataExtractorSP data_sp) {
107 return ToSWIGHelper(new lldb::DataExtractorSP(std::move(data_sp)),
108 SWIGTYPE_p_lldb__SBData);
111 ScopedPythonObject<lldb::SBCommandReturnObject>
112 SWIGBridge::ToSWIGWrapper(CommandReturnObject &cmd_retobj) {
113 return ScopedPythonObject<lldb::SBCommandReturnObject>(
114 new lldb::SBCommandReturnObject(cmd_retobj),
115 SWIGTYPE_p_lldb__SBCommandReturnObject);
118 ScopedPythonObject<lldb::SBEvent> SWIGBridge::ToSWIGWrapper(Event *event) {
119 return ScopedPythonObject<lldb::SBEvent>(new lldb::SBEvent(event),
120 SWIGTYPE_p_lldb__SBEvent);
123 PythonObject SWIGBridge::ToSWIGWrapper(
124 std::unique_ptr<lldb::SBFileSpec> file_spec_sb) {
125 return ToSWIGHelper(file_spec_sb.release(), SWIGTYPE_p_lldb__SBFileSpec);
128 PythonObject SWIGBridge::ToSWIGWrapper(
129 std::unique_ptr<lldb::SBModuleSpec> module_spec_sb) {
130 return ToSWIGHelper(module_spec_sb.release(), SWIGTYPE_p_lldb__SBModuleSpec);
133 } // namespace python
134 } // namespace lldb_private