Skip to content

Commit 36254f1

Browse files
committed
[lldb] Revert ScriptedProcess patches
This patch reverts the following commits: - 5a9c349 - 4679676 - 2cff3de - 182f0d1 - d62a53a Signed-off-by: Med Ismail Bennani <[email protected]>
1 parent a9e68db commit 36254f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

41 files changed

+51
-1521
lines changed

lldb/bindings/interface/SBLaunchInfo.i

-10
Original file line numberDiff line numberDiff line change
@@ -135,16 +135,6 @@ public:
135135

136136
void
137137
SetDetachOnError(bool enable);
138-
139-
const char *
140-
GetScriptedProcessClassName() const;
141-
142-
void SetScriptedProcessClassName(const char *class_name);
143-
144-
lldb::SBStructuredData
145-
GetScriptedProcessDictionary() const;
146-
147-
void SetScriptedProcessDictionary(lldb::SBStructuredData dict);
148138
};
149139

150140
} // namespace lldb

lldb/bindings/python/CMakeLists.txt

-14
Original file line numberDiff line numberDiff line change
@@ -104,20 +104,6 @@ function(finish_swig_python swig_target lldb_python_bindings_dir lldb_python_tar
104104
FILES "${LLDB_SOURCE_DIR}/examples/python/in_call_stack.py"
105105
"${LLDB_SOURCE_DIR}/examples/python/symbolication.py")
106106

107-
create_python_package(
108-
${swig_target}
109-
${lldb_python_target_dir}
110-
"plugins"
111-
FILES
112-
"${LLDB_SOURCE_DIR}/examples/python/scripted_process/scripted_process.py")
113-
114-
create_python_package(
115-
${swig_target}
116-
${lldb_python_target_dir}
117-
"plugins"
118-
FILES
119-
"${LLDB_SOURCE_DIR}/examples/python/scripted_process/scripted_process.py")
120-
121107
if(APPLE)
122108
create_python_package(
123109
${swig_target}

lldb/bindings/python/python-wrapper.swig

-100
Original file line numberDiff line numberDiff line change
@@ -258,72 +258,6 @@ LLDBSwigPythonCreateCommandObject
258258
Py_RETURN_NONE;
259259
}
260260

261-
SWIGEXPORT void*
262-
LLDBSwigPythonCreateScriptedProcess
263-
(
264-
const char *python_class_name,
265-
const char *session_dictionary_name,
266-
const lldb::TargetSP& target_sp,
267-
lldb_private::StructuredDataImpl *args_impl,
268-
std::string &error_string
269-
)
270-
{
271-
if (python_class_name == NULL || python_class_name[0] == '\0' || !session_dictionary_name)
272-
Py_RETURN_NONE;
273-
274-
275-
PyErr_Cleaner py_err_cleaner(true);
276-
277-
auto dict = PythonModule::MainModule().ResolveName<PythonDictionary>(session_dictionary_name);
278-
auto pfunc = PythonObject::ResolveNameWithDictionary<PythonCallable>(python_class_name, dict);
279-
280-
if (!pfunc.IsAllocated()) {
281-
error_string.append("could not find script class: ");
282-
error_string.append(python_class_name);
283-
return nullptr;
284-
}
285-
286-
// I do not want the SBTarget to be deallocated when going out of scope
287-
// because python has ownership of it and will manage memory for this
288-
// object by itself
289-
PythonObject target_arg(PyRefType::Owned, SBTypeToSWIGWrapper(new lldb::SBTarget(target_sp)));
290-
291-
if (!target_arg.IsAllocated())
292-
Py_RETURN_NONE;
293-
294-
llvm::Expected<PythonCallable::ArgInfo> arg_info = pfunc.GetArgInfo();
295-
if (!arg_info) {
296-
llvm::handleAllErrors(
297-
arg_info.takeError(),
298-
[&](PythonException &E) {
299-
error_string.append(E.ReadBacktrace());
300-
},
301-
[&](const llvm::ErrorInfoBase &E) {
302-
error_string.append(E.message());
303-
});
304-
Py_RETURN_NONE;
305-
}
306-
307-
PythonObject result = {};
308-
if (arg_info.get().max_positional_args == 2) {
309-
if (args_impl != nullptr) {
310-
error_string.assign("args passed, but __init__ does not take an args dictionary");
311-
Py_RETURN_NONE;
312-
}
313-
result = pfunc(target_arg, dict);
314-
} else if (arg_info.get().max_positional_args >= 3) {
315-
PythonObject args_arg(PyRefType::Owned, SBTypeToSWIGWrapper(new lldb::SBStructuredData(args_impl)));
316-
result = pfunc(target_arg, args_arg, dict);
317-
} else {
318-
error_string.assign("wrong number of arguments in __init__, should be 2 or 3 (not including self)");
319-
Py_RETURN_NONE;
320-
}
321-
322-
if (result.IsAllocated())
323-
return result.release();
324-
Py_RETURN_NONE;
325-
}
326-
327261
SWIGEXPORT void*
328262
LLDBSwigPythonCreateScriptedThreadPlan
329263
(
@@ -851,40 +785,6 @@ LLDBSwigPython_GetValueSynthProviderInstance
851785
return ret_val;
852786
}
853787

