Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Vladimir Prus <vladimir@codesourcery.com>
To: Pedro Alves <pedro@codesourcery.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Remove unnecessary target defaults.
Date: Fri, 15 Aug 2008 14:16:00 -0000	[thread overview]
Message-ID: <200808151815.59911.vladimir@codesourcery.com> (raw)
In-Reply-To: <200808151408.42896.pedro@codesourcery.com>

On Friday 15 August 2008 17:08:42 Pedro Alves wrote:
> On Friday 15 August 2008 13:45:30, Vladimir Prus wrote:
> 
> > -  de_fault (to_can_async_p,
> > -	    (int (*) (void))
> > -	    return_zero);
> > -  de_fault (to_is_async_p,
> > -	    (int (*) (void))
> > -	    return_zero);
> 
> I believe this is incorrect.  You don't notice it when connected
> to remote, because those methods are implemented in remote_ops.  But,
> when connected to e.g., remote-sim.c, and because gdbsim_ops doesn't define
> those, you'll inherit the dummy target's implementation, which looks
> for asyncness in the default run target instead --- while you should be
> looking for asyncness in the remote-sim target.

As we seem to have agreed on IRC, this is pre-existing problem. We inherit
a method before applying defaults, so we'll always inherit dummy's version
of to_is_async_p, and the code I remove above will never manage to change
method to return_zero.

The problem you raise is real, however. I think one approach to solve it
is to just make remote-sim define to_can_async_p. More generic solution
would be to arrange so that if we have a target on process stratum, it
never goes to targets below for to_can_async_p. For example, if we have

   - exec
   - dummy

and you do run, then target_can_async_p will look at exec, then at dummy,
then find_default_can_async_p will return some results. But if we have


   - remote-sim
   - exec
   - dummy

then target_can_async_p will either invoke a method in remote-sim (if present),
or return 0.

How does this sound?

- Volodya



  reply	other threads:[~2008-08-15 14:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 12:46 Vladimir Prus
2008-08-15 13:08 ` Pedro Alves
2008-08-15 14:16   ` Vladimir Prus [this message]
2008-08-15 14:31     ` Pedro Alves
2008-08-15 14:41       ` Vladimir Prus
2008-08-15 14:52         ` Pedro Alves
2008-08-15 15:02           ` Vladimir Prus
2008-08-15 15:11             ` Pedro Alves
2008-08-16 20:15 ` Daniel Jacobowitz

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=200808151815.59911.vladimir@codesourcery.com \
    --to=vladimir@codesourcery.com \
    --cc=gdb-patches@sourceware.org \
    --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