From Richard.Relph@amd.com  Mon Aug 29 18:54:57 2011
From: Richard.Relph@amd.com (Relph, Richard)
Date: Mon, 29 Aug 2011 13:54:57 -0500
Subject: [Dwarf-Discuss] Testing debug information
Message-ID: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>

Does anyone know of any way to test the accuracy of debug information automatically?
Any comments at all on how people test debug information quality would be greatly appreciated.

Thanks,

Richard Relph
MTS | Stream Compute SW | AMD
o. 408.749.6659

[cid:image001.jpg at 01CC6642.7963CC80]


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20110829/1b353bbe/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.jpg
Type: image/jpeg
Size: 6743 bytes
Desc: image001.jpg
URL: <http://lists.dwarfstd.org/private.cgi/dwarf-discuss-dwarfstd.org/attachments/20110829/1b353bbe/attachment.jpg>


From davea42@earthlink.net  Mon Aug 29 20:06:52 2011
From: davea42@earthlink.net (David Anderson)
Date: Mon, 29 Aug 2011 13:06:52 -0700
Subject: [Dwarf-Discuss] Testing debug information
In-Reply-To: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>
References: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>
Message-ID: <4E5BF15C.7060609@earthlink.net>

On 08/29/2011 11:54 AM, Relph, Richard wrote:
>
> Does anyone know of any way to test the accuracy of debug information 
> automatically?
>
> Any comments at all on how people test debug information quality would 
> be greatly appreciated.
>
>

I have a decently large set of objects (collected over rather a lot of 
years)  and I run each
libdwarf change through the 'latest' and 'changed' version  of 
libdwarf/dwarfdump and verify
that differences in the text output are appropriate (verify by looking 
at them).   Sometimes
looking at the differences is...pretty hard.

I (when at SGI some years ago) and others (recently) have  provided examples
of problematic DWARF and  some additional correctness tests in 
libdwarf/dwarfdump.

I considered keeping 'correct' text of dwarfdump output for comparison, 
but the size
was...overwhelming.  So I run all tests  twice, using (to the best of my 
ability) all options.
Scripted, of course.

It is all in the source and the regression tests (see 
reality.sgiweb.org/davea/dwarf.html and
the links to git repositories of all this).

David Anderson

-- 
The secret of eternal youth is arrested development.  -- Alice Roosevelt Longworth




From tromey@redhat.com  Mon Aug 29 20:17:02 2011
From: tromey@redhat.com (Tom Tromey)
Date: Mon, 29 Aug 2011 14:17:02 -0600
Subject: [Dwarf-Discuss] Testing debug information
In-Reply-To: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>
	(Richard Relph's message of "Mon, 29 Aug 2011 13:54:57 -0500")
References: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>
Message-ID: <m3fwkkdlc1.fsf@fleche.redhat.com>

Richard> Does anyone know of any way to test the accuracy of debug information
Richard> automatically?

GCC has test cases which run gdb and have it print variables at various
locations; the source for the tests is annotated so that the expected
values are known.

I think Jakub also wrote a GCC Summit paper that looked at GCC debug
output see how much debuginfo was dropped at various levels of
optimization.  I don't have a link offhand.

Tom



From Richard.Relph@amd.com  Tue Aug 30 17:03:54 2011
From: Richard.Relph@amd.com (Relph, Richard)
Date: Tue, 30 Aug 2011 12:03:54 -0500
Subject: [Dwarf-Discuss] Testing debug information
In-Reply-To: <4E5BF15C.7060609@earthlink.net>
References: <7691DC9FC60C9E4F88A0BBCA628F55FF05236E2CA5@sausexmbp02.amd.com>
	<4E5BF15C.7060609@earthlink.net>
Message-ID: <7691DC9FC60C9E4F88A0BBCA628F55FF05237FE5B7@sausexmbp02.amd.com>

David,
    Thanks. Comparing "before" (or "reference") and "after" is something I came up with as well. And I certainly understand looking at the diffs manually can be unfun (I guess that makes it "real work" ;-)
    My main interest is verifying the compiler output, that the DWARF it emits does indeed describe the code it emitted in terms of the source it was given.
    Ideally, I was hoping someone had an "automatic" debugger, that "knew" - out-of-band - the 'correct' single-step sequence and variable values at each point (the reference) that could be compared to the values obtained through a trusted debugger to confirm that the DWARF and the code 'matched'.
    Having to manually validate DWARF against generated code because the compiler chose to put a variable in this register instead of that one just doesn't sound productive. Especially if the compiler is undergoing rapid change.
    Of course, to be truly valuable, the debugger would have to be platform, language, and target independent. And while gdb comes closest to that ideal, there's not much hope of getting it working against, oh, say OpenCL on an AMD GPU. ;-)

Thanks,
Richard



> -----Original Message-----
> From: dwarf-discuss-bounces at lists.dwarfstd.org [mailto:dwarf-discuss-
> bounces at lists.dwarfstd.org] On Behalf Of David Anderson
> Sent: Monday, August 29, 2011 1:07 PM
> To: dwarf-discuss at lists.dwarfstd.org
> Subject: Re: [Dwarf-Discuss] Testing debug information
> 
> On 08/29/2011 11:54 AM, Relph, Richard wrote:
> >
> > Does anyone know of any way to test the accuracy of debug information
> > automatically?
> >
> > Any comments at all on how people test debug information quality
> would
> > be greatly appreciated.
> >
> >
> 
> I have a decently large set of objects (collected over rather a lot of
> years)  and I run each
> libdwarf change through the 'latest' and 'changed' version  of
> libdwarf/dwarfdump and verify
> that differences in the text output are appropriate (verify by looking
> at them).   Sometimes
> looking at the differences is...pretty hard.
> 
> I (when at SGI some years ago) and others (recently) have  provided
> examples
> of problematic DWARF and  some additional correctness tests in
> libdwarf/dwarfdump.
> 
> I considered keeping 'correct' text of dwarfdump output for comparison,
> but the size
> was...overwhelming.  So I run all tests  twice, using (to the best of
> my
> ability) all options.
> Scripted, of course.
> 
> It is all in the source and the regression tests (see
> reality.sgiweb.org/davea/dwarf.html and
> the links to git repositories of all this).
> 
> David Anderson
> 
> --
> The secret of eternal youth is arrested development.  -- Alice
> Roosevelt Longworth
> 
> _______________________________________________
> Dwarf-Discuss mailing list
> Dwarf-Discuss at lists.dwarfstd.org
> http://lists.dwarfstd.org/listinfo.cgi/dwarf-discuss-dwarfstd.org





