github.com/Rookout/GoSDK@v0.1.48/pkg/services/instrumentation/hooker/breakpoint_flow_runner_arm64.go (about)

     1  package hooker
     2  
     3  import (
     4  	"sync/atomic"
     5  )
     6  
     7  func (c *breakpointFlowRunner) ApplyBreakpointsState() error {
     8  	
     9  	if c.IsUnhookedState() {
    10  		return c.installHook()
    11  	}
    12  
    13  	trampoline, err := c.nativeAPI.GetStateEntryAddr(c.function.Entry, c.function.End, c.stateID)
    14  	if err != nil {
    15  		return err
    16  	}
    17  	atomic.StoreUint64(c.function.FinalTrampolinePointer, uint64(trampoline))
    18  
    19  	if !c.function.Hooked {
    20  		c.jumpDestination = uintptr(c.function.MiddleTrampolineAddress)
    21  		return c.installHook()
    22  	}
    23  
    24  	return nil
    25  }