From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25056 invoked by alias); 8 Oct 2004 22:16:16 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 25047 invoked from network); 8 Oct 2004 22:16:14 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sourceware.org with SMTP; 8 Oct 2004 22:16:14 -0000 Received: from drow by nevyn.them.org with local (Exim 4.34 #1 (Debian)) id 1CG326-0000RU-KS; Fri, 08 Oct 2004 18:16:14 -0400 Date: Fri, 08 Oct 2004 22:16:00 -0000 From: Daniel Jacobowitz To: Michael Snyder Cc: gdb-patches@sources.redhat.com Subject: Re: [rfa] Dwarf2 testsuite Message-ID: <20041008221614.GA1584@nevyn.them.org> Mail-Followup-To: Michael Snyder , gdb-patches@sources.redhat.com References: <20041008183500.GA6625@nevyn.them.org> <4166FAD8.9090301@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4166FAD8.9090301@redhat.com> User-Agent: Mutt/1.5.5.1+cvs20040105i X-SW-Source: 2004-10/txt/msg00164.txt.bz2 On Fri, Oct 08, 2004 at 01:38:48PM -0700, Michael Snyder wrote: > Daniel Jacobowitz wrote: > >This patch adds a sample test for DWARF-2 unit testing. It requires: > > - gas, for the .uleb128/.sleb128 directives among other things > > - ELF; it could probably be made to work on non-ELF dwarf2 systems > > but I don't know what changes would be necessary. Perhaps those > > should be tested separately. > > > >I haven't tried, but I wrote it with the intent that it would not care > >about > >the host beyond that; it should run on 64-bit ELF targets OK. > > > >It just includes a trivial test containing hand-written DIEs for a single > >CU. This one file I annotated exhaustively, and let me tell you, it was > >exhausting; for future tests I will allow them to be self-documenting (the > >comments don't say anything that compiling the file and running readelf > >won't tell you). > > > >The test itself just demonstrates that the dwarf2 reader isn't completely > >busted. But more interesting tests could be easily added. > > > >Look OK? Suggestions? > > > > Looks exhausting. I'm glad you're doing this. > > Dan, what would you think about (somebody) writing a tool > that could read some sort of description (eg. what's in > your comments), and generate the dwarf2 recs? Sort of a > simple compiler that accepts, in effect, the dwarf2 spec > as input? Would that be, perhaps, less of an effort than > writing a sufficiently large subset of tests by hand? Do it! Do it! Do it! Does that answer your question? Yes, it would absolutely be less effort. It would be a little tricky. Done properly could encapsulate most of the time-consuming bits - in particular, it could handle testing both 32-bit and 64-bit mode, and it could automate (for the common cases at least) the nasty bits of .debug_abbrev and .debug_line. I'm not sure what it would output. Maybe a text file full of .byte directives, so that we could #include it from an asm file with the labels referenced in it. -- Daniel Jacobowitz