Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Print stack trace #60

Closed
willfaught opened this issue Aug 1, 2015 · 7 comments
Closed

Print stack trace #60

willfaught opened this issue Aug 1, 2015 · 7 comments

Comments

@willfaught
Copy link

It would be helpful to print the function stack in times I forget where I am in the current goroutine.

@glycerine
Copy link

implementation note: debug.PrintStack() prints the stack for you.

@glycerine
Copy link

http://stackoverflow.com/questions/19094099/how-to-dump-goroutine-stacktraces

Also I see the docs for debug.Stack() say it is deprecated in favor of runtime.Stack(). Not sure which is called by debug.PrintStack() these days.

@willfaught
Copy link
Author

The full default stack trace with arg values is probably too noisy. Perhaps even just the function names are enough, but I could see how file/line could be helpful too.

If there's ever a feature to examine other stack frames (move up/down the stack), this feature could be reused for that navigation.

@willfaught
Copy link
Author

Perhaps the goroutine number would be useful too.

@jeremyschlatter
Copy link
Contributor

Here's the stack trace you get from runtime.Stack(): http://play.golang.org/p/TzttmeRRD0

The runtime package also exports a Func type that we could use to build a cleaner trace.

@jeremyschlatter
Copy link
Contributor

Here's an example of using runtime.Func to make a cleaner stack trace: http://play.golang.org/p/3BiuMP_ocl

@glycerine
Copy link

I assume that additional information is to allow those debugging the generated assembly to do so. Hence it is valuable (perhaps essential) to some. I don't find it distracting; I would leave it "uncleaned".

@willfaught willfaught closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants