summaryrefslogtreecommitdiff
path: root/lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
diff options
context:
space:
mode:
authorAdrian Prantl <aprantl@apple.com>2024-09-27 16:32:35 -0700
committerGitHub <noreply@github.com>2024-09-27 16:32:35 -0700
commit49372d1cccf50f404d52d40ae4b663db5604eb2c (patch)
treebf1c04f14b908bb46d6352647e1d1af37450969c /lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
parent84fdfb9ca63ee4304b486d7e85545ee4e1a46f5d (diff)
[lldb] Inline expression evaluator error visualization (#106470)
This patch is a reworking of Pete Lawrence's (@PortalPete) proposal for better expression evaluator error messages: https://github.com/llvm/llvm-project/pull/80938 Before: ``` $ lldb -o "expr a+b" (lldb) expr a+b error: <user expression 0>:1:1: use of undeclared identifier 'a' a+b ^ error: <user expression 0>:1:3: use of undeclared identifier 'b' a+b ^ ``` After: ``` (lldb) expr a+b ^ ^ │ ╰─ error: use of undeclared identifier 'b' ╰─ error: use of undeclared identifier 'a' ``` This eliminates the confusing `<user expression 0>:1:3` source location and avoids echoing the expression to the console again, which results in a cleaner presentation that makes it easier to grasp what's going on. You can't see it here, bug the word "error" is now also in color, if so desired. Depends on https://github.com/llvm/llvm-project/pull/106442.
Diffstat (limited to 'lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py')
-rw-r--r--lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py b/lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
index 71df90e6a6d1..3be93dedfd11 100644
--- a/lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
+++ b/lldb/test/API/lang/cpp/template-function/TestTemplateFunctions.py
@@ -21,7 +21,8 @@ class TemplateFunctionsTestCase(TestBase):
"expr b1 <=> b2",
error=True,
substrs=[
- "warning: <user expression 0>:1:4: '<=>' is a single token in C++20; add a space to avoid a change in behavior"
+ "warning:",
+ "'<=>' is a single token in C++20; add a space to avoid a change in behavior",
],
)