<html>
<head>
<base href="https://bugs.llvm.org/">
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - DW_AT_LLVM_isysroot isn't useful"
href="https://bugs.llvm.org/show_bug.cgi?id=44213">44213</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>DW_AT_LLVM_isysroot isn't useful
</td>
</tr>
<tr>
<th>Product</th>
<td>libraries
</td>
</tr>
<tr>
<th>Version</th>
<td>trunk
</td>
</tr>
<tr>
<th>Hardware</th>
<td>PC
</td>
</tr>
<tr>
<th>OS</th>
<td>All
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>enhancement
</td>
</tr>
<tr>
<th>Priority</th>
<td>P
</td>
</tr>
<tr>
<th>Component</th>
<td>DebugInfo
</td>
</tr>
<tr>
<th>Assignee</th>
<td>unassignedbugs@nondot.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>aprantl@apple.com
</td>
</tr>
<tr>
<th>CC</th>
<td>jdevlieghere@apple.com, keith.walker@arm.com, llvm-bugs@lists.llvm.org, paul_robinson@playstation.sony.com
</td>
</tr></table>
<p>
<div>
<pre>Currently an imported Clang module is represented in DWARF as
DW_TAG_module
... other atributes ...
DW_AT_LLVM_isysroot ("/Applications/Xcode.app/.../MacOSX10.15.sdk")
While the sysroot is one of the factors necessary to import a
module in the debugger, in its current form this isn't
particularly useful. First, the sysroot is a property of the
compile unit, not the module, so storing it in all DW_TAG_module DIEs
is redundant. Further, like the resource directory, it will often
be in a different location on the machine where the debugger is
compared to the machine the program was built with. We could work
around this problem by using -fdebug-prefix-map, but I think I
have an even more elegant solution:
To make it more useful, I'm proposing to
1. move DW_AT_LLVM_isysroot to DW_TAG_compile_unit and
2. on Darwin, augment it with a new attribute
DW_AT_LLVM_sdk ("MacOSX10.15.sdk")
3. rename DW_AT_LLVM_isysroot to DW_AT_LLVM_sysroot
(the "i" is an artifact of the command line interface)
4. Use -fdebug-prefix-map to replace all occurrences of the
sysroot and resource directory with a placeholder,
e.g., "$CLANG_SYSROOT" and "$CLANG_RESOURCEDIR". Perhaps this
can even be on by default.
This will allow LLDB to find a matching SDK on the machine it
runs on without hardcoding a path to it.
After these steps, the debug info will look like:
DW_TAG_compile_unit
... other atributes ...
DW_AT_LLVM_sdk ("MacOSX10.15.sdk")
DW_AT_LLVM_sysroot ("${CLANG_SYSROOT}")
DW_TAG_module
... other atributes ...
DW_AT_name ("Darwin")
DW_AT_LLVM_include_path ("${CLANG_SYSROOT}/usr/include")
which will make both remote debuggers and people interested in reproducible
builds happy.</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are on the CC list for the bug.</li>
</ul>
</body>
</html>