aboutsummaryrefslogtreecommitdiff
path: root/gdb/exec.c
diff options
context:
space:
mode:
authorAndrew Burgess <aburgess@redhat.com>2024-05-06 19:54:27 +0100
committerAndrew Burgess <aburgess@redhat.com>2024-05-09 10:09:28 +0100
commitcb1a6b85b84359419e7fcf9069c3ba9d27a856c7 (patch)
treef62c7dd55dc6e1eb8f04799d8d6cbab44ccb965d /gdb/exec.c
parente5b12a313fdbbf9b628e920e40feb6613a9d6905 (diff)
downloadbinutils-cb1a6b85b84359419e7fcf9069c3ba9d27a856c7.zip
binutils-cb1a6b85b84359419e7fcf9069c3ba9d27a856c7.tar.gz
binutils-cb1a6b85b84359419e7fcf9069c3ba9d27a856c7.tar.bz2
gdb: add a new build_id_equal function
Add two versions of a new function build_id_equal which can be used to compare build-ids, then make use of these functions in GDB. It seems better to have a specific function for the task of comparing build-ids rather than having a length check followed by a memcmp call. There should be no user visible changes after this commit. Approved-By: Tom Tromey <tom@tromey.com>
Diffstat (limited to 'gdb/exec.c')
-rw-r--r--gdb/exec.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/exec.c b/gdb/exec.c
index 3d392b1..8891526 100644
--- a/gdb/exec.c
+++ b/gdb/exec.c
@@ -253,10 +253,8 @@ validate_exec_file (int from_tty)
if (target_exec_file_build_id != nullptr)
{
- if (exec_file_build_id->size == target_exec_file_build_id->size
- && memcmp (exec_file_build_id->data,
- target_exec_file_build_id->data,
- exec_file_build_id->size) == 0)
+ if (build_id_equal (exec_file_build_id,
+ target_exec_file_build_id))
{
/* Match. */
return;