mirror of
https://github.com/bminor/binutils-gdb.git
synced 2025-12-26 01:07:52 +00:00
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>
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user