From 0bbe93f4419d9ff764e905a7902dc1ef320ce1b7 Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Wed, 14 Feb 2018 16:50:10 -0800 Subject: [PATCH 1/2] Ensure stackFrame and levels in stack request are optional --- ptvsd/wrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py index d346fcba..898fc013 100644 --- a/ptvsd/wrapper.py +++ b/ptvsd/wrapper.py @@ -518,9 +518,9 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel): def on_stackTrace(self, request, args): # TODO: docstring tid = int(args['threadId']) - startFrame = int(args['startFrame']) - levels = int(args['levels']) - + startFrame = int(args['startFrame']) if 'startFrame' in args else 0 + levels = int(args['levels']) if 'levels' in args else 0 +'' tid = self.thread_map.to_pydevd(tid) with self.stack_traces_lock: xframes = self.stack_traces[tid] From 74ce2e90be731abcc83af433178972f6e59c690a Mon Sep 17 00:00:00 2001 From: Don Jayamanne Date: Thu, 15 Feb 2018 09:46:40 -0800 Subject: [PATCH 2/2] resolved code review comments --- ptvsd/wrapper.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ptvsd/wrapper.py b/ptvsd/wrapper.py index 898fc013..70ededf6 100644 --- a/ptvsd/wrapper.py +++ b/ptvsd/wrapper.py @@ -518,9 +518,9 @@ class VSCodeMessageProcessor(ipcjson.SocketIO, ipcjson.IpcChannel): def on_stackTrace(self, request, args): # TODO: docstring tid = int(args['threadId']) - startFrame = int(args['startFrame']) if 'startFrame' in args else 0 - levels = int(args['levels']) if 'levels' in args else 0 -'' + startFrame = int(args.get('startFrame', 0)) + levels = int(args.get('levels', 0)) + tid = self.thread_map.to_pydevd(tid) with self.stack_traces_lock: xframes = self.stack_traces[tid]