854-
SWIGEXPORT void*
855-
LLDBSWIGPython_CastPyObjectToSBData
856-
(
857-
PyObject* data
858-
)
859-
{
860-
lldb::SBData* sb_ptr = nullptr;
861-
862-
int valid_cast = SWIG_ConvertPtr(data, (void**)&sb_ptr, SWIGTYPE_p_lldb__SBData, 0);
863-
864-
if (valid_cast == -1)
865-
return NULL;
866-
867-
return sb_ptr;
868-
}
869-
870-
871-
SWIGEXPORT void*
872-
LLDBSWIGPython_CastPyObjectToSBError
873-
(
874-
PyObject* data
875-
)
876-
{
877-
lldb::SBError* sb_ptr = nullptr;
878-
879-
int valid_cast = SWIG_ConvertPtr(data, (void**)&sb_ptr, SWIGTYPE_p_lldb__SBError, 0);
880-
881-
if (valid_cast == -1)
882-
return NULL;
883-
884-
return sb_ptr;
885-
}
886-
887-
888788
SWIGEXPORT void*
889789
LLDBSWIGPython_CastPyObjectToSBValue
890790
(

lldb/examples/python/scripted_process/my_scripted_process.py

-42
This file was deleted.

lldb/examples/python/scripted_process/scripted_process.py

-147
This file was deleted.

lldb/include/lldb/API/SBData.h

-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
#include "lldb/API/SBDefines.h"
1313

14-
namespace lldb_private {
15-
class ScriptInterpreter;
16-
} // namespace lldb_private
17-
1814
namespace lldb {
1915

2016
class LLDB_API SBData {
@@ -151,8 +147,6 @@ class LLDB_API SBData {
151147
friend class SBTarget;
152148
friend class SBValue;
153149

154-
friend class lldb_private::ScriptInterpreter;
155-
156150
lldb::DataExtractorSP m_opaque_sp;
157151
};
158152

lldb/include/lldb/API/SBError.h

-6
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,6 @@
1111

1212
#include "lldb/API/SBDefines.h"
1313

14-
namespace lldb_private {
15-
class ScriptInterpreter;
16-
} // namespace lldb_private
17-
1814
namespace lldb {
1915

2016
class LLDB_API SBError {
@@ -76,8 +72,6 @@ class LLDB_API SBError {
7672
friend class SBWatchpoint;
7773
friend class SBFile;
7874

79-
friend class lldb_private::ScriptInterpreter;
80-
8175
lldb_private::Status *get();
8276

8377
lldb_private::Status *operator->();

lldb/include/lldb/API/SBLaunchInfo.h

-8
Original file line numberDiff line numberDiff line change
@@ -171,14 +171,6 @@ class LLDB_API SBLaunchInfo {
171171

172172
void SetDetachOnError(bool enable);
173173

174-
const char *GetScriptedProcessClassName() const;
175-
176-
void SetScriptedProcessClassName(const char *class_name);
177-
178-
lldb::SBStructuredData GetScriptedProcessDictionary() const;
179-
180-
void SetScriptedProcessDictionary(lldb::SBStructuredData dict);
181-
182174
protected:
183175
friend class SBPlatform;
184176
friend class SBTarget;

0 commit comments

Comments
 (0)