strip a few more unneeded runtime functions

Strip a few more traceback printing related functions in the runtime, new for Go 1.16. Also test that GODEBUG=inittrace=1 does not print anything when -tiny is passed.
pull/250/head
Andrew LeFevre 3 years ago committed by Daniel Martí
parent 2ee6604408
commit 081cba38d7

@ -89,8 +89,8 @@ func stripRuntime(filename string, file *ast.File) {
case "traceback.go":
// only used for printing tracebacks
switch x.Name.Name {
case "tracebackdefers", "traceback", "tracebacktrap", "traceback1",
"goroutineheader", "tracebackothers", "tracebackHexdump":
case "tracebackdefers", "printcreatedby", "printcreatedby1", "traceback", "tracebacktrap", "traceback1", "printAncestorTraceback",
"printAncestorTracebackFuncInfo", "goroutineheader", "tracebackothers", "tracebackHexdump", "printCgoTraceback":
x.Body.List = nil
case "printOneCgoTraceback":
x.Body = ah.BlockStmt(ah.ReturnStmt(ah.IntLit(0)))

@ -3,7 +3,7 @@ env GOPRIVATE=test/main
# Tiny mode
garble -tiny build
! 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,inittrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
! exec ./main$exe
stderr '^\(0x[\d\w]{6,8},0x[\d\w]{6,8}\)' # interfaces/pointers print correctly
# TODO: Make -tiny remove all line information again.

Loading…
Cancel
Save