vscode icon indicating copy to clipboard operation
vscode copied to clipboard

Load More Stack Frames strange behavior

Open edumunoz opened this issue 10 years ago • 5 comments

  • VSCode Version: Version 1.0.0-alpha Commit 6ea1266160aa9eb3ed6e71a5099bec3952090037
  • OS Version: Ubuntu 14.04

Steps to Reproduce:

  1. Compile https://gist.github.com/edumunoz/6e2ca90d4b5d3dbfa5340576e79ac113 with g++ -g -std=c++11 -pthread hello.cpp -o hello
  2. Install the C++ debug adapter
  3. Set a breakpoint in line 17 from the gist
  4. Have the main thread expanded in the callstack viewlet
  5. Expand another thread and click on a frame for which no source is available
  6. The "Load More Stack Frames" button appears for the main thread
  7. The "Load More Stack Frames" button is clicked, the callstack for the main thread gets duplicated (two main() in the screenshot)

Step 3 loadmoreframes-1

Step 5 loadmoreframes-2

Step 6 loadmoreframes-3

I understand if the debug adapter implements the "Load More Frames" feature, this will work. However the experience seems kind of weird if the debug adapter doesn't implement the feature (like C++ debug adapter as of now).

@isidorn @weinand

edumunoz avatar Apr 15 '16 21:04 edumunoz

@edumunoz that is strange, the Load More Stack Frames action should not appear if an adapter is not implementing it. What does the C++ adapter return for the stackTrace request total frames attribute. If the adapter does not support this the action should not be shown at all.

In short, if the adapter does not support this it should not return the totalFrames. If the C++ does not return totalFrames attribute and this action still appears then it a bug on the vscode side and I will investigate deeper.

isidorn avatar Apr 18 '16 09:04 isidorn

The C++ extension does not include a totalFrames attribute in the StackTraceResponse.

Let me know if there is an easy way to turn on logging on the messages sent and received by VSCode to the debug adapter.

edumunoz avatar Apr 18 '16 16:04 edumunoz

Nice catch. The issue was connected with #4623 in that a thread thought it's callstack length was a callStack length of some other thread. Fixed this by always respecting what the debug adapter says about the totalFrames, so if they are not supported this will not be possible. Will not look into the other bug...

isidorn avatar Apr 20 '16 10:04 isidorn

Verified this is fixed for cpptools in master.

andrewcrawley avatar Apr 26 '16 02:04 andrewcrawley

Adding the verified tag then.

isidorn avatar Apr 26 '16 07:04 isidorn