From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12316 invoked by alias); 13 Nov 2008 19:52:14 -0000 Received: (qmail 12271 invoked by uid 22791); 13 Nov 2008 19:52:13 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Nov 2008 19:51:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 037912AD2DB; Thu, 13 Nov 2008 14:51:34 -0500 (EST) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id u3zyzL078suQ; Thu, 13 Nov 2008 14:51:33 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id C345A2AD2D3; Thu, 13 Nov 2008 14:51:33 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id 0FFB8E7ACD; Thu, 13 Nov 2008 11:51:31 -0800 (PST) Date: Thu, 13 Nov 2008 22:59:00 -0000 From: Joel Brobecker To: Tom Tromey , gdb-patches@sourceware.org Subject: Re: RFA: attach to a PID using a different exec Message-ID: <20081113195130.GM5112@adacore.com> References: <20081113192652.GA26537@caradoc.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20081113192652.GA26537@caradoc.them.org> User-Agent: Mutt/1.4.2.2i Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-11/txt/msg00296.txt.bz2 > This seems like a bad idea to me. The canonical example is: > > /usr/bin/prog.stripped & > gdb /home/drow/prog.debug $(pidof prog.stripped) > > I don't want GDB to prompt my to switch to the stripped program... In my case, it's usually a procedural mistake on my end. The typical scenario is when I want to debugger GDB, so in one terminal, I start "gdb my_process", and then on another terminal is start "gdb gdb" followed by "attach inferior_gdb_pid". The problem is often that the inferior GDB I started was the one in the path instead of the one I just built. In all the cases when this occured, GDB switching binaries from under me would not have been helpful. The error that occurs is a little cryptic, so this can be improved, but the only solution to my mistake is a restart of the inferior GDB. -- Joel