[llvm-commits] PATCH: Fix DebugInfo codegen so that it doesn't duplicate debug info entries for variables in inlined functions (PR13202)

Alexey Samsonov samsonov at google.com
Wed Jul 4 01:13:40 PDT 2012


On Wed, Jul 4, 2012 at 1:44 AM, Eric Christopher <echristo at apple.com> wrote:

>
> On Jun 29, 2012, at 10:24 AM, Alexey Samsonov <samsonov at google.com> wrote:
>
> > Hi!
> >
> > DwarfDebug class can generate the same (inlined) DIVariable twice:
> > 1) when trying to find abstract debug variable for a concrete inlined
> instance
> > 2) when explicitly collecting info for variables that were optimized out.
> >
> > Duplicated DIEs for variables confuses e.g. gdb (it shows two identical
> function arguments).
> > I've attached the proposed little patch and a testcase. Please take a
> look.
> >
> > (more context - http://llvm.org/bugs/show_bug.cgi?id=13202)
>
> Looks ok, but please:
>
> a) Add a comment as to what's going on and point to the other use of
> cleanseInlinedVariable,
>

Added a comment.


> b) Run it on a testsuite like gdb or lldb as well (or if you have let me
> know how it went).
>
>
I've checked in debuginfo-tests and run them as well with make check-all.
It passed except for one test:
/home/samsonov/llvm-project/llvm2/tools/clang/test/debuginfo-tests/forward-declare-class.cpp:9:11:
error: expected string not found in input
// CHECK: type = struct A {
          ^
/home/samsonov/llvm-project/llvm2/build/tools/clang/test/debuginfo-tests/Output/forward-declare-class.cpp.gdb.output:1:1:
note: scanning from here
type = class A {
^
--
"type = class A" seems to be a correct line, comment in the test case tells
that this test is a workaround for gdb bug. Is it possible
that I have the gdb version with this bug fixed?

Or did you mean the tests from LNT-based test-suite infrastructure?

-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120704/c9c2d247/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zdiff.inlined-vars
Type: application/octet-stream
Size: 4759 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120704/c9c2d247/attachment.obj>


More information about the llvm-commits mailing list