[RFA] Make sure target supports non-stop.

Vladimir Prus vladimir@codesourcery.com
Fri Aug 15 17:02:00 GMT 2008


On Friday 15 August 2008 20:13:20 Eli Zaretskii wrote:
> > From: Vladimir Prus <vladimir@codesourcery.com>
> > Date: Fri, 15 Aug 2008 18:50:47 +0400
> > 
> > +  if (non_stop && !target_supports_non_stop ())
> > +    error (_("Cannot attach to this target in non-stop mode"));
> 
> Won't it be more elegant to define a method enter_non_stop_mode for
> each target, and have the target complain if it cannot?

I'm not sure it will be better. Non-stop mode is not purely a property
of target, encapsulated inside it. Rather, it's global property, which 
must be supported by target, so enabling it in core, after making sure 
that target is fine with that, seems reasonable. In other words, 
'enter_non_stop_mode' target method cannot do much except for emitting
an error if non stop is not supported, therefore a method which just reports
support for non-stop seems exactly right choice.

- Volodya
 



More information about the Gdb-patches mailing list