summaryrefslogtreecommitdiffstats
path: root/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
diff options
context:
space:
mode:
authorSerhiy Redko <serhiy.redko@oculus.com>2019-12-07 20:11:35 -0800
committerNathan Lanza <nathan@lanza.io>2019-12-09 10:43:50 -0800
commit6dad5e441db5400a9716fd3c6f943ceeeecdfe4e (patch)
tree1bb6c034b712ca90d2177ce11458e2d9cd0bc290 /lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
parentd0ccd55151f52992912dbc12d04a027cf5e06d2f (diff)
downloadbcm5719-llvm-6dad5e441db5400a9716fd3c6f943ceeeecdfe4e.tar.gz
bcm5719-llvm-6dad5e441db5400a9716fd3c6f943ceeeecdfe4e.zip
The field ‘totalFrames’ which is total number of frames available, is mandatory in StackTraces response for VSCode extension that implements DAP and declares capability 'supportsDelayedStackTraceLoading':
"The debug adapter supports the delayed loading of parts of the stack, which requires that both the 'startFrame' and 'levels' arguments and the 'totalFrames' result of the 'StackTrace' request are supported." Lack of this field makes VSCode incorrectly display stack traces information D71034
Diffstat (limited to 'lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py')
-rw-r--r--lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py22
1 files changed, 18 insertions, 4 deletions
diff --git a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
index b0f69b283fd..9f8047d84d9 100644
--- a/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
+++ b/lldb/packages/Python/lldbsuite/test/tools/lldb-vscode/lldbvscode_testcase.py
@@ -132,15 +132,29 @@ class VSCodeTestCaseBase(TestBase):
key, key_path, d))
return value
- def get_stackFrames(self, threadId=None, startFrame=None, levels=None,
- dump=False):
+ def get_stackFrames_and_totalFramesCount(self, threadId=None, startFrame=None,
+ levels=None, dump=False):
response = self.vscode.request_stackTrace(threadId=threadId,
startFrame=startFrame,
levels=levels,
dump=dump)
if response:
- return self.get_dict_value(response, ['body', 'stackFrames'])
- return None
+ stackFrames = self.get_dict_value(response, ['body', 'stackFrames'])
+ totalFrames = self.get_dict_value(response, ['body', 'totalFrames'])
+ self.assertTrue(totalFrames > 0,
+ 'verify totalFrames count is provided by extension that supports '
+ 'async frames loading')
+ return (stackFrames, totalFrames)
+ return (None, 0)
+
+ def get_stackFrames(self, threadId=None, startFrame=None, levels=None,
+ dump=False):
+ (stackFrames, totalFrames) = self.get_stackFrames_and_totalFramesCount(
+ threadId=threadId,
+ startFrame=startFrame,
+ levels=levels,
+ dump=dump)
+ return stackFrames
def get_source_and_line(self, threadId=None, frameIndex=0):
stackFrames = self.get_stackFrames(threadId=threadId,
OpenPOWER on IntegriCloud