[LLVMbugs] [Bug 11073] New: Debug info not correctly generated for function arguments.

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Wed Oct 5 14:24:56 PDT 2011


http://llvm.org/bugs/show_bug.cgi?id=11073

           Summary: Debug info not correctly generated for function
                    arguments.
           Product: clang
           Version: trunk
          Platform: PC
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: P
         Component: LLVM Codegen
        AssignedTo: unassignedclangbugs at nondot.org
        ReportedBy: anders at 0x63.nu
                CC: llvmbugs at cs.uiuc.edu


Created an attachment (id=7408)
 --> (http://llvm.org/bugs/attachment.cgi?id=7408)
Patch

Documentation
(http://llvm.org/docs/SourceLevelDebugging.html#format_composite_type) says:
"The first member of subroutine (tag = DW_TAG_subroutine_type) type elements is
the return type for the subroutine. The remaining elements are the formal
arguments to the subroutine."

But for example compiling this function:

int somefunc(char *x, int y, double z) {
    return y;
}

compiles into the following debuginfo:

!llvm.dbg.sp = !{!0}

!0 = metadata !{i32 589870, i32 0, metadata !1, metadata !"somefunc", metadata
!"somefunc", metadata !"", metadata !1, i32 4, metadata !3, i1 false, i1 true,
i32 0, i32 0, i32 0, i32 256, i1 false, i32 (i8*, i32, double)* @somefunc} ; [
DW_TAG_subprogram ]
...
!3 = metadata !{i32 589845, metadata !1, metadata !"", metadata !1, i32 0, i64
0, i64 0, i32 0, i32 0, i32 0, metadata !4, i32 0, i32 0} ; [
DW_TAG_subroutine_type ]
!4 = metadata !{metadata !5}
!5 = metadata !{i32 589860, metadata !2, metadata !"int", null, i32 0, i64 32,
i64 32, i64 0, i32 0, i32 5} ; [ DW_TAG_base_type ]


See how !4 only contains the return type and not the arguments as the
documentation specifies.

With the attached patch applied the behaviuor is as documented.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list