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] Implement -list-thread-groups.


On Friday 14 November 2008 20:39:47 you wrote:
> 
> > diff --git a/gdb/thread.c b/gdb/thread.c
> > index b1e318d..a32dff4 100644
> > --- a/gdb/thread.c
> > +++ b/gdb/thread.c
> > @@ -636,9 +636,10 @@ set_stop_requested (ptid_t ptid, int stop)
> >     use from MI.  
> >     If REQUESTED_THREAD is not -1, it's the GDB id of the thread
> >     that should be printed.  Otherwise, all threads are
> > -   printed.  */
> > +   printed.  
> > +   If PID is not -1, only prints threads from the process PID.  */
> 
> For completeness and consistency, how about adding
> "Otherwise, threads from all attached PIDs are printed."

Ok.

> >  void
> > -print_thread_info (struct ui_out *uiout, int requested_thread)
> > +print_thread_info (struct ui_out *uiout, int requested_thread, int pid)
> >  {
> >    struct thread_info *tp;
> >    ptid_t current_ptid;
> > @@ -646,6 +647,8 @@ print_thread_info (struct ui_out *uiout, int requested_thread)
> >    char *extra_info;
> >    int current_thread = -1;
> >  
> > +  gdb_assert (requested_thead == -1 || pid == -1);
> 
> I'm puzzled by this assert.
> You don't think we'll ever want to specify both the pid and the thread?

I think that makes no sense. If a thread is specified, then there's no possible
use of 'pid'. Threads are globally numbered.

- Volodya


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