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

J. Ryan Stinnett via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 2 07:00:05 PDT 2023


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

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.

>From 110d980104ea52e7849af1dae777880f8023537e Mon Sep 17 00:00:00 2001
From: "J. Ryan Stinnett" <jryans at gmail.com>
Date: Thu, 2 Nov 2023 13:06:08 +0000
Subject: [PATCH] [DebugInfo] Use human-friendly printing for DWARF column
 attributes

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.
---
 llvm/lib/DebugInfo/DWARF/DWARFDie.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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



More information about the llvm-commits mailing list