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

Eric Christopher echristo at apple.com
Wed Jul 4 13:05:34 PDT 2012


On Jul 4, 2012, at 1:13 AM, Alexey Samsonov wrote:

> 
> 
> 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?

None of the above :) I meant actually running the gdb test suite with clang before and after the patch.

-eric

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120704/376f91d7/attachment.html>


More information about the llvm-commits mailing list