diff options
author | Luis Machado <luis.machado@linaro.org> | 2020-06-15 15:50:55 -0300 |
---|---|---|
committer | Luis Machado <luis.machado@linaro.org> | 2020-06-25 13:23:39 -0300 |
commit | 4167e8660e929fc8d20e3ec578713ecff6a9d1ec (patch) | |
tree | 21af8130391904ccc8649d2d1ba33f5a9a21d849 /mkdep | |
parent | 8c6f8df50be59bfe8d84648854d0ccefb4f3419f (diff) | |
download | gdb-4167e8660e929fc8d20e3ec578713ecff6a9d1ec.zip gdb-4167e8660e929fc8d20e3ec578713ecff6a9d1ec.tar.gz gdb-4167e8660e929fc8d20e3ec578713ecff6a9d1ec.tar.bz2 |
Extend "x" and "print" commands to support memory tagging
Extend the "x" and "print" commands to make use of memory tagging
functionality, if supported by the architecture.
The "print" command will point out any possible tag mismatches it finds
when dealing with pointers, in case such a pointer is tagged. No additional
modifiers are needed.
Suppose we have a pointer "p" with value 0x1234 (logical tag 0x0) and that we
have an allocation tag of 0x1 for that particular area of memory. This is the
expected output:
(gdb) p/x p
Logical tag (0x0) does not match the allocation tag (0x1).
$1 = 0x1234
The "x" command has a new 'm' modifier that will enable displaying of
allocation tags alongside the data dump. It will display one allocation
tag per line.
AArch64 has a tag granule of 16 bytes, which means we can have one tag for
every 16 bytes of memory. In this case, this is what the "x" command will
display with the new 'm' modifier:
(gdb) x/32bxm p
<Allocation Tag 0x1 for range [0x1230,0x1240)>
0x1234: 0x01 0x02 0x00 0x00 0x00 0x00 0x00 0x00
0x123c: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
<Allocation Tag 0x1 for range [0x1240,0x1250)>
0x1244: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
0x124c: 0x00 0x00 0x00 0x00 0x00 0x00 0x00 0x00
(gdb) x/4gxm a
<Allocation Tag 0x1 for range [0x1230,0x1240)>
0x1234: 0x0000000000000201 0x0000000000000000
<Allocation Tag 0x1 for range [0x1240,0x1250)>
0x1244: 0x0000000000000000 0x0000000000000000
gdb/ChangeLog:
YYYY-MM-DD Luis Machado <luis.machado@linaro.org>
* printcmd.c (decode_format): Handle the 'm' modifier.
(do_examine): Display allocation tags when required/supported.
(should_validate_memtags): New function.
(print_command_1): Display memory tag mismatches.
* valprint.h (struct format_data) <print_tags>: New field.
Diffstat (limited to 'mkdep')
0 files changed, 0 insertions, 0 deletions