aboutsummaryrefslogtreecommitdiff
path: root/gdb/build-id.h
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/build-id.h')
-rw-r--r--gdb/build-id.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/gdb/build-id.h b/gdb/build-id.h
index 15fb609..796e5ac 100644
--- a/gdb/build-id.h
+++ b/gdb/build-id.h
@@ -21,6 +21,7 @@
#define BUILD_ID_H
#include "gdb_bfd.h"
+#include "common/rsp-low.h"
/* Locate NT_GNU_BUILD_ID from ABFD and return its content. */
@@ -47,4 +48,14 @@ extern gdb_bfd_ref_ptr build_id_to_debug_bfd (size_t build_id_len,
extern std::string find_separate_debug_file_by_buildid
(struct objfile *objfile);
+/* Return an hex-string representation of BUILD_ID. */
+
+static inline std::string
+build_id_to_string (const bfd_build_id *build_id)
+{
+ gdb_assert (build_id != NULL);
+
+ return bin2hex (build_id->data, build_id->size);
+}
+
#endif /* BUILD_ID_H */