From 264a8a2236e8aa64b333a69e42a55ff8c0844f6e Mon Sep 17 00:00:00 2001 From: Matthieu Longo Date: Tue, 6 Jan 2026 13:12:38 +0000 Subject: Python limited API: migrate Py_CompileStringExFlags and PyRun_SimpleString This patch replaces Py_CompileStringExFlags () with its limited C API equivalent, Py_CompileString (). The eval_python_command () helper is now exposed through the private GDB Python API as a utility function. PyRun_SimpleString () is replaced with eval_python_command () to avoid code duplication. Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=23830 Approved-By: Tom Tromey --- gdb/python/python-internal.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'gdb/python/python-internal.h') diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h index 85c76779a49..65d2eee38ed 100644 --- a/gdb/python/python-internal.h +++ b/gdb/python/python-internal.h @@ -1319,4 +1319,7 @@ protected: gdb::unordered_map m_objects; }; +extern int eval_python_command (const char *command, int start_symbol, + const char *filename = nullptr); + #endif /* GDB_PYTHON_PYTHON_INTERNAL_H */ -- cgit v1.2.3