public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
* GDB inferior PID ?
@ 2003-05-06 14:44 Alain Magloire
  2003-06-15  2:43 ` Andrew Cagney
  0 siblings, 1 reply; 2+ messages in thread
From: Alain Magloire @ 2003-05-06 14:44 UTC (permalink / raw)
  To: gdb

Bonjour

	Is there a way to get "reliably" the inferior PID ?

Scenario, Eclipse/CDT debugger:

	I'm using gdb/mi and to separate inferior output from the MI protocol we use 
gdb --tty=...

The downside interrupting the inferior is now messy business
depending on the platfrom.  Totally broken on Solaris, partially
working on GNU/Linux and windows.

I've already drop a PR on the solaris platform.

Solution:

I'm doing some ugly hack/parsing with
(gdb) info program

And retrieving the inferior pid to drop a SIGINT or whatever
it is call on windows(CTRL-BREAK ?).


Anyone having something more elegant/reliable?

Why is the pid(or whatever the host consider to be the "pid") available?
I undestand that it does not apply to remote/serial debugging.

Curious.


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

* Re: GDB inferior PID ?
  2003-05-06 14:44 GDB inferior PID ? Alain Magloire
@ 2003-06-15  2:43 ` Andrew Cagney
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Cagney @ 2003-06-15  2:43 UTC (permalink / raw)
  To: Alain Magloire; +Cc: gdb

> Bonjour
> 
> 	Is there a way to get "reliably" the inferior PID ?

Do you want the theory, or the reality :-(

> Scenario, Eclipse/CDT debugger:
> 
> 	I'm using gdb/mi and to separate inferior output from the MI protocol we use 
> gdb --tty=...
> 
> The downside interrupting the inferior is now messy business
> depending on the platfrom.  Totally broken on Solaris, partially
> working on GNU/Linux and windows.
> 
> I've already drop a PR on the solaris platform.
> 
> Solution:
> 
> I'm doing some ugly hack/parsing with
> (gdb) info program
> 
> And retrieving the inferior pid to drop a SIGINT or whatever
> it is call on windows(CTRL-BREAK ?).
> 
> 
> Anyone having something more elegant/reliable?
> 
> Why is the pid(or whatever the host consider to be the "pid") available?
> I undestand that it does not apply to remote/serial debugging.

The theory is that GDB is in async mode and able to accept things like 
an interrupt at any time.  GDB then passes the interrupt down to the 
target - very like GDB already does for remote targets.

You could look at the remote.c code at how it handles interrupts - send 
the interrupt to GDB and then have it dispatch it.

The other is a command to let you do the querying your doing now.

Andrew


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

end of thread, other threads:[~2003-06-15  2:43 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-05-06 14:44 GDB inferior PID ? Alain Magloire
2003-06-15  2:43 ` Andrew Cagney

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).