From 858f25f0dd3c7013e4c87b95fa8edac223d26156 Mon Sep 17 00:00:00 2001 From: Tom Tromey Date: Tue, 24 Sep 2019 17:36:07 -0600 Subject: Remove make_hex_string I noticed that make_hex_string does essentially the same thing as bin2hex, and furthermore is only called in a single spot. This patch removes make_hex_string. Tested by the builtbot. gdb/ChangeLog 2019-09-25 Tom Tromey * python/py-objfile.c (objfpy_get_build_id): Use bin2hex. * utils.h (make_hex_string): Don't declare. * utils.c (make_hex_string): Remove. --- gdb/python/py-objfile.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'gdb/python/py-objfile.c') diff --git a/gdb/python/py-objfile.c b/gdb/python/py-objfile.c index 2c54845..517ed56 100644 --- a/gdb/python/py-objfile.c +++ b/gdb/python/py-objfile.c @@ -141,10 +141,9 @@ objfpy_get_build_id (PyObject *self, void *closure) if (build_id != NULL) { - gdb::unique_xmalloc_ptr hex_form - (make_hex_string (build_id->data, build_id->size)); + std::string hex_form = bin2hex (build_id->data, build_id->size); - return host_string_to_python_string (hex_form.get ()).release (); + return host_string_to_python_string (hex_form.c_str ()).release (); } Py_RETURN_NONE; -- cgit v1.1