From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 64114 invoked by alias); 6 Sep 2016 15:43:40 -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 63491 invoked by uid 89); 6 Sep 2016 15:43:40 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.4 required=5.0 tests=AWL,BAYES_00,BODY_8BITS,FREEMAIL_FROM,GARBLED_BODY,RCVD_IN_DNSWL_LOW,RCVD_IN_SORBS_SPAM,SPF_PASS autolearn=no version=3.3.2 spammy=U*jan.kratochvil, sk:jan.kra, jankratochvilredhatcom, Kratochvil X-HELO: mail-qk0-f178.google.com Received: from mail-qk0-f178.google.com (HELO mail-qk0-f178.google.com) (209.85.220.178) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Sep 2016 15:43:38 +0000 Received: by mail-qk0-f178.google.com with SMTP id z190so221962767qkc.0 for ; Tue, 06 Sep 2016 08:43:38 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=exhbcoE7VNERS/6D/Iq0Tc7ILWNh+JpaXjgXEFF8hH0=; b=kQtUzewKydCaHWBPybFfnwM3lutSjDn/IMnUe/Bpd6rIN9tvIMJwf1oiLrdUQ7AD9K e6dxa0y40kidf6l3rw8tmBEb0W8iCT3YTCSxQgHgbQoViD0vMtDxQbp7XoHDPn/ZDtxE +dxTQLUHXsUJ9J7AV383ENz9wr5AP4/tPkpXe8VZN6Y/OAdFdzcjTWwXEN3W7DBm+tcG 4Mp5KtAc/A+KwayQNcJ+RB0tlDebqWOr5YphHoYbohWALJcmPKzJ6sA6rgdbJjGlfrAq mLuWf7ayZJX3pHU9ah7IxGUvsa1++u0IuaqjA3het8pWRQNtvF/PYEJzeDw5qxqM5Ms7 K9Vg== X-Gm-Message-State: AE9vXwNeVn6wCb5rEuTZ4lAwJaXv22Lgrq0+F1lPTIGL6sq9Uoo107KSC2kl4jxGWo5wPNZQ6E0wdVULmaK3ZQ== X-Received: by 10.55.126.194 with SMTP id z185mr45171605qkc.140.1473176617112; Tue, 06 Sep 2016 08:43:37 -0700 (PDT) MIME-Version: 1.0 Received: by 10.237.44.7 with HTTP; Tue, 6 Sep 2016 08:43:06 -0700 (PDT) In-Reply-To: <20160906150017.GA22508@host1.jankratochvil.net> References: <20160906150017.GA22508@host1.jankratochvil.net> From: =?UTF-8?B?5oWV5Yas5Lqu?= Date: Tue, 06 Sep 2016 15:43:00 -0000 Message-ID: Subject: Re: How to show instructions in one record To: Jan Kratochvil Cc: gdb@sourceware.org Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-IsSubscribed: yes X-SW-Source: 2016-09/txt/msg00033.txt.bz2 2016-09-06 11:00 GMT-04:00 Jan Kratochvil : > On Tue, 06 Sep 2016 16:13:52 +0200, =E6=85=95=E5=86=AC=E4=BA=AE wrote: >> So how to show instructions in one record? > > I do not fully understand what "instructions in one record" mean but some > demo: > I just want all the instructions which have already executed in one execution path. Take the following demo as example, 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. > (gdb) start > [...] > (gdb) record > (gdb) c > Continuing. > Program received signal SIGINT, Interrupt. > __memcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:203 > 203 movq %r9, 16(%rdi) > (gdb) info record > Active record target: record-full > Record mode: > Lowest recorded instruction number is 1. > Highest recorded instruction number is 100092. > Log contains 100092 instructions. > Max logged instructions is 10000000. > (gdb) reverse-stepi > 203 movq %r9, 16(%rdi) > (gdb) > 202 movq %r8, 8(%rdi) > (gdb) > 201 movq %rax, (%rdi) > (gdb) > 199 movq 24(%rsi), %r10 > (gdb) > 198 movq 16(%rsi), %r9 > (gdb) info record > Active record target: record-full > Replay mode: > Lowest recorded instruction number is 1. > Current instruction number is 100087. > Highest recorded instruction number is 100092. > Log contains 100092 instructions. > Max logged instructions is 10000000. > (gdb) frame > #0 __memcpy_sse2 () at ../sysdeps/x86_64/memcpy.S:198 > 198 movq 16(%rsi), %r9 > (gdb) x/i $pc > =3D> 0x7ffff50311e9 <__memcpy_sse2+217>: mov 0x10(%rsi),%r9 > (gdb) _