public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
From: Luis Machado <luisgpm@sourceware.org>
To: gdb-cvs@sourceware.org
Subject: [binutils-gdb] gdb: aarch64: Remove MTE address checking from memtag_matches_p
Date: Fri, 19 Apr 2024 14:31:12 +0000 (GMT)	[thread overview]
Message-ID: <20240419143112.A86CD3849ACC@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=681ad8174d092fbbc54f5f9b2cf7024a1c990379

commit 681ad8174d092fbbc54f5f9b2cf7024a1c990379
Author: Gustavo Romero <gustavo.romero@linaro.org>
Date:   Thu Apr 18 20:10:34 2024 +0000

    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>

Diff:
---
 gdb/aarch64-linux-tdep.c | 4 ----
 1 file changed, 4 deletions(-)

diff --git a/gdb/aarch64-linux-tdep.c b/gdb/aarch64-linux-tdep.c
index 8e6e63d4dcb..fc60e602748 100644
--- a/gdb/aarch64-linux-tdep.c
+++ b/gdb/aarch64-linux-tdep.c
@@ -2476,10 +2476,6 @@ aarch64_linux_memtag_matches_p (struct gdbarch *gdbarch,
 {
   gdb_assert (address != nullptr);
 
-  /* Make sure we are dealing with a tagged address to begin with.  */
-  if (!aarch64_linux_tagged_address_p (gdbarch, address))
-    return true;
-
   CORE_ADDR addr = value_as_address (address);
 
   /* Fetch the allocation tag for ADDRESS.  */

                 reply	other threads:[~2024-04-19 14:31 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240419143112.A86CD3849ACC@sourceware.org \
    --to=luisgpm@sourceware.org \
    --cc=gdb-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).