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

Luis Machado luis.machado@linaro.org
Mon Nov 9 17:20:40 GMT 2020


On 11/9/20 2:14 PM, Eli Zaretskii wrote:
>> Date: Mon,  9 Nov 2020 14:04:32 -0300
>> From: Luis Machado via Gdb-patches <gdb-patches@sourceware.org>
>> Cc: david.spickett@linaro.org
>>
>> 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
> 
> If the tags did match, GDB would have also printed the contents of the
> memory pointed to by p, right?  At least with pointer to 'char *'
> strings it would.  Does GDB still print the contents if the tags don't
> match?  If it doesn't, it should say something like "Cannot access
> memory at NNNN: logical tag doesn't match".
> 

Yes. GDB should print the contents just like before. I don't think we 
should prevent the debugger from printing the pointer/contents even if 
there is a tag mismatch.

The tag mismatch part is a warning so users know that something is off 
(and may cause memory faults).


More information about the Gdb-patches mailing list