From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10717 invoked by alias); 6 Sep 2016 16:04:38 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 10703 invoked by uid 89); 6 Sep 2016 16:04:37 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.0 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=ham version=3.3.2 spammy=applicable X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Sep 2016 16:04:36 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 65D1680F6B; Tue, 6 Sep 2016 16:04:35 +0000 (UTC) Received: from host1.jankratochvil.net (ovpn-116-46.ams2.redhat.com [10.36.116.46]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u86G4WG5012770 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 6 Sep 2016 12:04:34 -0400 Date: Tue, 06 Sep 2016 16:04:00 -0000 From: Jan Kratochvil To: =?iso-2022-jp?B?GyRCSmlFX048GyhC?= Cc: gdb@sourceware.org Subject: Re: How to show instructions in one record Message-ID: <20160906160432.GA29307@host1.jankratochvil.net> References: <20160906150017.GA22508@host1.jankratochvil.net> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-2022-jp Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.0 (2016-08-17) X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00034.txt.bz2 On Tue, 06 Sep 2016 17:43:06 +0200, 慕冬亮 wrote: > I just want all the instructions which have already executed in one > execution path. Take the following demo as example, One can do some: start record cont reverse-continue while 1 stepi x/i $pc end > What I need is the instruction list: > > 203 movq %r9, 16(%rdi) > 203 movq %r9, 16(%rdi) > 202 movq %r8, 8(%rdi) > 201 movq %rax, (%rdi) > 199 movq 24(%rsi), %r10 > 198 movq 16(%rsi), %r9 > ...... > If there are loops, I need all the instructions in the loop. > I don't know whether process record/replay could achieve this goal. But I think in thise case you should follow Markus Metzger's advice as the output from 'record instruction-history' may be more appropriate for your requirement. Besides building GDB yourself you can use also Fedora 23 (and better Fedora 24) GDB which does have libipt support. Be aware with btrace you cannot investigate any data or registers during the recorded execution. TBH I see this "display all recorded history" common request from GDB users but IMO more effective approach is to place there watchpoints, breakpoints and even breakpoint-attached command lists to catch the interesting moment during execution. The recorded history is huge and so one needs to filter it somehow automatically afterwards anyway which the watchpoints solve on their own already during execution. Sure it may not be applicable for your case. Jan