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: [RFA] Make sure target supports non-stop.


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
 


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