[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
Thu Jul 5 03:47:15 PDT 2012


On Thu, Jul 5, 2012 at 12:05 AM, Eric Christopher <echristo at apple.com>wrote:

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

Oh, got it. Patched Clang passes two extra tests on my machine (and passes
all checks in gdb.opt/inline-locals.exp)

$ diff gdb.sum.1 gdb.sum.2
1c1
< Test Run By samsonov on Thu Jul  5 13:03:15 2012
---
> Test Run By samsonov on Thu Jul  5 14:10:19 2012
14276c14276
< FAIL: gdb.opt/inline-locals.exp: info args above bar (2)
---
> PASS: gdb.opt/inline-locals.exp: info args above bar (2)
14284c14284
< FAIL: gdb.opt/inline-locals.exp: info args above bar (3)
---
> PASS: gdb.opt/inline-locals.exp: info args above bar (3)
19803,19804c19803,19804
< # of expected passes 12566
< # of unexpected failures 3426
---
> # of expected passes 12568
> # of unexpected failures 3424

-- 
Alexey Samsonov, MSK
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20120705/50c48bbb/attachment.html>


More information about the llvm-commits mailing list