]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: Add qIsAddressTagged packet
authorGustavo Romero <gustavo.romero@linaro.org>
Thu, 18 Apr 2024 20:10:37 +0000 (20:10 +0000)
committerLuis Machado <luis.machado@arm.com>
Fri, 19 Apr 2024 14:29:40 +0000 (15:29 +0100)
commitc040e0b107ca023b434746719d83bc9a3ad94276
tree5623086d933a1de7c3932a282ba12b41270676e8
parent7202f41f5f4393eec37747cc2c46673cfaa74d72
gdb: Add qIsAddressTagged packet

This commit adds a new packet, qIsAddressTagged, allowing GDB remote
targets to use it to query the stub if a given address is tagged.

Currently, the memory tagging address check is done via a read query,
where the contents of /proc/<PID>/smaps is read and the flags are
inspected for memory tagging-related flags that indicate the address is
in a memory tagged region.

This is not ideal, for example, for QEMU stub and other cases, such as
on bare-metal, where there is no notion of an OS file like 'smaps.'
Hence, the introduction of qIsAddressTagged packet allows checking
if an address is tagged in an agnostic way.

The is_address_tagged target hook in remote.c attempts to use the
qIsAddressTagged packet first for checking if an address is tagged and
if the stub does not support such a packet (reply is empty) it falls
back to using the current mechanism that reads the contents of
/proc/<PID>/smaps via vFile requests.

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/remote.c