From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8860 invoked by alias); 9 Nov 2012 18:13:21 -0000 Received: (qmail 8848 invoked by uid 22791); 9 Nov 2012 18:13:20 -0000 X-SWARE-Spam-Status: No, hits=-7.8 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_YM X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 09 Nov 2012 18:13:11 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id qA9IDBwX009335 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Fri, 9 Nov 2012 13:13:11 -0500 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id qA9ID91E031622; Fri, 9 Nov 2012 13:13:10 -0500 Message-ID: <509D47B5.6020302@redhat.com> Date: Fri, 09 Nov 2012 18:13:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Tom Tromey CC: gdb-patches@sourceware.org Subject: Re: RFA: handle "MiniDebuginfo" section References: <87wqxuel5k.fsf@fleche.redhat.com> In-Reply-To: <87wqxuel5k.fsf@fleche.redhat.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2012-11/txt/msg00253.txt.bz2 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