From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from simark.ca by simark.ca with LMTP id 0uBQEr+2E2BVFgAAWB0awg (envelope-from ) for ; Fri, 29 Jan 2021 02:18:23 -0500 Received: by simark.ca (Postfix, from userid 112) id 36F621EF80; Fri, 29 Jan 2021 02:18:23 -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 900301E945 for ; Fri, 29 Jan 2021 02:18:22 -0500 (EST) Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id B24DB3893672; Fri, 29 Jan 2021 07:18:21 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org B24DB3893672 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1611904701; bh=Nejh2heL2+ISGdCtU9e33ULSHt7f8krcrItsaHAS14Q=; h=Date:To:In-Reply-To:Subject:References:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: From; b=MsB319wayoIdMGjTbRa55KJAWI1lKyRoqiX0l3tLJZeOmpRVMweN1PvM9qfgiDJlS f9dfWIsuuXjqCfRTiih7Q8nKi9mE5zhB5f5Am8Qj2VCNC2WuYRy4gPomjcmTBXS8/w 4sMQOmFm5vwGwJJfQlaALW5xe3MXvXs1YiaCcHsY= Received: from eggs.gnu.org (eggs.gnu.org [IPv6:2001:470:142:3::10]) by sourceware.org (Postfix) with ESMTPS id A021A3858023 for ; Fri, 29 Jan 2021 07:18:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A021A3858023 Received: from fencepost.gnu.org ([2001:470:142:3::e]:33676) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1l5O2s-00042O-8T; Fri, 29 Jan 2021 02:18:19 -0500 Received: from 84.94.185.95.cable.012.net.il ([84.94.185.95]:2058 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1l5O2q-00016l-NO; Fri, 29 Jan 2021 02:18:18 -0500 Date: Fri, 29 Jan 2021 09:18:35 +0200 Message-Id: <83tur0xlbo.fsf@gnu.org> To: Peng Yu In-Reply-To: (message from Peng Yu via Gdb on Thu, 28 Jan 2021 19:58:11 -0600) Subject: Re: How to display instructions around the current instuction? References: <8ff04714-9feb-d13a-98e3-cede442e0eb8@palves.net> X-BeenThere: gdb@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gdb mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , From: Eli Zaretskii via Gdb Reply-To: Eli Zaretskii Cc: gdb@sourceware.org, pedro@palves.net Errors-To: gdb-bounces@sourceware.org Sender: "Gdb" > Date: Thu, 28 Jan 2021 19:58:11 -0600 > From: Peng Yu via Gdb > Cc: gdb@sourceware.org > > >> display/10i $rip > >> > > > > From gdb/NEWS: > > > > ~~~~ > > *** Changes in GDB 7.12 > > > > * GDB now supports a negative repeat count in the 'x' command to examine > > memory backward from the given address. For example: > > > > ... > > (gdb) x/-5i 0x0000000000400580 > > 0x40056a : mov %edi,-0x4(%rbp) > > 0x40056d : mov %rsi,-0x10(%rbp) > > 0x400571 : mov $0x40061c,%esi > > 0x400576 : mov $0x2a,%edi > > 0x40057b : > > callq 0x400536 > > ~~~~ > > Is there a documentation problem in gdb regarding this feature. I > don't see this feature is documented. You are looking up help on a wrong command. Pedro suggested to use x/-5i ADDRESS And the help for 'x' says: The specified number of objects of the specified size are printed according to the format. If a negative number is specified, memory is examined backward from the address. Note the last sentence.