From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id KJprGGWf7F8ACwAAWB0awg (envelope-from ) for ; Wed, 30 Dec 2020 10:40:21 -0500 Received: by simark.ca (Postfix, from userid 112) id 4D0181F0BC; Wed, 30 Dec 2020 10:40:18 -0500 (EST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,MAILING_LIST_MULTI,RDNS_NONE,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.2 Received: from sourceware.org (unknown [8.43.85.97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by simark.ca (Postfix) with ESMTPS id 4C12A1F0B8 for ; Wed, 30 Dec 2020 10:40:14 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id F0F61388E821; Wed, 30 Dec 2020 15:40:13 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org F0F61388E821 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1609342814; bh=E8/W4Wj+JXbe97JxA68G8Fa+G8NAzpkx65hsouUvPuM=; h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=r1d8ziGVkKOM6ZvELhs7xnORZh0mxuq75NguQO/2PyKBhMluJVLg4Yh+UMULn+tXJ 3KEQ/VwJo5BSs/DGVoMEYpYLrK2aM9Z4h6lgh5RY6hjAbY+5sGvCZRFoMseYLw3sUC mRBWTacfdSJ4Jtw6nV2+m9va6eohwC3CItVAd/Ic= Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by sourceware.org (Postfix) with ESMTPS id 31477388E80E for ; Wed, 30 Dec 2020 15:40:11 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 31477388E80E Received: by mail-qv1-xf2c.google.com with SMTP id l7so7842041qvt.4 for ; Wed, 30 Dec 2020 07:40:11 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=E8/W4Wj+JXbe97JxA68G8Fa+G8NAzpkx65hsouUvPuM=; b=Om3w1qS085fdwzOIXpG38fW9H4JhDHWLeMTVSHdvEQf5v1pb6Py2K5lAVBoBpOmiEQ QpFQ1mDZ0PUOLfDZDOmuuq9PCgOwuDUuSwnkDTcB1NzQAi6/C02uPXZX28Q9fBFgJeEx br5pazP7ebI653kV17c9bCy99f47dG70+zh3pfpKseSHAnePO7GIXG6QkMvA+E1L7XyN 1IN47//4tBTnF9EdHQ/aW64sBBcocVXfGb71FKcsorC8n4OetlVwiZ7eICHWgGIZXFD9 rDShmmVRoUhv8D119y4bv2LNwhdErRaoV4E4mOsceqICghvIL5mBvHgbeQtSggpMqCs9 oKjw== X-Gm-Message-State: AOAM531qNck94lQ1ctvZDqobkxWLdcEEI1jDx2Z0S7DaimaxjRUGoxes hu31tzpih82OiTuNAb4QZ1e/2oeGN0IRLg== X-Google-Smtp-Source: ABdhPJxXcWhllHHG52OERapzK2dKt2ehimZvehqocZFNGNl2ityH6z43DH67uOgK+SiwK0+yEn3OQg== X-Received: by 2002:a0c:b4a8:: with SMTP id c40mr57333450qve.60.1609342810588; Wed, 30 Dec 2020 07:40:10 -0800 (PST) Received: from localhost.localdomain ([2804:7f0:8284:370e:c9ba:c4ec:737b:57da]) by smtp.gmail.com with ESMTPSA id f6sm28589336qkh.2.2020.12.30.07.40.08 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Dec 2020 07:40:10 -0800 (PST) To: gdb-patches@sourceware.org Subject: [PATCH v4 23/25] Document new "x" and "print" memory tagging extensions Date: Wed, 30 Dec 2020 12:39:14 -0300 Message-Id: <20201230153916.1586725-24-luis.machado@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201230153916.1586725-1-luis.machado@linaro.org> References: <20201230153916.1586725-1-luis.machado@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: gdb-patches@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Luis Machado via Gdb-patches Reply-To: Luis Machado Cc: david.spickett@linaro.org Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" Document the changes to the "print" and "x" commands to support memory tagging. gdb/doc/ChangeLog: YYYY-MM-DD Luis Machado * 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. --- gdb/doc/gdb.texinfo | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index d5cfc1c40c..44d10ace46 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -10019,6 +10019,10 @@ If you omit @var{expr}, @value{GDBN} displays the last value again (from the conveniently inspect the same value in an alternative format. @end table +If the architecture supports memory tagging, the @code{print} command will +display pointer/memory tag mismatches if what is being printed is a pointer +or reference type. @xref{Memory Tagging}. + A more low-level way of examining data is with the @code{x} command. It examines data in memory at a specified address and prints it in a specified format. @xref{Memory, ,Examining Memory}. @@ -10786,7 +10790,8 @@ number is specified, memory is examined backward from @var{addr}. @item @var{f}, the display format The display format is one of the formats used by @code{print} (@samp{x}, @samp{d}, @samp{u}, @samp{o}, @samp{t}, @samp{a}, @samp{c}, -@samp{f}, @samp{s}), and in addition @samp{i} (for machine instructions). +@samp{f}, @samp{s}), @samp{i} (for machine instructions) and +@samp{m} (for displaying memory tags). The default is @samp{x} (hexadecimal) initially. The default changes each time you use either @code{x} or @code{print}. @@ -10881,6 +10886,22 @@ counter is shown with a @code{=>} marker. For example: 0x804838c : call 0x80482d4 @end smallexample +If the architecture supports memory tagging, the tags can be displayed by +using @samp{m}. @xref{Memory Tagging}. + +The information will be displayed once per granule size +(the amount of bytes a particular memory tag covers). For example, AArch64 +has a granule size of 16 bytes, so it will display a tag every 16 bytes. + +Due to the way @value{GDBN} prints information with the @code{x} command (not +aligned to a particular boundary), the tag information will refer to the +initial address displayed on a particular line. If a memory tag boundary +is crossed in the middle of a line displayed by the @code{x} command, it +will be displayed on the next line. + +The @samp{m} format doesn't affect any other specified formats that were +passed to the @code{x} command. + @cindex @code{$_}, @code{$__}, and value history The addresses and contents printed by the @code{x} command are not saved in the value history because there is often too much of them and they @@ -10958,8 +10979,9 @@ If the underlying architecture supports memory tagging, like AArch64 MTE or SPARC ADI do, @value{GDBN} can make use of it to validate addresses and pointers against memory allocation tags. -A command prefix of @code{memory-tag} gives access to the various memory tagging -commands. +The @code{print} (@pxref{Data}) and @code{x} (@pxref{Memory}) commands will +display tag information when appropriate, and a command prefix of +@code{memory-tag} gives access to the various memory tagging commands. The @code{memory-tag} commands are the following: -- 2.25.1