GNU Binutils with patches for OS216
修订版 | 8d8848b10477ff0c569ad25fb507d583146a87ca (tree) |
---|---|
时间 | 2020-06-26 01:23:39 |
作者 | Luis Machado <luis.machado@lina...> |
Commiter | Luis Machado |
Document new "x" and "print" memory tagging extensions
Document the changes to the "print" and "x" commands to support memory
tagging.
gdb/doc/ChangeLog:
YYYY-MM-DD Luis Machado <luis.machado@linaro.org>
* gdb.texinfo (Data): Document memory tagging changes to the "print"
command.
(Examining Memory): Document memory tagging changes to the "x"
command.
(Memory Tagging): Update with more information on changes to the "x"
and "print" commands.
@@ -9891,6 +9891,10 @@ If you omit @var{expr}, @value{GDBN} displays the last value again (from the | ||
9891 | 9891 | conveniently inspect the same value in an alternative format. |
9892 | 9892 | @end table |
9893 | 9893 | |
9894 | +If the architecture supports memory tagging, the @code{print} command will | |
9895 | +display pointer/memory tag mismatches if what is being printed is a pointer | |
9896 | +or reference type. | |
9897 | + | |
9894 | 9898 | A more low-level way of examining data is with the @code{x} command. |
9895 | 9899 | It examines data in memory at a specified address and prints it in a |
9896 | 9900 | specified format. @xref{Memory, ,Examining Memory}. |
@@ -10658,7 +10662,8 @@ number is specified, memory is examined backward from @var{addr}. | ||
10658 | 10662 | @item @var{f}, the display format |
10659 | 10663 | The display format is one of the formats used by @code{print} |
10660 | 10664 | (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c}, |
10661 | -@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions). | |
10665 | +@samp{f}, @samp{s}), @samp{i} (for machine instructions) and | |
10666 | +@samp{m} (for displaying memory tags). | |
10662 | 10667 | The default is @samp{x} (hexadecimal) initially. The default changes |
10663 | 10668 | each time you use either @code{x} or @code{print}. |
10664 | 10669 |
@@ -10753,6 +10758,20 @@ counter is shown with a @code{=>} marker. For example: | ||
10753 | 10758 | 0x804838c <main+24>: call 0x80482d4 <puts@@plt> |
10754 | 10759 | @end smallexample |
10755 | 10760 | |
10761 | +If the architecture supports memory tagging, the tags can be displayed by | |
10762 | +using @samp{m}. The information will be displayed once per granule size | |
10763 | +(the amount of bytes a particular memory tag covers). For example, AArch64 | |
10764 | +has a granule size of 16 bytes, so it will display a tag every 16 bytes. | |
10765 | + | |
10766 | +Due to the way @value{GDBN} prints information with the @code{x} command (not | |
10767 | +aligned to a particular boundary), the tag information will refer to the | |
10768 | +initial address displayed on a particular line. If a memory tag boundary | |
10769 | +is crossed in the middle of a line displayed by the @code{x} command, it | |
10770 | +will be displayed in the next line. | |
10771 | + | |
10772 | +The @samp{m} format doesn't affect any other specified formats that were | |
10773 | +passed to the @code{x} command. | |
10774 | + | |
10756 | 10775 | @cindex @code{$_}, @code{$__}, and value history |
10757 | 10776 | The addresses and contents printed by the @code{x} command are not saved |
10758 | 10777 | in the value history because there is often too much of them and they |
@@ -10819,8 +10838,17 @@ If the underlying architecture supports memory tagging, like AArch64, | ||
10819 | 10838 | @value{GDBN} can make use of it to validate addresses and pointers against |
10820 | 10839 | memory allocation tags. |
10821 | 10840 | |
10822 | -A command prefix of @code{mtag} gives access to the various memory tagging | |
10823 | -commands. | |
10841 | +The @code{print} and @code{x} commands will display tag information when | |
10842 | +appropriate, and a command prefix of @code{mtag} gives access to the | |
10843 | +various memory tagging commands. | |
10844 | + | |
10845 | +The @code{print} command will automatically attempt to validate the logical | |
10846 | +tag against the allocation tag for pointers and addresses, and will display | |
10847 | +a message in case of failure. | |
10848 | + | |
10849 | +The @code{x} command has a @code{m} modifier. When present, this modifier | |
10850 | +will make the @code{x} command output allocation tag information for a given | |
10851 | +memory region that is being examined. | |
10824 | 10852 | |
10825 | 10853 | The @code{mtag} commands are the following: |
10826 | 10854 |