aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/python-internal.h
diff options
context:
space:
mode:
authorSimon Marchi <simon.marchi@ericsson.com>2018-09-09 08:13:17 +0100
committerSimon Marchi <simon.marchi@ericsson.com>2018-09-09 08:13:17 +0100
commita5c5eda7e412aa7f3cb843cd48b3b4c0101718a0 (patch)
tree74531596833e161980e941f3f355d3f9d0664264 /gdb/python/python-internal.h
parent1aac008f1c2f0a239b7ba26efe9d6b68044cddf8 (diff)
downloadbinutils-a5c5eda7e412aa7f3cb843cd48b3b4c0101718a0.zip
binutils-a5c5eda7e412aa7f3cb843cd48b3b4c0101718a0.tar.gz
binutils-a5c5eda7e412aa7f3cb843cd48b3b4c0101718a0.tar.bz2
python: Make two functions return gdbpy_ref<>
I noticed that we release a gdbpy_ref in pretty_print_one_value only to create it again later. This patch fills the gap by returning a gdbpy_ref all the way. gdb/ChangeLog: * python/py-prettyprint.c (pretty_print_one_value): Return gdbpy_ref<>. (print_string_repr): Adjust. (apply_varobj_pretty_printer): Return gdbpy_ref<>. * python/python-internal.h (apply_varobj_pretty_printer): Return gdbpy_ref<>. * varobj.c (varobj_value_get_print_value): Adjust.
Diffstat (limited to 'gdb/python/python-internal.h')
-rw-r--r--gdb/python/python-internal.h7
1 files changed, 4 insertions, 3 deletions
diff --git a/gdb/python/python-internal.h b/gdb/python/python-internal.h
index c4f0e21..3874fdc 100644
--- a/gdb/python/python-internal.h
+++ b/gdb/python/python-internal.h
@@ -99,6 +99,7 @@
from including our python/python.h header file. */
#include <Python.h>
#include <frameobject.h>
+#include "py-ref.h"
#if PY_MAJOR_VERSION >= 3
#define IS_PY3K 1
@@ -691,9 +692,9 @@ int gdbpy_is_value_object (PyObject *obj);
/* Note that these are declared here, and not in python.h with the
other pretty-printer functions, because they refer to PyObject. */
-PyObject *apply_varobj_pretty_printer (PyObject *print_obj,
- struct value **replacement,
- struct ui_file *stream);
+gdbpy_ref<> apply_varobj_pretty_printer (PyObject *print_obj,
+ struct value **replacement,
+ struct ui_file *stream);
PyObject *gdbpy_get_varobj_pretty_printer (struct value *value);
gdb::unique_xmalloc_ptr<char> gdbpy_get_display_hint (PyObject *printer);
PyObject *gdbpy_default_visualizer (PyObject *self, PyObject *args);