From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1903 invoked by alias); 21 Jan 2010 17:17:34 -0000 Received: (qmail 1883 invoked by uid 22791); 21 Jan 2010 17:17:32 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL,BAYES_00,SARE_MSGID_LONG40,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from smtp-out.google.com (HELO smtp-out.google.com) (216.239.33.17) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 21 Jan 2010 17:17:25 +0000 Received: from wpaz13.hot.corp.google.com (wpaz13.hot.corp.google.com [172.24.198.77]) by smtp-out.google.com with ESMTP id o0LHHLhn001816 for ; Thu, 21 Jan 2010 17:17:21 GMT Received: from ewy9 (ewy9.prod.google.com [10.241.103.9]) by wpaz13.hot.corp.google.com with ESMTP id o0LHHEOJ003791 for ; Thu, 21 Jan 2010 09:17:20 -0800 Received: by ewy9 with SMTP id 9so222515ewy.31 for ; Thu, 21 Jan 2010 09:17:20 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.87.12 with SMTP id x12mr664693wee.48.1264094239880; Thu, 21 Jan 2010 09:17:19 -0800 (PST) In-Reply-To: <20100121135838.GA5211@host0.dyn.jankratochvil.net> References: <20100120235605.607D284413@ruffy.mtv.corp.google.com> <20100121135838.GA5211@host0.dyn.jankratochvil.net> Date: Thu, 21 Jan 2010 17:17:00 -0000 Message-ID: Subject: Re: [patch] print a more useful error message for "gdb core" From: Doug Evans To: Jan Kratochvil Cc: gdb-patches@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-System-Of-Record: true 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: 2010-01/txt/msg00531.txt.bz2 On Thu, Jan 21, 2010 at 5:58 AM, Jan Kratochvil wrote: > On Thu, 21 Jan 2010 01:12:49 +0100, Doug Evans wrote: >> On Wed, Jan 20, 2010 at 3:56 PM, Doug Evans wrote: >> > If the user accidentally does "gdb core" gdb currently prints: >> > >> > "/foo/bar": not in executable format: File format not recognized >> > >> > This patch prints a more useful error message for this particular case: >> > >> > "/foo/bar" is a core file. >> > Please specify an executable to debug. > > I would prefer to try automatically loading it as a core file ("gdb -c co= re") > and to print a warning instead of error. =A0Fedora GDB is patched for bui= ld-id > (still not submitted for FSF) so that it can find the executable in such = case. One could do that alright. Not an exhaustive list, but if we go down the path of converting "gdb corefile" to "gdb -c corefile", then we also need to think about "file corefile" being converted to "core corefile" [or "target core corefile", "core" is apparently deprecated in favor of "target core"] and "target exec corefile" -> "target core corefile". Presumably "file corefile" (and "target exec corefile") would discard the currently selected executable. But maybe not. Will that be confusing for users? I don't know. Whatever you want is fine with me.