Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Call Stack limitied to 20 #946

Closed
BlakeMScurr opened this issue Apr 27, 2017 · 7 comments
Closed

Call Stack limitied to 20 #946

BlakeMScurr opened this issue Apr 27, 2017 · 7 comments
Labels

Comments

@BlakeMScurr
Copy link

If you run this code

package main

func main() {
	d := 30
	recursiveCall(d)
}

func recursiveCall(depth int) {
	if depth <= 0 {
		return
	}
	recursiveCall(depth - 1)
}

with a breakpoint on line 10, you can't access the value of d in the main function because it's too far down the stack. How can this be extended?

@ramya-rao-a
Copy link
Contributor

Does it work when you run dlv from the command line?

@BlakeMScurr
Copy link
Author

Yeah, I can print the stack trace at arbitrary depth using the command line with stack <depth> during debugging. I might just be missing the interface in vscode that lets you do the same thing.

@ramya-rao-a
Copy link
Contributor

cc @roblourens

@roblourens
Copy link
Member

Looks like we haven't implemented stack trace paging (but probably we should just hardcode a number larger than 20)

@ramya-rao-a
Copy link
Contributor

@roblourens Can you add some pointers on how we go about doing that so that someone in the community can pick this up?

@roblourens
Copy link
Member

VS Code asks for 20 frames at first, and we pass that along to Delve to get 20 frames

https://github.com/Microsoft/vscode-go/blob/master/src/debugAdapter/goDebug.ts#L574

Then VS Code can ask for the next page of frames 20-40, but it looks like there probably isn't a way to ask for that from Delve. So, someone could change that line to ignore args.levels from VS Code, and simply return 50 frames (or something).

However, someone would need to test it and make sure that it doesn't crash or slow down when exchanging info from 50 frames. Another option would be getting lots of frames from Delve, and implementing paging just between VS Code and the debug adapter.

ramya-rao-a pushed a commit that referenced this issue Nov 14, 2018
* Add stacktrace paging support to debug adapter

Fixes #946

* Add configuration setting for maximum stack trace depth

* Use current default of 20

* Fallback to settings wont work
@ramya-rao-a
Copy link
Contributor

ramya-rao-a commented Dec 13, 2018

The call stack trace can now be paged in the latest version of the Go extension (0.8.0)
Thanks @brycekahle!

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants