Skip to content

Commit fbcabb4

Browse files
ashgtiadrian-prantl
authored andcommitted
[lldb-dap] Adjust the evaluate test to use a different lldb command. (llvm#116045)
Previously this used `var` as both an lldb command and variable in the source to validate the behavior of the 'auto' repl mode. However, `var` seems to occasionally fail in the CI test when attempting to print some c++ types. Instead switch the command and variable name to `list` which should not run the dynamic variable formatting code for c++ objects. This should fix llvm#116041. (cherry picked from commit c658d07)
1 parent cb55405 commit fbcabb4

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -101,9 +101,9 @@ def run_test_evaluate_expressions(
101101
if context == "repl":
102102
# In the repl context expressions may be interpreted as lldb
103103
# commands since no variables have the same name as the command.
104-
self.assertEvaluate("var", r"\(lldb\) var\n.*")
104+
self.assertEvaluate("list", r"\(lldb\) list\n.*")
105105
else:
106-
self.assertEvaluateFailure("var") # local variable of a_function
106+
self.assertEvaluateFailure("list") # local variable of a_function
107107

108108
self.assertEvaluateFailure("my_struct") # type name
109109
self.assertEvaluateFailure("int") # type name
@@ -162,7 +162,7 @@ def run_test_evaluate_expressions(
162162

163163
# Expressions at breakpoint 3, which is inside a_function
164164
self.continue_to_next_stop()
165-
self.assertEvaluate("var", "42")
165+
self.assertEvaluate("list", "42")
166166
self.assertEvaluate("static_int", "42")
167167
self.assertEvaluate("non_static_int", "43")
168168

@@ -176,13 +176,13 @@ def run_test_evaluate_expressions(
176176
if self.isExpressionParsedExpected():
177177
self.assertEvaluate("a_function", "0x.*a.out`a_function.*")
178178
self.assertEvaluate("a_function(1)", "1")
179-
self.assertEvaluate("var + 1", "43")
179+
self.assertEvaluate("list + 1", "43")
180180
self.assertEvaluate("foo_func", "0x.*a.out`foo_func.*")
181181
self.assertEvaluate("foo_var", "44")
182182
else:
183183
self.assertEvaluateFailure("a_function")
184184
self.assertEvaluateFailure("a_function(1)")
185-
self.assertEvaluateFailure("var + 1")
185+
self.assertEvaluateFailure("list + 1")
186186
self.assertEvaluateFailure("foo_func")
187187
self.assertEvaluateFailure("foo_var")
188188

lldb/test/API/tools/lldb-dap/evaluate/main.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ static int static_int = 42;
88

99
int non_static_int = 43;
1010

11-
int a_function(int var) {
12-
return var; // breakpoint 3
11+
int a_function(int list) {
12+
return list; // breakpoint 3
1313
}
1414

1515
struct my_struct {

0 commit comments

Comments
 (0)