[LLVMbugs] [Bug 22054] New: DWARF Debug info out of sync with source

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Dec 29 15:05:26 PST 2014


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

            Bug ID: 22054
           Summary: DWARF Debug info out of sync with source
           Product: clang
           Version: unspecified
          Hardware: Macintosh
                OS: All
            Status: NEW
          Severity: normal
          Priority: P
         Component: -New Bugs
          Assignee: unassignedclangbugs at nondot.org
          Reporter: cooper at mountainstorm.co.uk
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified

I've noticed that the source info in the XNU debug symbols (compiled with
Clang) appear out of sync with the source code.

I've tried raising this with Apple; bug 15971321; but their response doesn't
make any sense 'The open source files we publish might not have all the
contents that we ship in the OS.' ... the problem isn't that files are missing;
but that they are out of sync.

As far as I can see there are two explanations of what I'm seeing:
1. Clang is producing incorrect debug information
2. Apple are (and have been for a while) patching core XNU source files prior
to building them.

I can't see why they would do 2. so I'm left suspecting that the problem lies
with Clang.

Can you guys help?

Rich

---

Summary:
The line numbers in the KernelDebugKit DWARF debug information appears to
diverge from the source in some cases.

As a result, in large files the debug information does not match the xnu source
code.

Steps to Reproduce:
1. dwarfdump -a /Volumes/KernelDebugKit/DEBUG_Kernel/mach_kernel.dSYM | grep -A
2 -B 2 /xnu-2422.1.72/osfmk/kern/bsd_kern.c
2. Open xnu-2422.1.72/osfmk/kern/bsd_kern.c
3. Notice that the initial functions/types match the lines described in the
dwarf debug info
4. The two diverge at; get_task_pmap (on line 327 in the source), but the
dwarfdebug info claims its on line 331)
5. The two diverge further and other files e.g. task.c; have larger
discrepancies 

Expected Results:
The 'AT_decl_line( 331 )' DWARF info should match the source i.e. line 327

Actual Results:
The 'AT_decl_line( 331 )' DWARF info differs from the source i.e. line 327

Version:
@(#)PROGRAM:dwarfdump  PROJECT:dwarfutils-106.2
xnu 2422.1.72 (OSX 10.9.1)

You can also reproduce this with other kernel symbols/source; it still affects
10.10.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-bugs/attachments/20141229/cd0650ae/attachment.html>


More information about the llvm-bugs mailing list