From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9272 invoked by alias); 13 Nov 2008 20:06:17 -0000 Received: (qmail 9255 invoked by uid 22791); 13 Nov 2008 20:06:16 -0000 X-Spam-Check-By: sourceware.org Received: from cantor2.suse.de (HELO mx2.suse.de) (195.135.220.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Nov 2008 20:05:32 +0000 Received: from Relay1.suse.de (relay-ext.suse.de [195.135.221.8]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx2.suse.de (Postfix) with ESMTP id 0C1984643A; Thu, 13 Nov 2008 21:05:29 +0100 (CET) From: Andreas Schwab To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: attach to a PID using a different exec References: <20081113192652.GA26537@caradoc.them.org> X-Yow: Either CONFESS now or we go to ``PEOPLE'S COURT''!! Date: Thu, 13 Nov 2008 23:17:00 -0000 In-Reply-To: <20081113192652.GA26537@caradoc.them.org> (Daniel Jacobowitz's message of "Thu, 13 Nov 2008 14:26:52 -0500") Message-ID: User-Agent: Gnus/5.110009 (No Gnus v0.9) Emacs/22.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes 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/msg00298.txt.bz2 Daniel Jacobowitz writes: > On Thu, Nov 13, 2008 at 12:18:20PM -0700, Tom Tromey wrote: >> Sometimes I will start gdb like "gdb /some/path/to/gdb" and then >> "attach PID" -- where PID is actually running "/some/other/gdb". >> That is, the current exec file and the attached process disagree. >> >> Right now this usually yields an error along the lines of: >> "Cannot access memory at address 0x2e". >> >> This patch changes gdb to look at the target's notion of the exec >> file, and then switch to it if it differs from the current exec. > > 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... I think a warning would still be helpful, similar to what you get when you load a core that does not match. Andreas. -- Andreas Schwab, SuSE Labs, schwab@suse.de SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5 "And now for something completely different."