mirror of
https://github.com/burrowers/garble.git
synced 2025-12-24 12:58:05 +08:00
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.
This commit is contained in:
2
testdata/script/reverse.txtar
vendored
2
testdata/script/reverse.txtar
vendored
@@ -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
testdata/script/tiny.txtar
vendored
4
testdata/script/tiny.txtar
vendored
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user