aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
authorMatthieu Longo <matthieu.longo@arm.com>2026-01-06 13:12:38 +0000
committerMatthieu Longo <matthieu.longo@arm.com>2026-01-28 09:41:25 +0000
commit264a8a2236e8aa64b333a69e42a55ff8c0844f6e (patch)
treecf460000f0eb1644f7539760603870081fb29a5e /gdb/python/python-internal.h
parentea96771a0188a235645558ae10d6885c91c1ac00 (diff)
downloadbinutils-264a8a2236e8aa64b333a69e42a55ff8c0844f6e.tar.gz
binutils-264a8a2236e8aa64b333a69e42a55ff8c0844f6e.tar.bz2
binutils-264a8a2236e8aa64b333a69e42a55ff8c0844f6e.zip
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 <tom@tromey.com>
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h3
1 files changed, 3 insertions, 0 deletions
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<val_type *, obj_type *> m_objects;
};
+extern int eval_python_command (const char *command, int start_symbol,
+ const char *filename = nullptr);
+
#endif /* GDB_PYTHON_PYTHON_INTERNAL_H */