From: Tom Tromey <tromey@redhat.com>
To: Pedro Alves <palves@redhat.com>
Cc: Doug Evans <dje@google.com>, gdb-patches@sourceware.org
Subject: Re: RFA: handle "MiniDebuginfo" section
Date: Fri, 16 Nov 2012 19:51:00 -0000 [thread overview]
Message-ID: <87r4nttjgl.fsf@fleche.redhat.com> (raw)
In-Reply-To: <50A4CF6D.40207@redhat.com> (Pedro Alves's message of "Thu, 15 Nov 2012 11:18:05 +0000")
>>>>> "Pedro" == Pedro Alves <palves@redhat.com> writes:
Pedro> I disagree with artificially making this ELF only. What you find
Pedro> stuffed in a .gnu_debugdata section is just another file that
Pedro> would otherwise be loadable by gdb if it was separate on the
Pedro> filesystem. IOW, stuffing the file as compressed binary blob
Pedro> into .gnu_debugdata is just a replacement for making the file
Pedro> really separate on the file system. There's really nothing
Pedro> container-specific (coff/elf,whatnot) in this.
What if we require the contents to have the same BFD flavour as the
container? Like the appended. I think this might address Doug's
critique -- not sure -- while retaining both some flexibility and some
sanity.
Really, though, nobody is going to use this outside of ELF.
I think it mildly unlikely, though not impossible, that any distros
outside the Fedora universe will even pick it up.
Tom
diff --git a/gdb/minidebug.c b/gdb/minidebug.c
index 8e1362f..1b75ead 100644
--- a/gdb/minidebug.c
+++ b/gdb/minidebug.c
@@ -259,6 +259,9 @@ find_separate_debug_file_in_section (struct objfile *objfile)
asection *section;
bfd *abfd;
+ if (objfile->obfd == NULL)
+ return NULL;
+
section = bfd_get_section_by_name (objfile->obfd, ".gnu_debugdata");
if (section == NULL)
return NULL;
@@ -271,6 +274,14 @@ find_separate_debug_file_in_section (struct objfile *objfile)
if (!bfd_check_format (abfd, bfd_object))
{
+ warning (_("Cannot parse .gnu_debugdata section; not a BFD object"));
+ gdb_bfd_unref (abfd);
+ return NULL;
+ }
+
+ if (bfd_get_flavour (objfile->obfd) != bfd_get_flavour (abfd))
+ {
+ warning (_("Cannot parse .gnu_debugdata section; wrong file format"));
gdb_bfd_unref (abfd);
return NULL;
}
next prev parent reply other threads:[~2012-11-16 19:51 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-09 17:33 Tom Tromey
2012-11-09 18:07 ` Eli Zaretskii
2012-11-09 18:13 ` Pedro Alves
2012-11-09 21:28 ` Tom Tromey
2012-11-13 12:56 ` Pedro Alves
2012-11-13 15:26 ` Pedro Alves
2012-11-13 18:32 ` Tom Tromey
2012-11-09 18:23 ` Joel Brobecker
2012-11-09 18:53 ` Pedro Alves
2012-11-09 19:13 ` Tom Tromey
2012-11-12 16:04 ` Tom Tromey
2012-11-12 17:04 ` Joel Brobecker
2012-11-12 18:24 ` Tom Tromey
2012-11-12 16:28 ` Tom Tromey
2012-11-13 18:36 ` Tom Tromey
2012-11-13 18:42 ` Eli Zaretskii
2012-11-13 19:12 ` Pedro Alves
2012-11-13 20:57 ` Tom Tromey
2012-11-14 16:13 ` Tom Tromey
2012-11-14 16:19 ` Pedro Alves
2012-11-14 16:59 ` Tom Tromey
2012-11-14 19:37 ` Doug Evans
2012-11-14 22:12 ` Joel Brobecker
2012-11-15 11:18 ` Pedro Alves
2012-11-16 19:51 ` Tom Tromey [this message]
2012-11-19 14:41 ` Pedro Alves
2012-11-26 19:21 ` Tom Tromey
2012-11-26 22:24 ` Andrew Pinski
2012-11-27 2:23 ` Tom Tromey
2012-11-29 19:19 ` Ulrich Weigand
2012-11-29 19:23 ` Tom Tromey
2012-11-29 19:33 ` Ulrich Weigand
2012-11-29 20:51 ` Tom Tromey
2012-11-30 14:05 ` Ulrich Weigand
2012-11-30 20:59 ` Tom Tromey
2012-12-05 17:09 ` Ulrich Weigand
2012-12-11 16:42 ` Yufeng Zhang
2012-11-16 20:04 ` Tom Tromey
2012-11-12 21:26 ` Doug Evans
2012-11-13 17:43 ` Tom Tromey
2012-11-13 15:44 ` Jan Kratochvil
2012-11-13 18:34 ` Tom Tromey
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=87r4nttjgl.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=dje@google.com \
--cc=gdb-patches@sourceware.org \
--cc=palves@redhat.com \
/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