This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: RFA: handle "MiniDebuginfo" section


> Fedora recently approved and committed the "MiniDebuginfo" feature:
> 
>     http://fedoraproject.org/wiki/Features/MiniDebugInfo

Looks pretty nice :)

> This patch adds support for this feature to gdb.  I think the
> implementation is pretty straightforward.  If you want to enable it, you
> will need the LZMA library:
> 
>     http://tukaani.org/lzma/

I went to the website to see which formats it supports, and was
surprised to read:

    Users of LZMA Utils should move to XZ Utils. X

Shouldn't we just switch to xzutils instead?

> 2012-11-09  Alexander Larsson  <alexl@redhat.com>
> 	    Jan Kratochvil  <jan.kratochvil@redhat.com>
> 
> 	* elfread.c (alloc_lzma, free_lzma): New functions.
> 	(gdb_lzma_allocator): New global.
> 	(struct lzma_stream): New.
> 	(lzma_open, lzma_pread, lzma_close, lzma_stat)
> 	(find_separate_debug_file_in_section): New functions.
> 	(elf_symfile_read): Call find_separate_debug_file_in_section if no
> 	other debuginfo is found.

Should we put the lzma-support code into its own file? I think it
would be cleaner, and also shows that this isn't really tied to ELF.
Perhaps there will be compressed sections in other file formats,
someday?

To avoid the #ifdef HAVE_LZMA, I might even provide two versions of the
file, one with the real implementation, and one with the phony one, and
have the configure choose which one to link in. This isn't what we've
been doing in the past (iconv, python), so to be taken with a grain of
salt. I think it'll make the code a little easier to navigate, however.

> 	* configure.ac: Check for lzma.
> 	* configure, config.in: Rebuild.
> 	* Makefile.in (LIBLZMA): New variable.
> 	(CLIBS): Include LIBLZMA.
> 	* NEWS: Mention mini debuginfo feature.

Otherwise, nicely clean and documented code!


-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]