This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[RFA 15/20] Use gdbpy_enter in python_interactive_command
- From: Tom Tromey <tom at tromey dot com>
- To: gdb-patches at sourceware dot org
- Cc: Tom Tromey <tom at tromey dot com>
- Date: Thu, 10 Nov 2016 15:19:42 -0700
- Subject: [RFA 15/20] Use gdbpy_enter in python_interactive_command
- Authentication-results: sourceware.org; auth=none
- References: <1478816387-27064-1-git-send-email-tom@tromey.com>
This changes python_interactive_command to use gdbpy_enter.
Previously this function was leaving a dangling cleanup -- this is
sort of ok in a command function, but IMO it's still better to clean
up.
2016-11-10 Tom Tromey <tom@tromey.com>
* python/python.c (python_interactive_command): Use gdbpy_enter.
---
gdb/ChangeLog | 4 ++++
gdb/python/python.c | 2 +-
2 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 14ecd00..1a415fb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2016-11-10 Tom Tromey <tom@tromey.com>
+ * python/python.c (python_interactive_command): Use gdbpy_enter.
+
+2016-11-10 Tom Tromey <tom@tromey.com>
+
* python/python.c (gdbpy_before_prompt_hook): Use gdbpy_enter,
gdbpy_reference.
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 393937d..471f9e2 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -321,7 +321,7 @@ python_interactive_command (char *arg, int from_tty)
arg = skip_spaces (arg);
- ensure_python_env (get_current_arch (), current_language);
+ gdbpy_enter enter_py (get_current_arch (), current_language);
if (arg && *arg)
{
--
2.7.4