From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7175 invoked by alias); 28 Jan 2010 21:39:54 -0000 Received: (qmail 7167 invoked by uid 22791); 28 Jan 2010 21:39:53 -0000 X-SWARE-Spam-Status: No, hits=-1.9 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, 28 Jan 2010 21:39:50 +0000 Received: from kpbe16.cbf.corp.google.com (kpbe16.cbf.corp.google.com [172.25.105.80]) by smtp-out.google.com with ESMTP id o0SLdixm026857 for ; Thu, 28 Jan 2010 21:39:45 GMT Received: from ewy20 (ewy20.prod.google.com [10.241.103.20]) by kpbe16.cbf.corp.google.com with ESMTP id o0SLdfDX026883 for ; Thu, 28 Jan 2010 13:39:43 -0800 Received: by ewy20 with SMTP id 20so1279578ewy.0 for ; Thu, 28 Jan 2010 13:39:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.216.88.143 with SMTP id a15mr2107251wef.206.1264714781334; Thu, 28 Jan 2010 13:39:41 -0800 (PST) In-Reply-To: <20100128213708.GA30978@host0.dyn.jankratochvil.net> References: <20100120235605.607D284413@ruffy.mtv.corp.google.com> <20100128213708.GA30978@host0.dyn.jankratochvil.net> Date: Thu, 28 Jan 2010 21:39: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/msg00615.txt.bz2 On Thu, Jan 28, 2010 at 1:37 PM, Jan Kratochvil wrote: > Hi Doug, > > On Thu, 21 Jan 2010 00:56:05 +0100, Doug Evans wrote: >> --- exec.c =A0 =A019 Jan 2010 09:47:47 -0000 =A0 =A0 =A01.95 >> +++ exec.c =A0 =A020 Jan 2010 23:50:10 -0000 >> @@ -253,6 +253,13 @@ exec_file_attach (char *filename, int fr >> =A0 =A0 =A0 =A0scratch_pathname =3D xstrdup (scratch_pathname); >> =A0 =A0 =A0 =A0cleanups =3D make_cleanup (xfree, scratch_pathname); >> >> + =A0 =A0 =A0/* If the user accidentally did "gdb core", print a more us= eful >> + =A0 =A0 =A0error message. =A0*/ >> + =A0 =A0 =A0if (bfd_check_format (exec_bfd, bfd_core)) >> + =A0 =A0 error (_("\"%s\" is a core file.\n" >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0"Please specify an executable to debug."), >> + =A0 =A0 =A0 =A0 =A0 =A0 =A0scratch_pathname); >> + >> =A0 =A0 =A0 =A0if (!bfd_check_format (exec_bfd, bfd_object)) >> =A0 =A0 =A0 { >> =A0 =A0 =A0 =A0 /* Make sure to close exec_bfd, or else "run" might try = to use > > > this patch has a regression with --enable-targets=3Dall with i386-unknown= -linux > gnu native host as at least the attached i386 .so file gets identified as > "trad-core" (and it gets no longer identified as bfd_object afterwards). > > One should try the bfd_core variant only if bfd_object has already failed. Thanks. You've got an extension in progress right. I don't mind just waiting for that.