From: Tom Tromey <tromey@redhat.com>
To: Jan Kratochvil <jan.kratochvil@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [3/4] RFC: add DWARF index support
Date: Tue, 06 Jul 2010 16:50:00 -0000 [thread overview]
Message-ID: <m38w5oeeqv.fsf@fleche.redhat.com> (raw)
In-Reply-To: <20100704181758.GA30603@host0.dyn.jankratochvil.net> (Jan Kratochvil's message of "Sun, 4 Jul 2010 20:17:58 +0200")
>>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
Tom> +/* All offsets in the index are of this type. It must be
Tom> + architecture-independent. */
Tom> +typedef uint32_t offset_type;
Jan> It should be 64bit, Fedora already has to carry 64bit obstack patch
Jan> for >2GB .debug files. I have seen only an artificial reproducer
Jan> for >2GB .debug, no real world case, though.
Jan> http://sourceware.org/ml/libc-alpha/2007-01/msg00090.html
Yeah, thanks. I will fix this.
My thinking is that we only need 64 bit for CU offsets. It seems very
unlikely to me that an index file could be bigger than 4G (not 2G, since
the offsets are all unsigned).
Also I have been thinking a little about the 64 bit obstack patch. I
think we can avoid it by going a different route:
First, if we are mmap()ing debug sections, I doubt we need a 64 bit obstack.
The bulk of the data will just be mapped.
Second, if we have a section we cannot map (say it is compressed or
something), we could just malloc memory for it instead of using the
obstack. The last "read DWARF in the background" patch has the needed
infrastructure to make this work ok, basically having a destructor
function for sections in dwarf2read.c.
What do you think?
Tom> + 1. The file header. This is a sequence of values, of offset_type
Tom> + unless otherwise noted:
Jan> I would prefer there some simple magic (for file(1)).
Good idea, I will do that.
Tom> + [0] The version number. Currently 1.
Tom> + [1] The mtime of the objfile, as a 64-bit little-endian value.
Jan> Do you have some specific needs for storing timestamp into the file?
Jan> When such index files will be packaged by distros it may create needless
Jan> differences across various verifications. Isn't make(1)-like timestamp
Jan> dependency enough?
If the distro processes modify timestamps, then it seems like we also
could not rely on them to remain ordered.
The timestamp is only there to provide some assurance that the index
really indexes the debug file. I thought the size alone was not
enough -- but that some real checksum would be too slow.
One idea would be to store the build-id and only verify it if the
objfile has a .note.gnu.build-id section.
Another idea is to make the user use objcopy to put the new data into
the objfile. I am not very fond of this, though. In my experiments I
think objcopy had bugs dealing with separate debug files.
Tom
next prev parent reply other threads:[~2010-07-06 16:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-06-30 22:46 Tom Tromey
2010-07-04 18:18 ` Jan Kratochvil
2010-07-04 19:28 ` Jan Kratochvil
2010-07-06 16:50 ` Tom Tromey [this message]
2010-07-06 17:11 ` Jan Kratochvil
2010-07-06 17:31 ` Tom Tromey
2010-07-06 17:36 ` Jan Kratochvil
2010-07-06 17:35 ` Tom Tromey
2010-07-06 17:37 ` Jan Kratochvil
2010-07-08 17:01 ` Tom Tromey
2010-07-08 18:25 ` Eli Zaretskii
2010-07-08 20:35 ` Tom Tromey
2010-07-08 20:52 ` Eli Zaretskii
2010-07-08 17:02 ` 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=m38w5oeeqv.fsf@fleche.redhat.com \
--to=tromey@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=jan.kratochvil@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