From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: 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 185A2398B450 for ; Sat, 26 Sep 2020 08:51:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 185A2398B450 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=1601110279; cv=none; d=zoho.com.cn; s=zohoarc; b=mua3WJ3VOi4+4qgAp2IDNRWdDFBn43iC5EHbY+VWnhM4PsmDhE5HvtyD8+xapr3NOQkF7qi4suMyQ/sm47HAaYxQaX5sgnSMyeRHASbvrsfOo9HD/4pI/bs6QPihNKPn4lTU3bPJKOcVtHI4OXPW6sfqtxwRyc1fBloYpXGaRfQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com.cn; s=zohoarc; t=1601110279; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:MIME-Version:Message-ID:References:Subject:To; bh=iK5SQDWr9BG6IGHDJPt8BkHTKJf3nA/INaN48zBOjm0=; b=LBdU6E8JDh5TB9+SIp4K+qKXCVSlWZfeq2hEaL6sTs9rVb7RfdBkgLWqTyMYU3USve4Qjx/9jYvV3HYaKxoJ/vjx7kpYnpWbZzWqem95AcxrxAAU0nU/sFOrzCLGzkRSDTwbdFQIL8lL0DUMCpCi348C58U/VX0OcRACCVx/6Bg= 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=1601110279; 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=iK5SQDWr9BG6IGHDJPt8BkHTKJf3nA/INaN48zBOjm0=; b=GdkBk/mrz3U015WxrtjhDtXSmVayBuQQP9ZPtk48K5NyAqQ28SAooZdJSr9BckuZ 0p12xhIJA7HdZlst04NFpjnn4APsfFwLifucoRbkMSCBYJi8tr3oUb+osPL5Y7NEXwe pH+95g6n86Hq5tDGFZjZ+Fmy3fAdpLYUr9o3Bo9Q= 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 1601110277538930.4582009536625; Sat, 26 Sep 2020 16:51:17 +0800 (CST) From: fam@euphon.net To: gdb-patches@sourceware.org Cc: Eli Zaretskii , fam@euphon.net, Andreas Schwab , Pedro Alves , Andrew Burgess , Simon Marchi Message-ID: <20200926085049.982830-4-fam@euphon.net> Subject: [PATCH v7 3/3] disass: Add texinfo doc for the /x modifier Date: Sat, 26 Sep 2020 09:50:49 +0100 X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200926085049.982830-1-fam@euphon.net> References: <20200926085049.982830-1-fam@euphon.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoCNMailClient: External Content-Type: text/plain; charset=utf8 X-Spam-Status: No, score=-10.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org 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: , X-List-Received-Date: Sat, 26 Sep 2020 08:51:34 -0000 From: Fam Zheng gdb/doc/ChangeLog: 2020-09-25 Fam Zheng =09* gdb.texinfo (Machine Code): 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