Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* multi-proc: info processes?
@ 2008-11-12 20:04 Michael Snyder
  2008-11-12 20:20 ` Stan Shebs
  0 siblings, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2008-11-12 20:04 UTC (permalink / raw)
  To: pedro, gdb

Hey Pedro,

For your multi-process work, are you planning anything
analogous to the "info threads" command, eg. "info processes"?

What might that look like, in your model?  Would it list,
say, just the processes that gdb is attached to?  Or would
you want something analogous to "ps", that would list all
of the processes that are available to be attached?

Appologies if you've already discussed this...

Michael


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 20:04 multi-proc: info processes? Michael Snyder
@ 2008-11-12 20:20 ` Stan Shebs
  2008-11-12 20:51   ` Vladimir Prus
  2008-11-12 21:22   ` Michael Snyder
  0 siblings, 2 replies; 11+ messages in thread
From: Stan Shebs @ 2008-11-12 20:20 UTC (permalink / raw)
  To: Michael Snyder; +Cc: pedro, gdb

Michael Snyder wrote:
> Hey Pedro,
>
> For your multi-process work, are you planning anything
> analogous to the "info threads" command, eg. "info processes"?
Look at "info inferiors". It's just the processes (or whatever) that are 
currently being controlled by GDB.
>
> What might that look like, in your model?  Would it list,
> say, just the processes that gdb is attached to?  Or would
> you want something analogous to "ps", that would list all
> of the processes that are available to be attached?
That would be somewhat ambitious, especially for a remote target - I 
think you'd need a new packet just to return the list of processes...

Stan


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 20:20 ` Stan Shebs
@ 2008-11-12 20:51   ` Vladimir Prus
  2008-11-12 21:22   ` Michael Snyder
  1 sibling, 0 replies; 11+ messages in thread
From: Vladimir Prus @ 2008-11-12 20:51 UTC (permalink / raw)
  To: gdb

Stan Shebs wrote:

> Michael Snyder wrote:
>> Hey Pedro,
>>
>> For your multi-process work, are you planning anything
>> analogous to the "info threads" command, eg. "info processes"?
> Look at "info inferiors". It's just the processes (or whatever) that are
> currently being controlled by GDB.
>>
>> What might that look like, in your model?  Would it list,
>> say, just the processes that gdb is attached to?  Or would
>> you want something analogous to "ps", that would list all
>> of the processes that are available to be attached?
> That would be somewhat ambitious, especially for a remote target - I
> think you'd need a new packet just to return the list of processes...

FWIW, MI '-list-thread-groups --available' will do just that. The patch itself
needs some work, but should be posted this week.

- Volodya



^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 20:20 ` Stan Shebs
  2008-11-12 20:51   ` Vladimir Prus
@ 2008-11-12 21:22   ` Michael Snyder
  2008-11-12 21:30     ` Pedro Alves
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2008-11-12 21:22 UTC (permalink / raw)
  To: Stan Shebs; +Cc: pedro, gdb

Stan Shebs wrote:
> Michael Snyder wrote:
>> Hey Pedro,
>>
>> For your multi-process work, are you planning anything
>> analogous to the "info threads" command, eg. "info processes"?
> Look at "info inferiors". It's just the processes (or whatever) that are 
> currently being controlled by GDB.
>> What might that look like, in your model?  Would it list,
>> say, just the processes that gdb is attached to?  Or would
>> you want something analogous to "ps", that would list all
>> of the processes that are available to be attached?
> That would be somewhat ambitious, especially for a remote target - I 
> think you'd need a new packet just to return the list of processes...

Sure -- by analogy with qfThreadInfo/qsThreadInfo, it could
be implemented as an iterator.

I'm not sure how desireable it is, but it could save you
from having to go over to the remote target and typing "ps"...

By the way, what about remote attach?  Is that in the plan?


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 21:22   ` Michael Snyder
@ 2008-11-12 21:30     ` Pedro Alves
  2008-11-12 23:16       ` Michael Snyder
  2008-11-13  1:48       ` Michael Snyder
  0 siblings, 2 replies; 11+ messages in thread
From: Pedro Alves @ 2008-11-12 21:30 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Stan Shebs, gdb

On Wednesday 12 November 2008 21:21:59, Michael Snyder wrote:
> Stan Shebs wrote:
> > Michael Snyder wrote:
> >> Hey Pedro,
> >>
> >> For your multi-process work, are you planning anything
> >> analogous to the "info threads" command, eg. "info processes"?
> > Look at "info inferiors". It's just the processes (or whatever) that are 
> > currently being controlled by GDB.
> >> What might that look like, in your model?  Would it list,
> >> say, just the processes that gdb is attached to?  Or would
> >> you want something analogous to "ps", that would list all
> >> of the processes that are available to be attached?
> > That would be somewhat ambitious, especially for a remote target - I 
> > think you'd need a new packet just to return the list of processes...
> 
> Sure -- by analogy with qfThreadInfo/qsThreadInfo, it could
> be implemented as an iterator.

Yeah, there are many ways to implement that.  Both Vladimir and
I ended up doing that independently but similarly, by querying a new 
enum target_object and having the stub formatting the list of
processes as xml.  Vladimir has the ball on merging those
currently --- let's see what comes out, might even pop out something
totally different.  :-)

> 
> I'm not sure how desireable it is, but it could save you
> from having to go over to the remote target and typing "ps"...
> 
> By the way, what about remote attach?  Is that in the plan?

The extended remote protocol has had that for long now, in
the form of vAttach;pid.  What do you mean exactly?

-- 
Pedro Alves


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 21:30     ` Pedro Alves
@ 2008-11-12 23:16       ` Michael Snyder
  2008-11-13  1:48       ` Michael Snyder
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Snyder @ 2008-11-12 23:16 UTC (permalink / raw)
  To: Pedro Alves; +Cc: gdb

