This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [3/4] RFC: add DWARF index support
On Tue, 06 Jul 2010 18:50:32 +0200, Tom Tromey wrote:
> 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:
[...]
> 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?
Frankly, I do not want to reinvent the optimizations for tiny, small, medium,
compact, large and huge memory models. :-) Any size should be 64bit and it is
a bug if it is not. I was reluctant to make review notes on more places using
`int' memory sizes in your patch. I find needlessly labor-expensive to
evaluate each memory size if it really can always fit in 32bit or not.
> 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.
With various filesystems and network filesystems having interesting timestamp
rules it would be best to avoid depending on it at all.
> One idea would be to store the build-id and only verify it if the
> objfile has a .note.gnu.build-id section.
Good point, I find .gdb-index file should have exactly the same verification
rules as the .debug file has. (That is crc32 if build-id is not available.)
Thanks,
Jan