From a337ea8402002b59cc6f99984325946a5d183653 Mon Sep 17 00:00:00 2001 From: Simon Priest Date: Wed, 28 Nov 2018 11:12:09 +0000 Subject: [PATCH] Fixed "Load More Stack Frames" loading the wrong set of frames. When we get a request to load more frames, there's a `startFrame` property in the arguments which was previously ignored. --- UnityDebug/UnityDebugSession.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/UnityDebug/UnityDebugSession.cs b/UnityDebug/UnityDebugSession.cs index fcfedc1..e6c3919 100644 --- a/UnityDebug/UnityDebugSession.cs +++ b/UnityDebug/UnityDebugSession.cs @@ -630,6 +630,7 @@ public override void StackTrace(Response response, dynamic arguments) { Log.Write($"UnityDebug: StackTrace: {response} ; {arguments}"); int maxLevels = GetInt(arguments, "levels", 10); + int startFrame = GetInt(arguments, "startFrame", 0); int threadReference = GetInt(arguments, "threadId", 0); WaitForSuspend(); @@ -653,7 +654,7 @@ public override void StackTrace(Response response, dynamic arguments) { totalFrames = bt.FrameCount; - for (var i = 0; i < Math.Min(totalFrames, maxLevels); i++) + for (var i = startFrame; i < Math.Min(totalFrames, startFrame + maxLevels); i++) { var frame = bt.GetFrame(i);