Pedro Alves wrote:
> On Wednesday 12 November 2008 21:21:59, Michael Snyder wrote:
>> I'm not sure how desireable it is, but it could save you
>> from having to go over to the remote target and typing "ps"...
>>
>> By the way, what about remote attach?  Is that in the plan?
> 
> The extended remote protocol has had that for long now, in
> the form of vAttach;pid.  What do you mean exactly?

That's probably what I meant.  Thanks!


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-12 21:30     ` Pedro Alves
  2008-11-12 23:16       ` Michael Snyder
@ 2008-11-13  1:48       ` Michael Snyder
  2008-11-13  4:57         ` Daniel Jacobowitz
  1 sibling, 1 reply; 11+ messages in thread
From: Michael Snyder @ 2008-11-13  1:48 UTC (permalink / raw)
  To: Pedro Alves; +Cc: Stan Shebs, gdb

Pedro Alves wrote:
> On Wednesday 12 November 2008 21:21:59, Michael Snyder wrote:
>> Stan Shebs wrote:
>>> Michael Snyder wrote:
>>>> Hey Pedro,
>>>>
>>>> For your multi-process work, are you planning anything
>>>> analogous to the "info threads" command, eg. "info processes"?
>>> Look at "info inferiors". It's just the processes (or whatever) that are 
>>> currently being controlled by GDB.
>>>> What might that look like, in your model?  Would it list,
>>>> say, just the processes that gdb is attached to?  Or would
>>>> you want something analogous to "ps", that would list all
>>>> of the processes that are available to be attached?
>>> That would be somewhat ambitious, especially for a remote target - I 
>>> think you'd need a new packet just to return the list of processes...
>> Sure -- by analogy with qfThreadInfo/qsThreadInfo, it could
>> be implemented as an iterator.
> 
> Yeah, there are many ways to implement that.  Both Vladimir and
> I ended up doing that independently but similarly, by querying a new 
> enum target_object and having the stub formatting the list of
> processes as xml.  Vladimir has the ball on merging those
> currently --- let's see what comes out, might even pop out something
> totally different.  :-)

Hmmm, isn't the formatting of xml a little heavy-weight for a stub?
Stubs are traditionally sort of light-weight entities.  I realize
we're really talking about a gdbserver-type entity here...

Just for yuks, what about something like this, again by
analogy to info threads?

Query:  qfProcInfo  (f for 'first')
Reply:  m<pid>
Query:  qsProcInfo  (s for... umm, 'next')
Reply:  m<pid>, or 'l' if this is the 'last' reply.

Of course, then you might want some analog of "ExtraInfo"...




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-13  1:48       ` Michael Snyder
@ 2008-11-13  4:57         ` Daniel Jacobowitz
  2008-11-13  8:09           ` EBo
  2008-11-13 23:19           ` Michael Snyder
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2008-11-13  4:57 UTC (permalink / raw)
  To: Michael Snyder; +Cc: Pedro Alves, Stan Shebs, gdb

On Wed, Nov 12, 2008 at 05:47:38PM -0800, Michael Snyder wrote:
> Hmmm, isn't the formatting of xml a little heavy-weight for a stub?

