aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Prantl <adrian-prantl@users.noreply.github.com>2024-04-19 22:14:55 +0200
committerGitHub <noreply@github.com>2024-04-19 13:14:55 -0700
commit08163cd9d82690e808c28515523b5fd0923d7b38 (patch)
treea3e9a02617958984bf4b3f5aba4af621e2e2e3d1
parentc8e65e193d542464421ad4f9a9965d45b302ac0c (diff)
downloadllvm-08163cd9d82690e808c28515523b5fd0923d7b38.zip
llvm-08163cd9d82690e808c28515523b5fd0923d7b38.tar.gz
llvm-08163cd9d82690e808c28515523b5fd0923d7b38.tar.bz2
[lldb] Provide a better error message for missing symbols (#89433)
This adds a hint to the missing symbols error message to make it easier to understand what this means to users.
-rw-r--r--lldb/source/Expression/IRExecutionUnit.cpp4
-rw-r--r--lldb/test/API/lang/cpp/constructors/TestCppConstructors.py2
2 files changed, 4 insertions, 2 deletions
diff --git a/lldb/source/Expression/IRExecutionUnit.cpp b/lldb/source/Expression/IRExecutionUnit.cpp
index cb9bee8..07df8c5 100644
--- a/lldb/source/Expression/IRExecutionUnit.cpp
+++ b/lldb/source/Expression/IRExecutionUnit.cpp
@@ -431,7 +431,9 @@ void IRExecutionUnit::GetRunnableInfo(Status &error, lldb::addr_t &func_addr,
}
m_failed_lookups.clear();
-
+ ss.PutCString(
+ "\nHint: The expression tried to call a function that is not present "
+ "in the target, perhaps because it was optimized out by the compiler.");
error.SetErrorString(ss.GetString());
return;
diff --git a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
index 6724bfc..140877a 100644
--- a/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
+++ b/lldb/test/API/lang/cpp/constructors/TestCppConstructors.py
@@ -47,7 +47,7 @@ class TestCase(TestBase):
self.expect(
"expr ClassWithDeletedDefaultCtor().value",
error=True,
- substrs=["Couldn't look up symbols:"],
+ substrs=["Couldn't look up symbols:", "function missing"],
)
@skipIfWindows # Can't find operator new.