[Lldb-commits] [lldb] [lldb][DWARF] Only log address range error to verbose channel (PR #144037)

Michael Buch via lldb-commits lldb-commits at lists.llvm.org
Fri Jun 13 02:32:25 PDT 2025


https://github.com/Michael137 updated https://github.com/llvm/llvm-project/pull/144037

>From 3a815c2f60cd605fd4c2903f26d4e98f5c73a007 Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 13 Jun 2025 10:20:27 +0100
Subject: [PATCH 1/2] [lldb][DWARF] Only log address range error to verbose
 channel

Currently `LLDB_LOG_ERROR` always logs to the "always-on" channel (which
prints to the console; this started with TBD).

Attaching to LLDB spams the console with a bunch of these messages:
```
...
2025-06-13 10:15:09.965660+0100 lldb[40872:3936672] [lldb] DIE(0x240901): DIE has no address range information
2025-06-13 10:15:09.965667+0100 lldb[40872:3936672] [lldb] DIE(0x240925): DIE has no address range information
2025-06-13 10:15:09.965672+0100 lldb[40872:3936672] [lldb] DIE(0x240942): DIE has no address range information
2025-06-13 10:15:09.965679+0100 lldb[40872:3936672] [lldb] DIE(0x24095e): DIE has no address range information
2025-06-13 10:15:09.965686+0100 lldb[40872:3936672] [lldb] DIE(0x240981): DIE has no address range information
2025-06-13 10:15:09.965694+0100 lldb[40872:3936672] [lldb] DIE(0x240993): DIE has no address range information
2025-06-13 10:15:09.965701+0100 lldb[40872:3936672] [lldb] DIE(0x2409a2): DIE has no address range information
...
```

AFAIU this is not a fatal error, so this patch downgrades it from
"always-on" by logging only in "verbose" mode.

It still seems pretty aggressive to log all `LLDB_LOG_ERROR` messages to
the console, but this is a stop-gap until we want to do something about
it.
---
 lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 5196ce89a2c13..4d091f4deeabe 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -617,7 +617,7 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
         for (const auto &r : *ranges)
           debug_aranges->AppendRange(GetOffset(), r.LowPC, r.HighPC);
       } else {
-        LLDB_LOG_ERROR(log, ranges.takeError(), "DIE({1:x}): {0}", GetOffset());
+        LLDB_LOG_ERRORV(log, ranges.takeError(), "DIE({1:x}): {0}", GetOffset());
       }
     }
 

>From 4e1fe60cc1b5aeae00065698ad7b0b30821cb9fe Mon Sep 17 00:00:00 2001
From: Michael Buch <michaelbuch12 at gmail.com>
Date: Fri, 13 Jun 2025 10:32:16 +0100
Subject: [PATCH 2/2] fixup! clang-format

---
 lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
index 4d091f4deeabe..9f0642dea3a35 100644
--- a/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
+++ b/lldb/source/Plugins/SymbolFile/DWARF/DWARFDebugInfoEntry.cpp
@@ -617,7 +617,8 @@ void DWARFDebugInfoEntry::BuildFunctionAddressRangeTable(
         for (const auto &r : *ranges)
           debug_aranges->AppendRange(GetOffset(), r.LowPC, r.HighPC);
       } else {
-        LLDB_LOG_ERRORV(log, ranges.takeError(), "DIE({1:x}): {0}", GetOffset());
+        LLDB_LOG_ERRORV(log, ranges.takeError(), "DIE({1:x}): {0}",
+                        GetOffset());
       }
     }
 



More information about the lldb-commits mailing list