]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
New target methods for memory tagging support
authorLuis Machado <luis.machado@linaro.org>
Fri, 19 Jun 2020 20:31:23 +0000 (17:31 -0300)
committerLuis Machado <luis.machado@linaro.org>
Thu, 25 Jun 2020 16:23:38 +0000 (13:23 -0300)
commit193b2822035263a2c4bb5118a470fc1d0281eb84
tree7ca789930740e4c1160e529f4f8482c7c5b474e6
parentbb6e55f3ee440c5d03fd47ec32255c20b9f895fe
New target methods for memory tagging support

This patch starts adding some of the generic pieces to accomodate memory
tagging.

We have three new target methods:

- supports_memory_tagging: Checks if the target supports memory tagging. This
  defaults to false for targets that don't support memory tagging.

- fetch_memtags: Fetches the allocation tags associated with a particular
  memory range [address, address + length).

  The default is to return 1 without returning any tags. This should only
  be called if memory tagging is supported.

- store_memtags: Stores a set of allocation tags for a particular memory
  range [address, address + length).

  The default is to return 1, which indicates an error. This should only
  be called if memory tagging is supported.

It also adds a control option for enabling/disabling memory tagging
manually: set memory-tagging on/off.

The default is "on", with GDB making its use conditional to the
architecture supporting memory tagging.

gdb/ChangeLog:

YYYY-MM-DD  Luis Machado  <luis.machado@linaro.org>

* printcmd.c (memtag): New static global.
(show_memtag): New function.
(_initialize_printcmd): Add set/show memory-tagging command.
* remote.c (remote_target) <supports_memory_tagging>: New method
override.
<fetch_memtags>: New method override.
<store_memtags>: New method override.
(remote_target::supports_memory_tagging): New method.
(remote_target::fetch_memtags): New method.
(remote_target::store_memtags): New method.
* target-delegates.c
(dummy_target) <supports_memory_tagging>: New method override.
<fetch_memtags>: New method override.
<store_memtags>: New method override.
(debug_target) <supports_memory_tagging>: New method override.
<fetch_memtags>: New method override.
<store_memtags>: New method override.
(target_ops::supports_memory_tagging): New method.
(target_ops::fetch_memtags): New method.
(target_ops::store_memtags): New method.
(dummy_target::supports_memory_tagging): New method.
(dummy_target::fetch_memtags): New method.
(dummy_target::store_memtags): New method.
(debug_target::supports_memory_tagging): New method.
(debug_target::fetch_memtags): New method.
(debug_target::store_memtags): New method.
* target.h (struct target_ops) <supports_memory_tagging>: New virtual
method.
<fetch_memtags: New virtual method.
<store_memtags>: New virtual method.
(target_supports_memory_tagging): Define.
(target_fetch_memtags): Define.
(target_store_memtags): Define.
gdb/printcmd.c
gdb/remote.c
gdb/target-delegates.c
gdb/target.h