Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: teawater <teawater@gmail.com>
To: "Pedro Alves" <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org, "Michael Snyder" <msnyder@vmware.com>
Subject: Re: [reverse] PATCH: Several interface changes
Date: Wed, 08 Oct 2008 07:28:00 -0000	[thread overview]
Message-ID: <daef60380810080028g1295f34bp94e386546d88e125@mail.gmail.com> (raw)
In-Reply-To: <200810071709.48346.pedro@codesourcery.com>

I think the idea of this patch is good.
But maybe process record still not need it now because p record still
not support multi-thread. Of course, p record will need it in the
feature.

Michael, how about your target?


On Wed, Oct 8, 2008 at 00:09, Pedro Alves <pedro@codesourcery.com> wrote:
> On Monday 06 October 2008 23:11:14, Michael Snyder wrote:
>> Pedro Alves wrote:
>> > A per-target property may seems to make sense on
>> > single-threaded,single-inferior targets, but when you add support
>> > for multi-inferiors per target (e.g., extended-remote has some of it now,
>> > and I'm going to push more of it), or multi-threaded support, the
>> > per-target setting may not make sense anymore --- explicit requests
>> > at the target resume interface (just like your new packets) may make
>> > more sense.  Imagine forward execution non-stop debugging in all threads
>> > but one, which the user is examining in reverse.  What's the target
>> > direction in this case?
>>
>> Yakkk!!!
>
> :-)  Here's an alternative interface I was considering and envisioning
> when I mentioned the above.  Consider this just a suggestion.  If it
> looks bad, let's quickly forget about it.
>
>> > The question to me is --- when/why does the target (as in, the debug
>> > API abstraction) ever need to know about the current direction that
>> > it couldn't get from the core's request?
>
> So, after last night's discussion, I came up with the attached to
> see how it would look like.  The major change is that I consider the
> reverse/forward-direction thing a property or the command the user
> requested, and as such, belongs together with the other thread
> stepping state we keep in struct thread_info, and the
> target_ops implementation, adjusts itself to the direction GDB
> requests with target_resume.  I've extended target_resume's interface
> to accept this instead of a `step' boolean:
>
>  enum target_resume_kind
>   {
>     /* Continue forward.  */
>     rk_continue,
>
>     /* Step forward.  */
>     rk_step,
>
>     /* Continue in the reverse direction.  */
>     rk_continue_reverse,
>
>     /* Step in the reverse direction.  */
>     rk_step_reverse,
>   };
>
> (notice that the order of the things in the enum allows me to
> miss some conversions --- I'm lazy).
>
>  I can't say if I like this new target_resume interface or
> not.  I just tried doing it to see how it would look.
>
> (I can imagine that we're in the future going to extend the
> target_resume interface to be more like gdbserver's, but, well,
> that's another issue.)
>
> So, the interface at the command level implementation is just
> like it was before:
>
>  1)  call clear_proceed_status ();
>
>  2)  /* construct the step/continue request */
>
>  3)  call proceed (...);
>
> Where in #2, you can set the thread to go backwards by
> doing:
>
>     thread->reverse = 1;
>
> The attached patch applies against the reverse-20080930-branch.
>
> Other things I've done in the patch:
>
>   * Added support for a "Tnn nohistory" stop reply that translates
>    to TARGET_WAITKIND_NO_HISTORY.  When going multi-threaded, or
>    multi-process this will allow things like "T05;thread:pPID.TID;nohistory"
>    for free.  I absolutelly didn't test this.  I've no reverse aware target
>    at hand.
>
>   * At places, error out if async + reverse or non-stop + reverse
>     was requested.
>
>   * Added a target_can_reverse_p method, so infcmd.c can check if the
>     target supports reverse execution before calling into the target.  Not
>     strictly necessary, though, but I thought this was nicer this way.
>
> I checked that I can use the record target on x86 (actually x86_64
> with -m32) as good as without the patch, but it's quite possible I
> broke things badly.
>
> --
> Pedro Alves
>


  reply	other threads:[~2008-10-08  7:28 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-07 16:09 Pedro Alves
2008-10-08  7:28 ` teawater [this message]
2008-10-08 12:26   ` Pedro Alves
2008-10-08 20:21   ` Michael Snyder
2008-10-08 23:28     ` Pedro Alves
2008-10-09  2:32       ` teawater
2008-10-09  2:50         ` Pedro Alves
2008-10-09  3:11           ` 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=daef60380810080028g1295f34bp94e386546d88e125@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