GNU Binutils with patches for OS216
修訂 | 62ccae8ff85d2769c3c1103b1f21679cbd6ac505 (tree) |
---|---|
時間 | 2020-06-16 21:58:33 |
作者 | 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.
@@ -9801,6 +9801,10 @@ If you omit @var{expr}, @value{GDBN} displays the last value again (from the | ||
9801 | 9801 | conveniently inspect the same value in an alternative format. |
9802 | 9802 | @end table |
9803 | 9803 | |
9804 | +If the architecture supports memory tagging, the @code{print} command will | |
9805 | +display pointer/memory tag mismatches if what is being printed is a pointer | |
9806 | +or reference type. | |
9807 | + | |
9804 | 9808 | A more low-level way of examining data is with the @code{x} command. |
9805 | 9809 | It examines data in memory at a specified address and prints it in a |
9806 | 9810 | specified format. @xref{Memory, ,Examining Memory}. |
@@ -10568,7 +10572,8 @@ number is specified, memory is examined backward from @var{addr}. | ||
10568 | 10572 | @item @var{f}, the display format |
10569 | 10573 | The display format is one of the formats used by @code{print} |
10570 | 10574 | (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c}, |
10571 | -@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions). | |
10575 | +@samp{f}, @samp{s}), @samp{i} (for machine instructions) and | |
10576 | +@samp{m} (for displaying memory tags). | |
10572 | 10577 | The default is @samp{x} (hexadecimal) initially. The default changes |
10573 | 10578 | each time you use either @code{x} or @code{print}. |
10574 | 10579 |
@@ -10663,6 +10668,20 @@ counter is shown with a @code{=>} marker. For example: | ||
10663 | 10668 | 0x804838c <main+24>: call 0x80482d4 <puts@@plt> |
10664 | 10669 | @end smallexample |
10665 | 10670 | |
10671 | +If the architecture supports memory tagging, the tags can be displayed by | |
10672 | +using @samp{m}. The information will be displayed once per granule size | |
10673 | +(the amount of bytes a particular memory tag covers). For example, AArch64 | |
10674 | +has a granule size of 16 bytes, so it will display a tag every 16 bytes. | |
10675 | + | |
10676 | +Due to the way @value{GDBN} prints information with the @code{x} command (not | |
10677 | +aligned to a particular boundary), the tag information will refer to the | |
10678 | +initial address displayed on a particular line. If a memory tag boundary | |
10679 | +is crossed in the middle of a line displayed by the @code{x} command, it | |
10680 | +will be displayed in the next line. | |
10681 | + | |
10682 | +The @samp{m} format doesn't affect any other specified formats that were | |
10683 | +passed to the @code{x} command. | |
10684 | + | |
10666 | 10685 | @cindex @code{$_}, @code{$__}, and value history |
10667 | 10686 | The addresses and contents printed by the @code{x} command are not saved |
10668 | 10687 | in the value history because there is often too much of them and they |
@@ -10729,8 +10748,17 @@ If the underlying architecture supports memory tagging, like AArch64, | ||
10729 | 10748 | @value{GDBN} can make use of it to validate addresses and pointers against |
10730 | 10749 | memory allocation tags. |
10731 | 10750 | |
10732 | -A command prefix of @code{mtag} gives access to the various memory tagging | |
10733 | -commands. | |
10751 | +The @code{print} and @code{x} commands will display tag information when | |
10752 | +appropriate, and a command prefix of @code{mtag} gives access to the | |
10753 | +various memory tagging commands. | |
10754 | + | |
10755 | +The @code{print} command will automatically attempt to validate the logical | |
10756 | +tag against the allocation tag for pointers and addresses, and will display | |
10757 | +a message in case of failure. | |
10758 | + | |
10759 | +The @code{x} command has a @code{m} modifier. When present, this modifier | |
10760 | +will make the @code{x} command output allocation tag information for a given | |
10761 | +memory region that is being examined. | |
10734 | 10762 | |
10735 | 10763 | The @code{mtag} commands are the following: |
10736 | 10764 |
@@ -24806,7 +24834,7 @@ available for inspection and editing of logical and allocation tags. | ||
24806 | 24834 | |
24807 | 24835 | @value{GDBN} will also output additional information for memory tag |
24808 | 24836 | violations, which come as SIGSEGV signals, so developers can have a clue |
24809 | -about what caused the crash. The logical and allocation tags will be shown | |
24837 | +about what caused the crash. The logical and allocation tags will be shown | |
24810 | 24838 | alongside the fault address, if available. |
24811 | 24839 | |
24812 | 24840 | A new register set is made available through the MTE feature. |