Re: [PATCH v3 21/24] Extend "x" and "print" commands to support memory tagging

Luis Machado via Gdb-patches
2020-12-29T18:50:26Z

On 12/27/20 1:18 AM, Simon Marchi wrote:
> On 2020-11-09 12:04 p.m., Luis Machado via Gdb-patches wrote:
>> 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
>
> Should there be an option to print to enable/disable this behavior?
> Something like "print -memory-tags-violations <on|off>", and a
> corresponding "set print memory-tags-violations <on|off>"?

The switch that controls this is the one that enables/disables memory
tagging. It controls both the print command behavior and the "x" command
behavior.

Do you think we should have a command for each individual command?

>
> Simon
>