From: 慕冬亮 <mudongliangabcd@gmail.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb@sourceware.org
Subject: Re: How to show instructions in one record
Date: Tue, 06 Sep 2016 15:43:00 -0000 [thread overview]
Message-ID: <CAD-N9QU9YS0qrcHrt=sNDRv1p4h1NXjfbF2g3LE_Wwa+sSo-xA@mail.gmail.com> (raw)
In-Reply-To: <20160906150017.GA22508@host1.jankratochvil.net>
2016-09-06 11:00 GMT-04:00 Jan Kratochvil <jan.kratochvil@redhat.com>:
> On Tue, 06 Sep 2016 16:13:52 +0200, 慕冬亮 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
> => 0x7ffff50311e9 <__memcpy_sse2+217>: mov 0x10(%rsi),%r9
> (gdb) _
next prev parent reply other threads:[~2016-09-06 15:43 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-06 14:14 慕冬亮
2016-09-06 14:59 ` Metzger, Markus T
[not found] ` <20160906150017.GA22508@host1.jankratochvil.net>
2016-09-06 15:43 ` 慕冬亮 [this message]
2016-09-06 16:04 ` Jan Kratochvil
[not found] ` <CAD-N9QUaaNjG=rmH+PXyni=KBt7eNcbT54XhAr1bzCXb6KZoTw@mail.gmail.com>
2016-09-06 17:15 ` Jan Kratochvil
[not found] ` <CAD-N9QU4Ru6VDLB=bSQt5gpFN_YXgn+it3+PnW4rvYkoANVvNQ@mail.gmail.com>
2016-09-06 17:35 ` Jan Kratochvil
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to='CAD-N9QU9YS0qrcHrt=sNDRv1p4h1NXjfbF2g3LE_Wwa+sSo-xA@mail.gmail.com' \
--to=mudongliangabcd@gmail.com \
--cc=gdb@sourceware.org \
--cc=jan.kratochvil@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox