Skip to content

Instantly share code, notes, and snippets.

@garenchan
Created May 7, 2022 08:20
Show Gist options
  • Save garenchan/92303bf56b224291b08b39e728a79f59 to your computer and use it in GitHub Desktop.
Save garenchan/92303bf56b224291b08b39e728a79f59 to your computer and use it in GitHub Desktop.
go-utils
// 打印traceback
// src/runtime/traceback.go
func traceback2() {
// Everything throw does should be recursively nosplit so it
// can be called even when it's unsafe to grow the stack.
pc := getcallerpc()
sp := getcallersp()
gp := getg()
traceback(pc, sp, 0, gp)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment