Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: teawater <teawater@gmail.com>
To: "Pedro Alves" <pedro@codesourcery.com>,
	 	"Michael Snyder" <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [reverse/record] adjust_pc_after_break in reverse execution mode?
Date: Fri, 31 Oct 2008 13:04:00 -0000	[thread overview]
Message-ID: <daef60380810301910t480d859ep4af64d1c525f78e0@mail.gmail.com> (raw)
In-Reply-To: <200810301615.40510.pedro@codesourcery.com>

I think the reason is P record let inferior step recycle in the
linux-nat target.
So when it break by breakpint, it will not let
(pc+gdbarch_decr_pc_after_break (gdbarch)). Then after
adjust_pc_after_break, The PC is error.

So I post patch to fix it.
http://sourceware.org/ml/gdb-patches/2008-10/msg00634.html
And I try it in Pedro's test is OK.


After that, Pedro said maybe we can add a target_ops level interface
tell infrun.c that this PC don't need adjust_pc_after_break. This
target can do it with itself.



So, what shell we do now? :)
Check my patch in or post a patch for this interface first?


This is just my understand of current stat. Maybe some part is wrong.


On Fri, Oct 31, 2008 at 00:15, Pedro Alves <pedro@codesourcery.com> wrote:
> On Thursday 30 October 2008 15:54:34, Michael Snyder wrote:
>> Pedro, yes, but I can no longer get it to exhibit  that behavior.
>> Can you?
>>
>
> Sure, see below.
>
> Head of ChangeLog:
>
>  2008-10-24  Michael Snyder  <msnyder@vmware.com>
>
>         * infrun.c (handle_inferior_event): Handle dynamic symbol
>         resolution in reverse.
>
> Test app:
>
> 18      volatile int global_foo = 0;
> 19
> 20      int
> 21      main (int argc, char **argv)
> 22      {
> 23        asm ("nop"); /* 1st insn */
> 24        asm ("nop"); /* 2nd insn */
> 25        asm ("nop"); /* 3rd insn */
> 26        asm ("nop"); /* 4th insn */
> 27        if (!global_foo)
> 28          goto ahead;
> 29        asm ("nop"); /* 5th insn */
> 30        asm ("nop"); /* 6th insn */
> 31        asm ("nop"); /* 7th insn */
> 32        asm ("nop"); /* 8th insn */  <<<<< bkpt here
> 33       ahead:
> 34        asm ("nop"); /* 9th insn */  <<<<< and here
> 35       end:
> 36        return 0;
> 37      }
>
> Normal play:
>
>>./gdb ./testsuite/gdb.base/decr-pc-rev
> GNU gdb (GDB) 6.8.50.20080930-cvs
> [...]
> (gdb) start
> Temporary breakpoint 1 at 0x8048382: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 23.
> Starting program: /home/pedro/gdb/reverse-20080930-branch/build32/gdb/testsuite/gdb.base/decr-pc-rev
>
> Temporary breakpoint 1, main (argc=<value optimized out>, argv=<value optimized out>)
>    at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:23
> 23        asm ("nop"); /* 1st insn */
> (gdb) b 32
> Breakpoint 2 at 0x8048392: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 32.
> (gdb) b 34
> Breakpoint 3 at 0x8048393: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 34.
> (gdb) c
> Continuing.
>
> Breakpoint 3, main (argc=<value optimized out>, argv=<value optimized out>)
>    at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:34
> 34      in ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c
> (gdb) p $pc
> $1 = (void (*)()) 0x8048393 <main+31>
> (gdb)
>
> Ok, breakpoint 3 was hit (notice the goto at line 28, it's
> always executed because global_foo is always 0)
>
> --------
>
> Now the same, but while recording (replay exhibits the
> same symptom)
>
>>./gdb ./testsuite/gdb.base/decr-pc-rev
> GNU gdb (GDB) 6.8.50.20080930-cvs
> [...]
> (gdb) start
> Temporary breakpoint 1 at 0x8048382: file ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c, line 23.
> Starting program: /home/pedro/gdb/reverse-20080930-branch/build32/gdb/testsuite/gdb.base/decr-pc-rev
>
> Temporary breakpoint 1, main (argc=<value optimized out>, argv=<value optimized out>)
>    at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:23
> 23        asm ("nop"); /* 1st insn */
> (gdb) record
>      ^^^^^^
> (gdb) c
> Continuing.
>
> Breakpoint 2, main (argc=<value optimized out>, argv=<value optimized out>)
>    at ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c:32
> 32      in ../../../src/gdb/testsuite/gdb.base/decr-pc-rev.c
> (gdb) p $pc
> $1 = (void (*)()) 0x8048392 <main+30>
> (gdb)
>
> Breakpoint 3 should've been hit, not 2.  The PC points at
> 0x8048392, but it should point at 0x8048393.
>
> Feels like we're going in circles.  :-)
>
> --
> Pedro Alves
>


  parent reply	other threads:[~2008-10-31  2:13 UTC|newest]

Thread overview: 45+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-18  1:11 Pedro Alves
2008-10-18  1:26 ` Michael Snyder
2008-10-18  3:09   ` Pedro Alves
2008-10-18  3:18     ` teawater
2008-10-18  8:42     ` Andreas Schwab
2008-10-19 14:28       ` teawater
2008-10-19 20:10     ` Daniel Jacobowitz
2008-10-18  3:07 ` teawater
2008-10-18  3:26   ` Pedro Alves
2008-10-19 22:44 ` Michael Snyder
2008-10-20  0:10   ` Pedro Alves
2008-10-20  0:44     ` Michael Snyder
2008-10-20  1:46       ` Daniel Jacobowitz
2008-10-20 12:10       ` Pedro Alves
2008-10-20 15:50         ` teawater
2008-10-20 17:44       ` Pedro Alves
2008-10-20 17:51         ` Michael Snyder
2008-10-20 23:36           ` teawater
2008-10-21  0:21             ` Pedro Alves
2008-10-21  0:56               ` teawater
2008-10-21  3:13                 ` teawater
2008-10-21  6:52               ` teawater
2008-10-21  6:52                 ` teawater
2008-10-23 23:28                 ` Michael Snyder
2008-10-21  7:04               ` teawater
2008-10-21 18:36                 ` Michael Snyder
2008-10-22  0:39                   ` teawater
2008-10-23 23:32     ` Michael Snyder
2008-10-23 23:46       ` Pedro Alves
2008-10-23 23:55         ` Pedro Alves
2008-10-24  0:45           ` Michael Snyder
2008-10-24  0:43         ` Michael Snyder
2008-10-24  1:51           ` Pedro Alves
2008-10-24  8:11             ` teawater
2008-10-24  9:58               ` teawater
2008-10-25  7:08                 ` teawater
2008-10-28  3:21                   ` teawater
2008-10-29  1:24                   ` Michael Snyder
2008-10-30  3:01                     ` teawater
2008-10-30 12:21                     ` Pedro Alves
2008-10-30 22:06                       ` Michael Snyder
2008-10-30 21:44                         ` Pedro Alves
2008-10-30 21:29                           ` Michael Snyder
2008-10-31 13:04                           ` teawater [this message]
2008-10-31  0:25                       ` teawater

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=daef60380810301910t480d859ep4af64d1c525f78e0@mail.gmail.com \
    --to=teawater@gmail.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.com \
    --cc=pedro@codesourcery.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