make pointer regular expressions more flexible

We just got a failure on Mac on CI with pointers past eight digits:

    (0x10432dec0,0x10433c690)

Use `[[:xdigit:]]+` consistently.
pull/845/head
Daniel Martí 3 weeks ago
parent 20a92460d5
commit 9f82b2bbfe

@ -102,7 +102,7 @@ func printStackTrace(w io.Writer) error {
// The format also changes depending on the ABI.
// Strip them out here, to have portable static stdout files.
rxCallArgs := regexp.MustCompile(`\(({|0x)[^)]+\)|\(\)`)
rxPointer := regexp.MustCompile(`\+0x[0-9a-f]+`)
rxPointer := regexp.MustCompile(`\+0x[[:xdigit:]]+`)
// Keep this comment here, because comments affect line numbers.

@ -4,7 +4,7 @@ exec garble -tiny build
env GODEBUG='allocfreetrace=1,gcpacertrace=1,gctrace=1,inittrace=1,scavenge=1,scavtrace=1,scheddetail=1,schedtrace=10'
! exec ./main$exe
env GODEBUG='' # Ensure further commands don't have weirdness due to GODEBUG.
stderr '^\(0x[\d\w]{4,8},0x[\d\w]{4,8}\)' # interfaces/pointers print correctly
stderr '^\(0x[[:xdigit:]]+,0x[[:xdigit:]]+\)' # interfaces/pointers print correctly
# With -tiny, all line numbers are reset to 1.
# Unfortunately, line comment directives don't allow erasing line numbers entirely.
stderr '^caller: \?\? 1$' # position info is removed
@ -19,7 +19,7 @@ stderr 'funcStructExported false funcStructUnexported true'
# Default mode
exec garble build
! exec ./main$exe
stderr '^caller: [0-9a-zA-Z_]+\.go [1-9]'
stderr '^caller: [[:word:]]+\.go [1-9]'
stderr '^recovered: ya like jazz?'
stderr 'panic: oh noes'
stderr 'funcExported false funcUnexported false'

Loading…
Cancel
Save