@ -5,8 +5,9 @@ garble -tiny build
! binsubstr main$exe 'main.go' 'fmt/print.go'
! binsubstr main$exe 'main.go' 'fmt/print.go'
env GODEBUG='allocfreetrace=1,gcpacertrace=1,gctrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
env GODEBUG='allocfreetrace=1,gcpacertrace=1,gctrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
! exec ./main$exe
! exec ./main$exe
cmp stdout main.stdout
stderr '^caller: \? 0$' # position info is removed
stderr '\? 0'
stderr '^recovered: ya like jazz?'
! stderr 'panic: oh noes' # panics are hidden
[short] stop # no need to verify this with -short
[short] stop # no need to verify this with -short
@ -14,32 +15,27 @@ stderr '\? 0'
env GODEBUG=
env GODEBUG=
garble build
garble build
! exec ./main$exe
! exec ./main$exe
cmp stdout main.stdout
stderr '^caller: \w\.go [1-9]'
stderr '\w\.go [1-9]'
stderr '^recovered: ya like jazz?'
stderr 'panic: oh noes'
-- go.mod --
-- go.mod --
module test/main
module test/main
-- main.go --
-- main.go --
package main
package main
import (
import "runtime"
"fmt"
"runtime"
)
func main() {
func main() {
defer func() {
defer func() {
if r := recover(); r != nil {
if r := recover(); r != nil {
fmt.Println(r )
println("recovered:", r.(string) )
panic("oh noes")
panic("oh noes")
}
}
}()
}()
_, file, line, _ := runtime.Caller(0)
_, file, line, _ := runtime.Caller(0)
println(file, line)
println("caller:", file, line)
panic("ya like jazz?")
panic("ya like jazz?")
}
}
-- main.stdout --
ya like jazz?