xref: /freebsd/contrib/llvm-project/lldb/bindings/python/python-swigsafecast.swig (revision 7fdf597e96a02165cfe22ff357b857d5fa15ed8a)
1namespace lldb_private {
2namespace python {
3
4PythonObject ToSWIGHelper(void *obj, swig_type_info *info) {
5  return {PyRefType::Owned, SWIG_NewPointerObj(obj, info, SWIG_POINTER_OWN)};
6}
7
8PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBValue> value_sb) {
9  return ToSWIGHelper(value_sb.release(), SWIGTYPE_p_lldb__SBValue);
10}
11
12PythonObject SWIGBridge::ToSWIGWrapper(lldb::ValueObjectSP value_sp) {
13  return ToSWIGWrapper(std::unique_ptr<lldb::SBValue>(new lldb::SBValue(value_sp)));
14}
15
16PythonObject SWIGBridge::ToSWIGWrapper(lldb::TargetSP target_sp) {
17  return ToSWIGHelper(new lldb::SBTarget(std::move(target_sp)),
18                      SWIGTYPE_p_lldb__SBTarget);
19}
20
21PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessSP process_sp) {
22  return ToSWIGHelper(new lldb::SBProcess(std::move(process_sp)),
23                      SWIGTYPE_p_lldb__SBProcess);
24}
25
26PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadPlanSP thread_plan_sp) {
27  return ToSWIGHelper(new lldb::SBThreadPlan(std::move(thread_plan_sp)),
28                      SWIGTYPE_p_lldb__SBThreadPlan);
29}
30
31PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointSP breakpoint_sp) {
32  return ToSWIGHelper(new lldb::SBBreakpoint(std::move(breakpoint_sp)),
33                      SWIGTYPE_p_lldb__SBBreakpoint);
34}
35
36PythonObject SWIGBridge::ToSWIGWrapper(const Status& status) {
37  return ToSWIGHelper(new lldb::SBError(status), SWIGTYPE_p_lldb__SBError);
38}
39
40PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData> data_sb) {
41  return ToSWIGHelper(data_sb.release(), SWIGTYPE_p_lldb__SBStructuredData);
42}
43
44PythonObject SWIGBridge::ToSWIGWrapper(const StructuredDataImpl &data_impl) {
45  return ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData>(new lldb::SBStructuredData(data_impl)));
46}
47
48PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadSP thread_sp) {
49  return ToSWIGHelper(new lldb::SBThread(std::move(thread_sp)),
50                      SWIGTYPE_p_lldb__SBThread);
51}
52
53PythonObject SWIGBridge::ToSWIGWrapper(lldb::StackFrameSP frame_sp) {
54  return ToSWIGHelper(new lldb::SBFrame(std::move(frame_sp)),
55                      SWIGTYPE_p_lldb__SBFrame);
56}
57
58PythonObject SWIGBridge::ToSWIGWrapper(lldb::DebuggerSP debugger_sp) {
59  return ToSWIGHelper(new lldb::SBDebugger(std::move(debugger_sp)),
60                      SWIGTYPE_p_lldb__SBDebugger);
61}
62
63PythonObject SWIGBridge::ToSWIGWrapper(lldb::WatchpointSP watchpoint_sp) {
64  return ToSWIGHelper(new lldb::SBWatchpoint(std::move(watchpoint_sp)),
65                      SWIGTYPE_p_lldb__SBWatchpoint);
66}
67
68PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointLocationSP bp_loc_sp) {
69  return ToSWIGHelper(new lldb::SBBreakpointLocation(std::move(bp_loc_sp)),
70                      SWIGTYPE_p_lldb__SBBreakpointLocation);
71}
72
73PythonObject SWIGBridge::ToSWIGWrapper(lldb::ExecutionContextRefSP ctx_sp) {
74  return ToSWIGHelper(new lldb::SBExecutionContext(std::move(ctx_sp)),
75                      SWIGTYPE_p_lldb__SBExecutionContext);
76}
77
78PythonObject SWIGBridge::ToSWIGWrapper(lldb::TypeImplSP type_impl_sp) {
79  return ToSWIGHelper(new lldb::SBType(type_impl_sp), SWIGTYPE_p_lldb__SBType);
80}
81
82PythonObject SWIGBridge::ToSWIGWrapper(const TypeSummaryOptions &summary_options) {
83  return ToSWIGHelper(new lldb::SBTypeSummaryOptions(summary_options),
84                      SWIGTYPE_p_lldb__SBTypeSummaryOptions);
85}
86
87PythonObject SWIGBridge::ToSWIGWrapper(const SymbolContext &sym_ctx) {
88  return ToSWIGHelper(new lldb::SBSymbolContext(sym_ctx),
89                      SWIGTYPE_p_lldb__SBSymbolContext);
90}
91
92PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessLaunchInfoSP launch_info_sp) {
93   return ToSWIGHelper(new lldb::ProcessLaunchInfoSP(std::move(launch_info_sp)),
94                       SWIGTYPE_p_lldb__SBLaunchInfo);
95 }
96
97 PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessAttachInfoSP attach_info_sp) {
98   return ToSWIGHelper(new lldb::ProcessAttachInfoSP(std::move(attach_info_sp)),
99                       SWIGTYPE_p_lldb__SBAttachInfo);
100 }
101
102PythonObject SWIGBridge::ToSWIGWrapper(lldb::DataExtractorSP data_sp) {
103  return ToSWIGHelper(new lldb::DataExtractorSP(std::move(data_sp)),
104                      SWIGTYPE_p_lldb__SBData);
105}
106
107ScopedPythonObject<lldb::SBCommandReturnObject>
108SWIGBridge::ToSWIGWrapper(CommandReturnObject &cmd_retobj) {
109  return ScopedPythonObject<lldb::SBCommandReturnObject>(
110      new lldb::SBCommandReturnObject(cmd_retobj),
111      SWIGTYPE_p_lldb__SBCommandReturnObject);
112}
113
114PythonObject SWIGBridge::ToSWIGWrapper(const Stream *s) {
115  return ToSWIGHelper(new lldb::SBStream(), SWIGTYPE_p_lldb__SBStream);
116}
117
118PythonObject SWIGBridge::ToSWIGWrapper(std::shared_ptr<lldb::SBStream> stream_sb) {
119  return ToSWIGHelper(stream_sb.get(), SWIGTYPE_p_lldb__SBStream);
120}
121
122PythonObject SWIGBridge::ToSWIGWrapper(Event *event) {
123  return ToSWIGHelper(new lldb::SBEvent(event), SWIGTYPE_p_lldb__SBEvent);
124}
125
126PythonObject SWIGBridge::ToSWIGWrapper(
127    std::unique_ptr<lldb::SBFileSpec> file_spec_sb) {
128  return ToSWIGHelper(file_spec_sb.release(), SWIGTYPE_p_lldb__SBFileSpec);
129}
130
131PythonObject SWIGBridge::ToSWIGWrapper(
132    std::unique_ptr<lldb::SBModuleSpec> module_spec_sb) {
133  return ToSWIGHelper(module_spec_sb.release(), SWIGTYPE_p_lldb__SBModuleSpec);
134}
135
136} // namespace python
137} // namespace lldb_private
138