From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 4J0UBH7vbl+wOQAAWB0awg (envelope-from ) for ; Sat, 26 Sep 2020 03:36:30 -0400 Received: by simark.ca (Postfix, from userid 112) id 0E6411EF4D; Sat, 26 Sep 2020 03:36:30 -0400 (EDT) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on simark.ca X-Spam-Level: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED, MAILING_LIST_MULTI,T_DKIM_INVALID,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server2.sourceware.org [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 399AB1E599 for ; Sat, 26 Sep 2020 03:36:29 -0400 (EDT) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 01C5F3857023; Sat, 26 Sep 2020 07:36:29 +0000 (GMT) Received: from sender2-op-o12.zoho.com.cn (sender2-op-o12.zoho.com.cn [163.53.93.243]) by sourceware.org (Postfix) with ESMTPS id 28715398540D for ; Sat, 26 Sep 2020 07:36:23 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 28715398540D Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=euphon.net Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=fam@euphon.net ARC-Seal: i=1; a=rsa-sha256; t=1601105775; cv=none; d=zoho.com.cn; s=zohoarc; b=a/NBM6nkI1E+l3lz4oDUGlKAITWlbMmxjZx5S9m2DOUSr/X8GLMvaJh51rwTK3TuQXQ/mQS4Wcgh9DIEGG1fRi6SMTz3Q1U6QleEzeFlLSQHX529A5z4ALNK/+hgGaoeic7mjjPdfgDiy00e4H6J/8R0LI1QqAR7mCjIdVa+AlI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1601105775; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=GmO5ATq9RAdX4tX1r3aFCKJMlNQOvmiSAa8LEOng3yY=; b=ADsVdkZ56gndLUOklv4b8dT4X9Ju2rSCGtMJBlRdRpEU4m6UvfnfubKVACZynW42WI0/pmxuyuLFPuzilif8EJHJYcWTaZB80LhJsu7EjPNbAQ8m+9FtR/EShAyP3rd3v7eP4HMfkae0buUJNZ3dm3Jn3/XaQziIeoT3sxZIftk= ARC-Authentication-Results: i=1; mx.zoho.com.cn; dkim=pass header.i=euphon.net; spf=pass smtp.mailfrom=fam@euphon.net; dmarc=pass header.from= header.from= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; t=1601105775; s=zoho; d=euphon.net; i=fam@euphon.net; h=From:To:Cc:Message-ID:Subject:Date:In-Reply-To:References:MIME-Version:Content-Transfer-Encoding:Content-Type; bh=GmO5ATq9RAdX4tX1r3aFCKJMlNQOvmiSAa8LEOng3yY=; b=V4DvE2iuqzQSNR8tTlfylzZPkdjABbYHQ158TqsjqKYcSIGEjiynFoaPYvipsAUT r8uRpYHi0yuOunhbi9LQSK7QJSZDuTwc+QTNc3sKEm3iQcZBxc0ZKsOEiihNu0hZjSy whRQpb+RbyD04kJiqbJOOmGmkNsGmWGagZ4Xb0Rc= Received: from localhost (ec2-52-56-101-76.eu-west-2.compute.amazonaws.com [52.56.101.76]) by mx.zoho.com.cn with SMTPS id 1601105774348795.1502525836028; Sat, 26 Sep 2020 15:36:14 +0800 (CST) From: fam@euphon.net To: gdb-patches@sourceware.org Message-ID: <20200926073539.981936-4-fam@euphon.net> Subject: [PATCH v6 3/3] disass: Add texinfo doc for the /x modifier Date: Sat, 26 Sep 2020 08:35:39 +0100 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926073539.981936-1-fam@euphon.net> References: <20200926073539.981936-1-fam@euphon.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 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: , Cc: fam@euphon.net, Andreas Schwab , Simon Marchi Errors-To: gdb-patches-bounces@sourceware.org Sender: "Gdb-patches" From: Fam Zheng gdb/doc/ChangeLog: 2020-09-25 Fam Zheng =09* gdb.texinfo (disassemble): Document /x modifier of disass =09command. --- gdb/doc/gdb.texinfo | 38 +++++++++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 9 deletions(-) diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo index 8bff27c940..4dad72a34f 100644 --- a/gdb/doc/gdb.texinfo +++ b/gdb/doc/gdb.texinfo @@ -9514,16 +9514,20 @@ line. @itemx disassemble /m @itemx disassemble /s @itemx disassemble /r -This specialized command dumps a range of memory as machine -instructions. It can also print mixed source+disassembly by specifying -the @code{/m} or @code{/s} modifier and print the raw instructions in hex -as well as in symbolic form by specifying the @code{/r} modifier. -The default memory range is the function surrounding the -program counter of the selected frame. A single argument to this +@itemx disassemble /x +This specialized command dumps a range of memory as machine instructions. +If the address of an instruction resolves to a symbol, such as a function +name, the symbol name and the offset are printed following the instruction +address. The offset is in decimal by default and in hex if @code{/x} is +modifier is used. It can also print mixed source+disassembly by +specifying the @code{/m} or @code{/s} modifier and print the raw +instructions in hex as well as in symbolic form by specifying the +@code{/r} modifier. The default memory range is the function surrounding +the program counter of the selected frame. A single argument to this command is a program counter value; @value{GDBN} dumps the function -surrounding this value. When two arguments are given, they should -be separated by a comma, possibly surrounded by whitespace. The -arguments specify a range of addresses to dump, in one of two forms: +surrounding this value. When two arguments are given, they should be +separated by a comma, possibly surrounded by whitespace. The arguments +specify a range of addresses to dump, in one of two forms: =20 @table @code @item @var{start},@var{end} @@ -9561,6 +9565,22 @@ Dump of assembler code from 0x32c4 to 0x32e4: End of assembler dump. @end smallexample =20 +@code{/x} could be used to show offsets in hex: + +@smallexample +(@value{GDBP}) disas /x 0x32c4, 0x32e4 +Dump of assembler code from 0x32c4 to 0x32e4: + 0x32c4 : addil 0,dp + 0x32c8 : ldw 0x22c(sr0,r1),r26 + 0x32cc : ldil 0x3000,r31 + 0x32d0 : ble 0x3f8(sr4,r31) + 0x32d4 : ldo 0(r31),rp + 0x32d8 : addil -0x800,dp + 0x32dc : ldo 0x588(r1),r26 + 0x32e0 : ldil 0x3000,r31 +End of assembler dump. +@end smallexample + Here is an example showing mixed source+assembly for Intel x86 with @code{/m} or @code{/s}, when the program is stopped just after function prologue in a non-optimized function with no inline code. --=20 2.25.1