From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8074 invoked by alias); 11 Oct 2011 11:17:45 -0000 Received: (qmail 8061 invoked by uid 22791); 11 Oct 2011 11:17:44 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Oct 2011 11:17:26 +0000 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=EU1-MAIL.mgc.mentorg.com) by relay1.mentorg.com with esmtp id 1RDaKq-0004WU-TE from pedro_alves@mentor.com ; Tue, 11 Oct 2011 04:17:25 -0700 Received: from scottsdale.localnet ([172.16.63.104]) by EU1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.1830); Tue, 11 Oct 2011 12:17:23 +0100 From: Pedro Alves To: gdb@sourceware.org Subject: Re: attach u/i oddity Date: Tue, 11 Oct 2011 11:17:00 -0000 User-Agent: KMail/1.13.6 (Linux/2.6.38-11-generic; KDE/4.7.1; x86_64; ; ) Cc: Joel Brobecker , Doug Evans References: <20111011061636.GR3802@adacore.com> In-Reply-To: <20111011061636.GR3802@adacore.com> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201110111217.21689.pedro@codesourcery.com> X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00054.txt.bz2 On Tuesday 11 October 2011 07:16:36, Joel Brobecker wrote: > > The user never specified forever.x32 as the program to debug, gdb was > > being clever. However, if it's going to be clever the first time, > > it's a bug (from the user's perspective) to not be clever the second > > time too (IMO). > > I agree. I was surprised by the reported behavior. I can't see how to change that while both keeping it simple, and avoiding breaking valid use cases. Users need to be able to specify a different executable/file than what the OS reports the process is running, and "file FOO; attach PID" is the idiom GDB uses since forever for that. Maybe what we need a `warning' so that the surprise is gone: "warning: assuming process is running the loaded executable `FOO' which is different from the executable the target reports the process " is running. Unload it with the `file' command to make gdb find and load the target reported executable automatically." ( certainly needs copy/editing :-) ) Note this would be tricky to get right for remote targets. Also, not all targets can fetch the running executable on attach. -- Pedro Alves