This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: RFA: handle "MiniDebuginfo" section
- From: Pedro Alves <palves at redhat dot com>
- To: Tom Tromey <tromey at redhat dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Fri, 09 Nov 2012 18:13:09 +0000
- Subject: Re: RFA: handle "MiniDebuginfo" section
- References: <87wqxuel5k.fsf@fleche.redhat.com>
There doesn't seem to be anything elf specific here. It seems to me this
should work fine with any other container, such as coff/pe in coff/pe, for
example. Can we move most of this code out of elf.c, or at least the
gross of it, even if elf_symfile_read remains unchanged? I'd suggest
putting it in a new file.
> +#ifdef HAVE_LIBLZMA
> +
> +/* Custom lzma_allocator.alloc so they use the gdb ones. */
> +
> +static void *
> +alloc_lzma (void *opaque, size_t nmemb, size_t size)
> +{
> + return xmalloc (nmemb * size);
> +}
> +
> +/* Custom lzma_allocator.free so they use the gdb ones. */
> +
> +static void
> +free_lzma (void *opaque, void *ptr)
> +{
> + xfree (ptr);
> +}
> +
> +/* It cannot be const due to the lzma library function prototypes. */
> +
> +static lzma_allocator gdb_lzma_allocator = { alloc_lzma, free_lzma, NULL};
Missing space after NULL.
(I find the "It" or "they" in these sentences confusing, but I don't
know whether that's just me and language barrier.)
> +/* Custom bfd_openr_iovec implementation to read compressed data from a
> + section. This keeps only the last decompressed block in memory to
Missing space after '.'.
> diff --git a/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp b/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp
> new file mode 100644
> index 0000000..e384412
> --- /dev/null
> +++ b/gdb/testsuite/gdb.dwarf2/dw2-gnu-debugdata.exp
Seems like this won't work with remote hosts as is. Can we make it use
"remote_file host delete", "remote_spawn host", etc.? If not, perhaps just
bail early if [is_remote host].
--
Pedro Alves