aboutsummaryrefslogtreecommitdiff
path: root/gdb/target.h
diff options
context:
space:
mode:
authorGustavo Romero <gustavo.romero@linaro.org>2024-04-18 20:10:36 +0000
committerLuis Machado <luis.machado@arm.com>2024-04-19 15:29:40 +0100
commit7202f41f5f4393eec37747cc2c46673cfaa74d72 (patch)
treef2627b1d2cb4720028d6da75895becc7b9d00084 /gdb/target.h
parenta0e28bb1515572fca428b452a523f882eea16797 (diff)
downloadgdb-7202f41f5f4393eec37747cc2c46673cfaa74d72.zip
gdb-7202f41f5f4393eec37747cc2c46673cfaa74d72.tar.gz
gdb-7202f41f5f4393eec37747cc2c46673cfaa74d72.tar.bz2
gdb: Introduce is_address_tagged target hook
This commit introduces a new target hook, target_is_address_tagged, which is used instead of the gdbarch_tagged_address_p gdbarch hook in the upper layer (printcmd.c). This change enables easy specialization of memory tagging address check per target in the future. As target_is_address_tagged continues to utilize the gdbarch_tagged_address_p hook, there is no change in behavior for all the targets that use the new target hook (i.e., the remote.c, aarch64-linux-nat.c, and corelow.c targets). Just the gdbarch_tagged_address_p signature is changed for convenience, since target_is_address_tagged takes the address to be checked as a CORE_ADDR type. 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>
Diffstat (limited to 'gdb/target.h')
-rw-r--r--gdb/target.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/gdb/target.h b/gdb/target.h
index c9eaff1..486a0a6 100644
--- a/gdb/target.h
+++ b/gdb/target.h
@@ -1334,6 +1334,10 @@ struct target_ops
const gdb::byte_vector &tags, int type)
TARGET_DEFAULT_NORETURN (tcomplain ());
+ /* Returns true if ADDRESS is tagged, otherwise returns false. */
+ virtual bool is_address_tagged (gdbarch *gdbarch, CORE_ADDR address)
+ TARGET_DEFAULT_NORETURN (tcomplain ());
+
/* Return the x86 XSAVE extended state area layout. */
virtual x86_xsave_layout fetch_x86_xsave_layout ()
TARGET_DEFAULT_RETURN (x86_xsave_layout ());
@@ -2317,6 +2321,8 @@ extern bool target_fetch_memtags (CORE_ADDR address, size_t len,
extern bool target_store_memtags (CORE_ADDR address, size_t len,
const gdb::byte_vector &tags, int type);
+extern bool target_is_address_tagged (gdbarch *gdbarch, CORE_ADDR address);
+
extern x86_xsave_layout target_fetch_x86_xsave_layout ();
/* Command logging facility. */