[llvm] [DebugInfo] Use human-friendly printing for DWARF column attributes (PR #71062)

via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 07:00:35 PDT 2023


llvmbot wrote:


<!--LLVM PR SUMMARY COMMENT-->

@llvm/pr-subscribers-debuginfo

Author: J. Ryan Stinnett (jryans)

<details>
<summary>Changes</summary>

This prints DWARF attributes that describes source columns as base 10 integers for easier comprehension (via `llvm-dwarfdump` and similar tools) and matches the behaviour for source line attributes.

---
Full diff: https://github.com/llvm/llvm-project/pull/71062.diff


1 Files Affected:

- (modified) llvm/lib/DebugInfo/DWARF/DWARFDie.cpp (+2-1) 


``````````diff
diff --git a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
index 7af7ed8be7b4aff..fcedef8db82185c 100644
--- a/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
+++ b/llvm/lib/DebugInfo/DWARF/DWARFDie.cpp
@@ -147,7 +147,8 @@ static void dumpAttribute(raw_ostream &OS, const DWARFDie &Die,
 
   if (!Name.empty())
     WithColor(OS, Color) << Name;
-  else if (Attr == DW_AT_decl_line || Attr == DW_AT_call_line) {
+  else if (Attr == DW_AT_decl_line || Attr == DW_AT_decl_column ||
+           Attr == DW_AT_call_line || Attr == DW_AT_call_column) {
     if (std::optional<uint64_t> Val = FormValue.getAsUnsignedConstant())
       OS << *Val;
     else

``````````

</details>


https://github.com/llvm/llvm-project/pull/71062


More information about the llvm-commits mailing list