Nope.  *Parsing* XML is a bit heavy-weight, but generating it requires
only a tiny routine to escape characters if you support arbitrary
names in the generated XML; you can generate it textually, not
via a DOM.  gdbserver does this, for instance, and I'd guess it's just
a couple hundred bytes of code.  No more than it would take for a
qfThreadInfo analogue.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-13  4:57         ` Daniel Jacobowitz
@ 2008-11-13  8:09           ` EBo
  2008-11-13  8:21             ` Vladimir Prus
  2008-11-13 23:19           ` Michael Snyder
  1 sibling, 1 reply; 11+ messages in thread
From: EBo @ 2008-11-13  8:09 UTC (permalink / raw)
  To: Daniel Jacobowitz, Michael Snyder; +Cc: Pedro Alves, Stan Shebs, gdb

Just in case you guys need to get into parsing XML I would mention Spirit++ (a
C++ functional template library which replaces most of the functionality of
LEX and YACC -- see http://spirit.sourceforge.net/ for more info). IIRC,
Spirit++ has a XML parser library suite.  I do not know if this is appropriate
for the problem, but is a nice tool in the shed when needed.

  EBo --

Daniel Jacobowitz <drow@false.org> said:

> On Wed, Nov 12, 2008 at 05:47:38PM -0800, Michael Snyder wrote:
> > Hmmm, isn't the formatting of xml a little heavy-weight for a stub?
> 
> Nope.  *Parsing* XML is a bit heavy-weight, but generating it requires
> only a tiny routine to escape characters if you support arbitrary
> names in the generated XML; you can generate it textually, not
> via a DOM.  gdbserver does this, for instance, and I'd guess it's just
> a couple hundred bytes of code.  No more than it would take for a
> qfThreadInfo analogue.
> 
> -- 
> Daniel Jacobowitz
> CodeSourcery




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-13  8:09           ` EBo
@ 2008-11-13  8:21             ` Vladimir Prus
  0 siblings, 0 replies; 11+ messages in thread
From: Vladimir Prus @ 2008-11-13  8:21 UTC (permalink / raw)
  To: gdb

EBo wrote:

> Just in case you guys need to get into parsing XML I would mention Spirit++ (a
> C++ functional template library which replaces most of the functionality of
> LEX and YACC -- see http://spirit.sourceforge.net/ for more info). IIRC,
> Spirit++ has a XML parser library suite.  I do not know if this is appropriate
> for the problem, but is a nice tool in the shed when needed.

We have a solution for parsing XML already and parse XML in a number of places. 
Besides, GDB is not written in C++, and although I hope it will be converted to C++ 
someday, I do not think it will ever make use of Spirit. (The reasons why are 
offtopic here, you can catch me in #gdb or #boost if you really want to know).

- Volodya




^ permalink raw reply	[flat|nested] 11+ messages in thread

* Re: multi-proc: info processes?
  2008-11-13  4:57         ` Daniel Jacobowitz
  2008-11-13  8:09           ` EBo
@ 2008-11-13 23:19           ` Michael Snyder
  1 sibling, 0 replies; 11+ messages in thread
From: Michael Snyder @ 2008-11-13 23:19 UTC (permalink / raw)
  To: Michael Snyder, Pedro Alves, Stan Shebs, gdb

Daniel Jacobowitz wrote:
> On Wed, Nov 12, 2008 at 05:47:38PM -0800, Michael Snyder wrote:
>> Hmmm, isn't the formatting of xml a little heavy-weight for a stub?
> 
> Nope.  *Parsing* XML is a bit heavy-weight, but generating it requires
> only a tiny routine to escape characters if you support arbitrary
> names in the generated XML; you can generate it textually, not
> via a DOM.  gdbserver does this, for instance, and I'd guess it's just
> a couple hundred bytes of code.  No more than it would take for a
> qfThreadInfo analogue.

OK.  Could I maybe get a preview of what you have in mind?
I'm working on something similar, might as well try to be
compatible.



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-11-13 23:19 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-11-12 20:04 multi-proc: info processes? Michael Snyder
2008-11-12 20:20 ` Stan Shebs
2008-11-12 20:51   ` Vladimir Prus
2008-11-12 21:22   ` Michael Snyder
2008-11-12 21:30     ` Pedro Alves
2008-11-12 23:16       ` Michael Snyder
2008-11-13  1:48       ` Michael Snyder
2008-11-13  4:57         ` Daniel Jacobowitz
2008-11-13  8:09           ` EBo
2008-11-13  8:21             ` Vladimir Prus
2008-11-13 23:19           ` Michael Snyder

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox