aboutsummaryrefslogtreecommitdiff
path: root/gdb/python/py-breakpoint.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-10-24 16:40:00 -0600
committerTom Tromey <tom@tromey.com>2018-11-04 08:01:01 -0700
commit833d985d1c7f69f953a5c7ddcf2af1d001504961 (patch)
treeccb8011da9e64e6b6201dd079c1e57723215f505 /gdb/python/py-breakpoint.c
parent12dfa12a3cfd4552c0cc4d7b271ab3e9c439589a (diff)
downloadbinutils-833d985d1c7f69f953a5c7ddcf2af1d001504961.zip
binutils-833d985d1c7f69f953a5c7ddcf2af1d001504961.tar.gz
binutils-833d985d1c7f69f953a5c7ddcf2af1d001504961.tar.bz2
Return gdbpy_ref from some Python string functions
This changes python_string_to_unicode, python_string_to_target_python_string, and host_string_to_python_string to return gdbpy_ref. gdb/ChangeLog 2018-11-04 Tom Tromey <tom@tromey.com> * python/python.c (gdbpy_parameter_value): Update. * python/python-internal.h (python_string_to_unicode) (python_string_to_target_python_string) (host_string_to_python_string): Return gdbpy_ref. * python/py-utils.c (python_string_to_unicode) (unicode_to_encoded_python_string) (unicode_to_target_python_string) (python_string_to_target_string) (python_string_to_target_python_string): Return gdbpy_ref. (python_string_to_host_string): Update. (host_string_to_python_string): Return gdbpy_ref. * python/py-symtab.c (stpy_get_filename, stpy_get_producer) (stpy_fullname): Update. * python/py-progspace.c (pspy_get_filename, pspy_solib_name): Update. * python/py-prettyprint.c (print_string_repr): Update. * python/py-objfile.c (objfpy_get_filename, objfpy_get_username) (objfpy_get_build_id): Update. * python/py-breakpoint.c (bppy_get_location) (bppy_get_expression, bppy_get_condition, bppy_get_commands): Update.
Diffstat (limited to 'gdb/python/py-breakpoint.c')
-rw-r--r--gdb/python/py-breakpoint.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/gdb/python/py-breakpoint.c b/gdb/python/py-breakpoint.c
index 94afd50..d144bcf 100644
--- a/gdb/python/py-breakpoint.c
+++ b/gdb/python/py-breakpoint.c
@@ -399,7 +399,7 @@ bppy_get_location (PyObject *self, void *closure)
str = event_location_to_string (location);
if (! str)
str = "";
- return host_string_to_python_string (str);
+ return host_string_to_python_string (str).release ();
}
/* Python function to get the breakpoint expression. */
@@ -421,7 +421,7 @@ bppy_get_expression (PyObject *self, void *closure)
if (! str)
str = "";
- return host_string_to_python_string (str);
+ return host_string_to_python_string (str).release ();
}
/* Python function to get the condition expression of a breakpoint. */
@@ -437,7 +437,7 @@ bppy_get_condition (PyObject *self, void *closure)
if (! str)
Py_RETURN_NONE;
- return host_string_to_python_string (str);
+ return host_string_to_python_string (str).release ();
}
/* Returns 0 on success. Returns -1 on error, with a python exception set.
@@ -512,7 +512,7 @@ bppy_get_commands (PyObject *self, void *closure)
END_CATCH
current_uiout->redirect (NULL);
- return host_string_to_python_string (stb.c_str ());
+ return host_string_to_python_string (stb.c_str ()).release ();
}
/* Set the commands attached to a breakpoint. Returns 0 on success.