This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFC 05/32] add target method delegation


On 01/13/2014 07:12 PM, Tom Tromey wrote:
> MUST UPDATE

Yes, must.  :-)

> -
> -static int
> -record_full_can_async_p (struct target_ops *ops)
> -{
> -  /* We only enable async when the user specifically asks for it.  */
> -  return target_async_permitted;
> -}
> -
> -static int
> -record_full_is_async_p (struct target_ops *ops)
> -{
> -  /* We only enable async when the user specifically asks for it.  */
> -  return target_async_permitted;
> -}
> -

I think these were and still are necessary, due to how
find_default_target_can_async_p etc. is installed in the dummy target.
E.g., when debugging with the record-core target, without this, I
think we'll end up hitting the dummy target, because the core_ops
target delegates these methods.  That means we'll end up asking e.g.,
the GNU/Linux target whether it can async, while that isn't the
process_stratum target that is open.

This made me realize another issue with the find_default_target_can_async_p
(or really all find_default_...) being installed in the dummy/default
target.  E.g., considering a configuration that includes both remote-sim,
and a native target that can run.  When connected to the sim, we'll
end up calling that method in the default run target which is wrong.

But for the scope of this series, I think it'll suffice to leave
those record-full methods in place for now.

Otherwise looks good to me.

-- 
Pedro Alves


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]