diff options
author | Andrew Burgess <aburgess@redhat.com> | 2024-05-06 19:54:27 +0100 |
---|---|---|
committer | Andrew Burgess <aburgess@redhat.com> | 2024-05-09 10:09:28 +0100 |
commit | cb1a6b85b84359419e7fcf9069c3ba9d27a856c7 (patch) | |
tree | f62c7dd55dc6e1eb8f04799d8d6cbab44ccb965d /gdb/exec.c | |
parent | e5b12a313fdbbf9b628e920e40feb6613a9d6905 (diff) | |
download | gdb-cb1a6b85b84359419e7fcf9069c3ba9d27a856c7.zip gdb-cb1a6b85b84359419e7fcf9069c3ba9d27a856c7.tar.gz gdb-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.c | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -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; |