aboutsummaryrefslogtreecommitdiff
path: root/gdb/utils.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/utils.c')
-rw-r--r--gdb/utils.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gdb/utils.c b/gdb/utils.c
index 1f5f4f4..1ab183c 100644
--- a/gdb/utils.c
+++ b/gdb/utils.c
@@ -1112,6 +1112,23 @@ gdb_print_host_address (const void *addr, struct ui_file *stream)
{
fprintf_filtered (stream, "%s", host_address_to_string (addr));
}
+
+/* See utils.h. */
+
+char *
+make_hex_string (const gdb_byte *data, size_t length)
+{
+ char *result = xmalloc (length * 2 + 1);
+ char *p;
+ size_t i;
+
+ p = result;
+ for (i = 0; i < length; ++i)
+ p += sprintf (p, "%02x", data[i]);
+ *p = '\0';
+ return result;
+}
+
/* A cleanup function that calls regfree. */