From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24191 invoked by alias); 13 Nov 2008 19:27:39 -0000 Received: (qmail 24129 invoked by uid 22791); 13 Nov 2008 19:27:37 -0000 X-Spam-Check-By: sourceware.org Received: from NaN.false.org (HELO nan.false.org) (208.75.86.248) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 13 Nov 2008 19:26:56 +0000 Received: from nan.false.org (localhost [127.0.0.1]) by nan.false.org (Postfix) with ESMTP id D962410D51; Thu, 13 Nov 2008 19:26:53 +0000 (GMT) Received: from caradoc.them.org (209.195.188.212.nauticom.net [209.195.188.212]) by nan.false.org (Postfix) with ESMTP id 3907010811; Thu, 13 Nov 2008 19:26:53 +0000 (GMT) Received: from drow by caradoc.them.org with local (Exim 4.69) (envelope-from ) id 1L0hq8-0006vu-N4; Thu, 13 Nov 2008 14:26:52 -0500 Date: Thu, 13 Nov 2008 22:49:00 -0000 From: Daniel Jacobowitz To: Tom Tromey Cc: gdb-patches@sourceware.org Subject: Re: RFA: attach to a PID using a different exec Message-ID: <20081113192652.GA26537@caradoc.them.org> Mail-Followup-To: Tom Tromey , gdb-patches@sourceware.org References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.17 (2008-05-11) 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/msg00294.txt.bz2 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... -- Daniel Jacobowitz CodeSourcery