xref: /freebsd/contrib/llvm-project/lldb/bindings/python/python-swigsafecast.swig (revision f126890ac5386406dadf7c4cfa9566cbb56537c5)
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::SBStream> stream_sb) {
41  return ToSWIGHelper(stream_sb.release(), SWIGTYPE_p_lldb__SBStream);
42}
43
44PythonObject SWIGBridge::ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData> data_sb) {
45  return ToSWIGHelper(data_sb.release(), SWIGTYPE_p_lldb__SBStructuredData);
46}
47
48PythonObject SWIGBridge::ToSWIGWrapper(const StructuredDataImpl &data_impl) {
49  return ToSWIGWrapper(std::unique_ptr<lldb::SBStructuredData>(new lldb::SBStructuredData(data_impl)));
50}
51
52PythonObject SWIGBridge::ToSWIGWrapper(lldb::ThreadSP thread_sp) {
53  return ToSWIGHelper(new lldb::SBThread(std::move(thread_sp)),
54                      SWIGTYPE_p_lldb__SBThread);
55}
56
57PythonObject SWIGBridge::ToSWIGWrapper(lldb::StackFrameSP frame_sp) {
58  return ToSWIGHelper(new lldb::SBFrame(std::move(frame_sp)),
59                      SWIGTYPE_p_lldb__SBFrame);
60}
61
62PythonObject SWIGBridge::ToSWIGWrapper(lldb::DebuggerSP debugger_sp) {
63  return ToSWIGHelper(new lldb::SBDebugger(std::move(debugger_sp)),
64                      SWIGTYPE_p_lldb__SBDebugger);
65}
66
67PythonObject SWIGBridge::ToSWIGWrapper(lldb::WatchpointSP watchpoint_sp) {
68  return ToSWIGHelper(new lldb::SBWatchpoint(std::move(watchpoint_sp)),
69                      SWIGTYPE_p_lldb__SBWatchpoint);
70}
71
72PythonObject SWIGBridge::ToSWIGWrapper(lldb::BreakpointLocationSP bp_loc_sp) {
73  return ToSWIGHelper(new lldb::SBBreakpointLocation(std::move(bp_loc_sp)),
74                      SWIGTYPE_p_lldb__SBBreakpointLocation);
75}
76
77PythonObject SWIGBridge::ToSWIGWrapper(lldb::ExecutionContextRefSP ctx_sp) {
78  return ToSWIGHelper(new lldb::SBExecutionContext(std::move(ctx_sp)),
79                      SWIGTYPE_p_lldb__SBExecutionContext);
80}
81
82PythonObject SWIGBridge::ToSWIGWrapper(lldb::TypeImplSP type_impl_sp) {
83  return ToSWIGHelper(new lldb::SBType(type_impl_sp), SWIGTYPE_p_lldb__SBType);
84}
85
86PythonObject SWIGBridge::ToSWIGWrapper(const TypeSummaryOptions &summary_options) {
87  return ToSWIGHelper(new lldb::SBTypeSummaryOptions(summary_options),
88                      SWIGTYPE_p_lldb__SBTypeSummaryOptions);
89}
90
91PythonObject SWIGBridge::ToSWIGWrapper(const SymbolContext &sym_ctx) {
92  return ToSWIGHelper(new lldb::SBSymbolContext(sym_ctx),
93                      SWIGTYPE_p_lldb__SBSymbolContext);
94}
95
96PythonObject SWIGBridge::ToSWIGWrapper(lldb::ProcessLaunchInfoSP launch_info_sp) {
97   return ToSWIGHelper(new lldb::ProcessLaunchInfoSP(std::move(launch_info_sp)),
98                       SWIGTYPE_p_lldb__SBLaunchInfo);
99 }
100
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);
104 }
105
106PythonObject SWIGBridge::ToSWIGWrapper(lldb::DataExtractorSP data_sp) {
107  return ToSWIGHelper(new lldb::DataExtractorSP(std::move(data_sp)),
108                      SWIGTYPE_p_lldb__SBData);
109}
110
111ScopedPythonObject<lldb::SBCommandReturnObject>
112SWIGBridge::ToSWIGWrapper(CommandReturnObject &cmd_retobj) {
113  return ScopedPythonObject<lldb::SBCommandReturnObject>(
114      new lldb::SBCommandReturnObject(cmd_retobj),
115      SWIGTYPE_p_lldb__SBCommandReturnObject);
116}
117
118ScopedPythonObject<lldb::SBEvent> SWIGBridge::ToSWIGWrapper(Event *event) {
119  return ScopedPythonObject<lldb::SBEvent>(new lldb::SBEvent(event),
120                                           SWIGTYPE_p_lldb__SBEvent);
121}
122
123PythonObject SWIGBridge::ToSWIGWrapper(
124    std::unique_ptr<lldb::SBFileSpec> file_spec_sb) {
125  return ToSWIGHelper(file_spec_sb.release(), SWIGTYPE_p_lldb__SBFileSpec);
126}
127
128PythonObject SWIGBridge::ToSWIGWrapper(
129    std::unique_ptr<lldb::SBModuleSpec> module_spec_sb) {
130  return ToSWIGHelper(module_spec_sb.release(), SWIGTYPE_p_lldb__SBModuleSpec);
131}
132
133} // namespace python
134} // namespace lldb_private
135