mirror of
https://github.com/gin-gonic/gin.git
synced 2026-09-04 14:49:27 +08:00
Merge 51b00a3ac77fbce5386562195c0e0728e8836e80 into dcaa4296d111981ffb31ac3eba90bb63e1eb5ab9
This commit is contained in:
commit
ab9d9cfb34
@ -123,6 +123,7 @@ func stack(skip int) []byte {
|
|||||||
var (
|
var (
|
||||||
nLine string
|
nLine string
|
||||||
lastFile string
|
lastFile string
|
||||||
|
lastLine int
|
||||||
err error
|
err error
|
||||||
)
|
)
|
||||||
for i := skip; ; i++ { // Skip the expected number of frames
|
for i := skip; ; i++ { // Skip the expected number of frames
|
||||||
@ -132,12 +133,13 @@ func stack(skip int) []byte {
|
|||||||
}
|
}
|
||||||
// Print this much at least. If we can't find the source, it won't show.
|
// Print this much at least. If we can't find the source, it won't show.
|
||||||
fmt.Fprintf(buf, "%s:%d (0x%x)\n", file, line, pc)
|
fmt.Fprintf(buf, "%s:%d (0x%x)\n", file, line, pc)
|
||||||
if file != lastFile {
|
if file != lastFile || line != lastLine {
|
||||||
nLine, err = readNthLine(file, line-1)
|
nLine, err = readNthLine(file, line-1)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
lastFile = file
|
lastFile = file
|
||||||
|
lastLine = line
|
||||||
}
|
}
|
||||||
fmt.Fprintf(buf, "\t%s: %s\n", function(pc), cmp.Or(nLine, dunno))
|
fmt.Fprintf(buf, "\t%s: %s\n", function(pc), cmp.Or(nLine, dunno))
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user