Skip to content

Commit

Permalink
Enable function call injection only on 1.22 and above and some cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
archanaravindar committed Aug 3, 2023
1 parent 2102308 commit 16d5746
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
4 changes: 0 additions & 4 deletions pkg/proc/ppc64le_arch.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,11 @@ func PPC64LEArch(goos string) *Arch {
PCRegNum: regnum.PPC64LE_PC,
SPRegNum: regnum.PPC64LE_SP,
ContextRegNum: regnum.PPC64LE_R0 + 11,
//ContextRegNum: regnum.PPC64LE_R0 + 20,
LRRegNum: regnum.PPC64LE_LR,
asmRegisters: ppc64leAsmRegisters,
RegisterNameToDwarf: nameToDwarfFunc(regnum.PPC64LENameToDwarf),
debugCallMinStackSize: 320,
maxRegArgBytes: 13*8 + 13*8,
//maxRegArgBytes: 16*8 + 16*8,
}
}

Expand Down Expand Up @@ -161,10 +159,8 @@ func ppc64leSwitchStack(it *stackIterator, callFrameRegs *op.DwarfRegisters) boo
off, _ := readIntRaw(it.mem,
callFrameRegs.SP()+ppc64cgocallSPOffsetSaveSlot,
int64(it.bi.Arch.PtrSize()))
//fmt.Printf("OFFSET: %x\n", off)
oldsp := callFrameRegs.SP()
newsp := uint64(int64(it.stackhi) - off)
//fmt.Printf("oldsp %x newsp %x\n", oldsp, newsp)

// runtime.asmcgocall can also be called from inside the system stack,
// in that case no stack switch actually happens
Expand Down
4 changes: 2 additions & 2 deletions pkg/proc/test/support.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,8 +321,8 @@ func MustSupportFunctionCalls(t *testing.T, testBackend string) {
}

if runtime.GOARCH == "ppc64le" {
if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 20) {
t.Skip("On PPC64LE Building with Go lesser than 1.20 does not support function calls")
if !goversion.VersionAfterOrEqual(runtime.Version(), 1, 22) {
t.Skip("On PPC64LE Building with Go lesser than 1.22 does not support function calls")
}
}
}
Expand Down
1 change: 0 additions & 1 deletion pkg/proc/variables_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1289,7 +1289,6 @@ func TestCallFunction(t *testing.T) {
for _, tc := range testcases {
testCallFunction(t, grp, p, tc)
}


if goversion.VersionAfterOrEqual(runtime.Version(), 1, 12) {
for _, tc := range testcases112 {
Expand Down

0 comments on commit 16d5746

Please sign in to comment.