From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [patch] print a more useful error message for "gdb core"
Date: Thu, 28 Jan 2010 21:37:00 -0000 [thread overview]
Message-ID: <20100128213708.GA30978@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20100120235605.607D284413@ruffy.mtv.corp.google.com>
[-- Attachment #1: Type: text/plain, Size: 1048 bytes --]
Hi Doug,
On Thu, 21 Jan 2010 00:56:05 +0100, Doug Evans wrote:
> --- exec.c 19 Jan 2010 09:47:47 -0000 1.95
> +++ exec.c 20 Jan 2010 23:50:10 -0000
> @@ -253,6 +253,13 @@ exec_file_attach (char *filename, int fr
> scratch_pathname = xstrdup (scratch_pathname);
> cleanups = make_cleanup (xfree, scratch_pathname);
>
> + /* If the user accidentally did "gdb core", print a more useful
> + error message. */
> + if (bfd_check_format (exec_bfd, bfd_core))
> + error (_("\"%s\" is a core file.\n"
> + "Please specify an executable to debug."),
> + scratch_pathname);
> +
> if (!bfd_check_format (exec_bfd, bfd_object))
> {
> /* Make sure to close exec_bfd, or else "run" might try to use
this patch has a regression with --enable-targets=all 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.
Regards,
Jan
[-- Attachment #2: trad-core.so.gz --]
[-- Type: application/x-gzip, Size: 2067 bytes --]
next prev parent reply other threads:[~2010-01-28 21:37 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-01-20 23:56 Doug Evans
2010-01-21 0:13 ` Doug Evans
2010-01-21 2:33 ` Hui Zhu
2010-01-21 13:58 ` Jan Kratochvil
2010-01-21 16:34 ` Tom Tromey
2010-01-21 17:17 ` Doug Evans
2010-01-25 4:22 ` Jan Kratochvil
2010-01-28 21:37 ` Jan Kratochvil [this message]
2010-01-28 21:39 ` Doug Evans
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20100128213708.GA30978@host0.dyn.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox