
Implement debugging function for 386 on linux with reference to AMD64. There are a few remaining problems that need to be solved in another time. 1. The stacktrace of cgo are not exactly as expected. 2. Not implement `core` for now. 3. Not implement `call` for now. Can't not find `runtime·debugCallV1` or similar function in $GOROOT/src/runtime/asm_386.s. Update #20
34 lines
1.1 KiB
Go
34 lines
1.1 KiB
Go
package proc
|
|
|
|
import (
|
|
"github.com/go-delve/delve/pkg/dwarf/frame"
|
|
"github.com/go-delve/delve/pkg/dwarf/op"
|
|
)
|
|
|
|
// Arch defines an interface for representing a
|
|
// CPU architecture.
|
|
type Arch interface {
|
|
PtrSize() int
|
|
MaxInstructionLength() int
|
|
AsmDecode(asmInst *AsmInstruction, mem []byte, regs Registers, memrw MemoryReadWriter, bi *BinaryInfo) error
|
|
Prologues() []opcodeSeq
|
|
BreakpointInstruction() []byte
|
|
BreakInstrMovesPC() bool
|
|
BreakpointSize() int
|
|
DerefTLS() bool
|
|
FixFrameUnwindContext(*frame.FrameContext, uint64, *BinaryInfo) *frame.FrameContext
|
|
SwitchStack(it *stackIterator, callFrameRegs *op.DwarfRegisters) bool
|
|
RegSize(uint64) int
|
|
RegistersToDwarfRegisters(uint64, Registers) op.DwarfRegisters
|
|
AddrAndStackRegsToDwarfRegisters(uint64, uint64, uint64, uint64, uint64) op.DwarfRegisters
|
|
DwarfRegisterToString(int, *op.DwarfRegister) (string, bool, string)
|
|
InhibitStepInto(bi *BinaryInfo, pc uint64) bool
|
|
}
|
|
|
|
// crosscall2 is defined in $GOROOT/src/runtime/cgo/asm_amd64.s.
|
|
const (
|
|
crosscall2SPOffsetBad = 0x8
|
|
crosscall2SPOffsetWindows = 0x118
|
|
crosscall2SPOffsetNonWindows = 0x58
|
|
)
|