diff options
| author | Jonas Devlieghere <jonas@devlieghere.com> | 2025-08-01 15:27:14 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-08-01 15:27:14 -0700 |
| commit | df392b518b7e187f72c036a611feca75ea8b796b (patch) | |
| tree | 4bd36a431d2119f3a6a099d612bb8a288184e924 /lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | |
| parent | 66e8163f53cacc704aab9d4c81f208727e37d3d0 (diff) | |
| download | llvm-df392b518b7e187f72c036a611feca75ea8b796b.zip llvm-df392b518b7e187f72c036a611feca75ea8b796b.tar.gz llvm-df392b518b7e187f72c036a611feca75ea8b796b.tar.bz2 | |
[lldb] Reimplment PyRun_String using the Python stable C API (#151761)
Reimplement `PyRun_String` using `Py_CompileString` and`
PyEval_EvalCode`, which are part of the stable C API.
Part of #151617
Diffstat (limited to 'lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h')
| -rw-r--r-- | lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h index 88c1bb7..6a5dd43 100644 --- a/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h +++ b/lldb/source/Plugins/ScriptInterpreter/Python/PythonDataObjects.h @@ -194,8 +194,8 @@ template <typename T, char F> struct PassthroughFormat { }; template <> struct PythonFormat<char *> : PassthroughFormat<char *, 's'> {}; -template <> struct PythonFormat<const char *> : - PassthroughFormat<const char *, 's'> {}; +template <> +struct PythonFormat<const char *> : PassthroughFormat<const char *, 's'> {}; template <> struct PythonFormat<char> : PassthroughFormat<char, 'b'> {}; template <> struct PythonFormat<unsigned char> : PassthroughFormat<unsigned char, 'B'> {}; @@ -780,6 +780,9 @@ private: operator=(const StructuredPythonObject &) = delete; }; +PyObject *RunString(const char *str, int start, PyObject *globals, + PyObject *locals); + } // namespace python } // namespace lldb_private |
