github.com/tencent/goom@v1.0.1/internal/patch/fix_origin.go (about) 1 package patch 2 3 import ( 4 "github.com/tencent/goom/internal/logger" 5 ) 6 7 // fixOrigin 将原函数拷贝到另外一个内存区段,并且修复 8 // trampoline 跳板函数地址, 不传递用0表示 9 // jumpDataLen jumpData 字节数组长度 10 func fixOrigin(origin, trampoline uintptr, jumpDataLen int) (uintptr, error) { 11 logger.Infof("starting fix Origin origin=0x%x trampoline=0x%x ...", origin, trampoline) 12 r, e := fixOriginFuncToTrampoline(origin, trampoline, jumpDataLen) 13 if e != nil { 14 logger.Errorf("fixed Origin error origin=%d trampoline=%d error:%s", origin, trampoline, e) 15 } 16 return r, e 17 }