This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Patch to handle compressed sections
- From: Daniel Jacobowitz <drow at false dot org>
- To: Craig Silverstein <csilvers at google dot com>
- Cc: bauerman at br dot ibm dot com, gdb-patches at sourceware dot org
- Date: Tue, 1 Apr 2008 20:16:37 -0400
- Subject: Re: Patch to handle compressed sections
- References: <20080325230440.BF0623F25D6@localhost> <1206547779.29533.43.camel@localhost.localdomain> <20080326173918.E6D063F25E8@localhost> <20080326180132.GB10127@caradoc.them.org> <20080326183538.346243F25E8@localhost> <20080401140953.GD12753@caradoc.them.org> <20080402000638.1BD1B3F25EF@localhost>
On Tue, Apr 01, 2008 at 05:06:38PM -0700, Craig Silverstein wrote:
> My plan is to name the new sections .zdebug_foo. They will start with
> a 5-byte header that indicates what compression format is being used,
> and what version of the format. For now, only ZLIB1 will be
> supported.
>
> Following the ZLIB1 header-field will be an 8-byte length
> header-field, in big-endian order -- I know DWARF mostly uses leb128,
> but I don't want to add the complexity for people who just want to
> parse the header (which, technically, isn't part of dwarf :-) ).
> Plus, we don't care much about the space used here.
>
> Following the length will come the content, which is just a blob of
> data compressed by zlib.
>
> gdb will be changed to look for .zdebug_foo as an alternate to
> .debug_foo, and the section-reading code will decompress such sections
> at read-time.
>
> Does this sound like a reasonable plan? If so, I'll try to get a new
> patch later this week.
Yes, it sounds reasonable - give it a few days in case anyone else has
comments? I would have made different choices, but they're not
inherently superior.
(I'd have used a four-byte magic, and an object-file-endianness 64-bit
size; in particular the four-byte magic makes it easier to visually
see the size in section dumps.)
--
Daniel Jacobowitz
CodeSourcery