Skip to content

Commit b6a3144

Browse files
committed
[lldb] Provide a better error message for missing symbols (llvm#89433)
This adds a hint to the missing symbols error message to make it easier to understand what this means to users. [Reapplies an earlier patch with a test fix.] (cherry picked from commit 6a35ee8)
1 parent ef51a35 commit b6a3144

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

lldb/source/Expression/IRExecutionUnit.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -476,7 +476,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
476476
}
477477

478478
m_failed_lookups.clear();
479-
479+
ss.PutCString(
480+
"\nHint: The expression tried to call a function that is not present "
481+
"in the target, perhaps because it was optimized out by the compiler.");
480482
error.SetErrorString(ss.GetString());
481483

482484
return;

lldb/test/API/lang/cpp/constructors/TestCppConstructors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def test_constructors(self):
4747
self.expect(
4848
"expr ClassWithDeletedDefaultCtor().value",
4949
error=True,
50-
substrs=["Couldn't look up symbols:"],
50+
substrs=["Couldn't look up symbols:", "function", "optimized out"],
5151
)
5252

5353
@skipIfWindows # Can't find operator new.

0 commit comments

Comments
 (0)