From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8382 invoked by alias); 15 Jun 2003 02:43:46 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 8297 invoked from network); 15 Jun 2003 02:43:45 -0000 Received: from unknown (HELO localhost.redhat.com) (24.157.166.107) by sources.redhat.com with SMTP; 15 Jun 2003 02:43:45 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id 44FA82B63; Sat, 14 Jun 2003 22:43:27 -0400 (EDT) Message-ID: <3EEBDD4F.30007@redhat.com> Date: Sun, 15 Jun 2003 02:43:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Alain Magloire Cc: gdb@sources.redhat.com Subject: Re: GDB inferior PID ? References: <200305061444.KAA32151@node1.ott.qnx.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-06/txt/msg00295.txt.bz2 > 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