]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: aarch64: Remove MTE address checking from memtag_matches_p
authorGustavo Romero <gustavo.romero@linaro.org>
Thu, 18 Apr 2024 20:10:34 +0000 (20:10 +0000)
committerLuis Machado <luis.machado@arm.com>
Fri, 19 Apr 2024 14:29:39 +0000 (15:29 +0100)
commit681ad8174d092fbbc54f5f9b2cf7024a1c990379
treefc6d394be7533f7e55c24cb7c0d14f6d6b5544ec
parentf00fb5e1d1fc058700eac66eb483da2638493b98
gdb: aarch64: Remove MTE address checking from memtag_matches_p

This commit removes aarch64_linux_tagged_address_p from
aarch64_linux_memtag_matches_p. aarch64_linux_tagged_address_p checks if
an address is tagged (MTE) or not.

The check is redundant because aarch64_linux_memtag_matches_p is always
called from the upper layers (i.e. from printcmd.c via gdbarch hook
gdbarch_memtag_matches_p) after either gdbarch_tagged_address_p (that
already points to aarch64_linux_tagged_address_p) has been called or
after should_validate_memtags (that calls gdbarch_tagged_address_p at
the end) has been called, so the address is already checked. Hence:

a) in print_command_1, gdbarch_memtag_matches_p is called only after
should_validate_memtags is called, which checks the address at its end;

b) in memory_tag_check_command, gdbarch_memtag_matches_p is called only
after gdbarch_tagged_address_p is called directly.

Also, because after this change the address checking only happens at the
upper layer it now allows the address checking to be specialized easily
per target, via a target hook.

Signed-off-by: Gustavo Romero <gustavo.romero@linaro.org>
Approved-By: Luis Machado <luis.machado@arm.com>
Tested-By: Luis Machado <luis.machado@arm.com>
gdb/aarch64-linux-tdep.c