delve: add linux-riscv64 support (#3785)

This commit is contained in:
lrzlin
2024-10-12 03:34:25 +08:00
committed by GitHub
parent abc948b0ae
commit 75c41f2b64
36 changed files with 5462 additions and 50 deletions

View File

@ -299,7 +299,7 @@ func (it *stackIterator) switchToGoroutineStack() {
it.pc = it.g.PC
it.regs.Reg(it.regs.SPRegNum).Uint64Val = it.g.SP
it.regs.AddReg(it.regs.BPRegNum, op.DwarfRegisterFromUint64(it.g.BP))
if it.bi.Arch.Name == "arm64" || it.bi.Arch.Name == "ppc64le" {
if it.bi.Arch.Name == "arm64" || it.bi.Arch.Name == "ppc64le" || it.bi.Arch.Name == "riscv64" {
it.regs.Reg(it.regs.LRRegNum).Uint64Val = it.g.LR
}
}
@ -564,7 +564,7 @@ func (it *stackIterator) advanceRegs() (callFrameRegs op.DwarfRegisters, ret uin
}
}
if it.bi.Arch.Name == "arm64" || it.bi.Arch.Name == "ppc64le" {
if it.bi.Arch.Name == "arm64" || it.bi.Arch.Name == "ppc64le" || it.bi.Arch.Name == "riscv64" {
if ret == 0 && it.regs.Reg(it.regs.LRRegNum) != nil {
ret = it.regs.Reg(it.regs.LRRegNum).Uint64Val
}