Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -987,17 +987,23 @@ def request_writeMemory(self, memoryReference, data, offset=0, allowPartial=Fals
}
return self._send_recv(command_dict)

def request_evaluate(self, expression, frameIndex=0, threadId=None, context=None):
def request_evaluate(
self,
expression: str,
frameIndex=0,
threadId: Optional[int] = None,
context: Optional[
Literal["watch", "repl", "hover", "clipboard", "variables"]
] = None,
) -> Optional[Response]:
stackFrame = self.get_stackFrame(frameIndex=frameIndex, threadId=threadId)
if stackFrame is None:
return []
args_dict = {
"expression": expression,
"frameId": stackFrame["id"],
}
if context:
args_dict["context"] = context
command_dict = {
command_dict: Request = {
"command": "evaluate",
"type": "request",
"arguments": args_dict,
Expand Down
2 changes: 0 additions & 2 deletions lldb/test/API/tools/lldb-dap/cancel/TestDAP_cancel.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@
Test lldb-dap cancel request
"""

import time

from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
import lldbdap_testcase
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ def run_test_evaluate_expressions(
self.assertEvaluate("var1", "20", want_type="int")
# Empty expression should equate to the previous expression.
if context == "repl":
self.assertEvaluate("p var1", "20")
self.assertEvaluate("", "20")
else:
self.assertEvaluateFailure("")
Expand Down
Loading
Loading