Skip to content

[lldb-dap] Adjust the evaluate test to use a different lldb command. #116045

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lldb/test/API/tools/lldb-dap/evaluate/TestDAP_evaluate.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,9 @@ def run_test_evaluate_expressions(
if context == "repl":
# In the repl context expressions may be interpreted as lldb
# commands since no variables have the same name as the command.
self.assertEvaluate("var", r"\(lldb\) var\n.*")
self.assertEvaluate("list", r"\(lldb\) list\n.*")
else:
self.assertEvaluateFailure("var") # local variable of a_function
self.assertEvaluateFailure("list") # local variable of a_function

self.assertEvaluateFailure("my_struct") # type name
self.assertEvaluateFailure("int") # type name
Expand Down Expand Up @@ -162,7 +162,7 @@ def run_test_evaluate_expressions(

# Expressions at breakpoint 3, which is inside a_function
self.continue_to_next_stop()
self.assertEvaluate("var", "42")
self.assertEvaluate("list", "42")
self.assertEvaluate("static_int", "42")
self.assertEvaluate("non_static_int", "43")

Expand All @@ -176,13 +176,13 @@ def run_test_evaluate_expressions(
if self.isExpressionParsedExpected():
self.assertEvaluate("a_function", "0x.*a.out`a_function.*")
self.assertEvaluate("a_function(1)", "1")
self.assertEvaluate("var + 1", "43")
self.assertEvaluate("list + 1", "43")
self.assertEvaluate("foo_func", "0x.*a.out`foo_func.*")
self.assertEvaluate("foo_var", "44")
else:
self.assertEvaluateFailure("a_function")
self.assertEvaluateFailure("a_function(1)")
self.assertEvaluateFailure("var + 1")
self.assertEvaluateFailure("list + 1")
self.assertEvaluateFailure("foo_func")
self.assertEvaluateFailure("foo_var")

Expand Down
4 changes: 2 additions & 2 deletions lldb/test/API/tools/lldb-dap/evaluate/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ static int static_int = 42;

int non_static_int = 43;

int a_function(int var) {
return var; // breakpoint 3
int a_function(int list) {
return list; // breakpoint 3
}

struct my_struct {
Expand Down
Loading