[PATCH 11/15] More target unification

Doug Evans dje@google.com
Mon Jul 14 19:17:00 GMT 2014


Gary Benson writes:
 > This unifies a few more top-level target functions -- target_resume,
 > target_wait, and target_stop -- and the declaration of the variable
 > "non_stop".  This follows the usual pattern, where clients of "common"
 > are expected to define the objects appropriately, thus simplifying
 > common/agent.c a bit more.
 > 
 > gdb/
 > 2014-07-09  Tom Tromey  <tromey@redhat.com>
 > 
 > 	* target/target.h (target_resume, target_wait, target_stop)
 > 	(non_stop): Moved from target.h.
 > 	* target.h (target_resume, target_wait, target_stop, non_stop):
 > 	Move to target/target.h.
 > 	* common/agent.c (agent_run_command): Always use target_resume,
 > 	target_stop, and target_wait.
 > 
 > gdb/gdbserver/
 > 2014-07-09  Tom Tromey  <tromey@redhat.com>
 > 
 > 	* target.c (target_wait, target_stop, target_resume): New
 > 	functions.
 > [...]
 >
 > diff --git a/gdb/gdbserver/target.c b/gdb/gdbserver/target.c
 > index 44e1e11..f93163e 100644
 > --- a/gdb/gdbserver/target.c
 > +++ b/gdb/gdbserver/target.c
 > @@ -134,6 +134,40 @@ mywait (ptid_t ptid, struct target_waitstatus *ourstatus, int options,
 >    return ret;
 >  }
 >  
 > +/* See target/target.h.  */
 > +
 > +ptid_t
 > +target_wait (ptid_t ptid, struct target_waitstatus *status, int options)
 > +{
 > +  return mywait (ptid, status, options, 0);
 > +}
 > +
 > +/* See target/target.h.  */
 > +
 > +void
 > +target_stop (ptid_t ptid)
 > +{
 > +  struct thread_resume resume_info;
 > +
 > +  resume_info.thread = ptid;
 > +  resume_info.kind = resume_stop;
 > +  resume_info.sig = GDB_SIGNAL_0;
 > +  (*the_target->resume) (&resume_info, 1);
 > +}
 > +
 > +/* See target/target.h.  */
 > +
 > +void
 > +target_resume (ptid_t ptid, int step, enum gdb_signal signal)
 > +{
 > +  struct thread_resume resume_info;
 > +
 > +  resume_info.thread = ptid;
 > +  resume_info.kind = step ? resume_step : resume_continue;
 > +  resume_info.sig = GDB_SIGNAL_0;
 > +  (*the_target->resume) (&resume_info, 1);
 > +}

I'm guessing the ignoring of signal is an oversight, right?



More information about the Gdb-patches mailing list