mirror of
https://github.com/go-delve/delve.git
synced 2025-10-29 09:46:56 +08:00
pkg/proc: Refactor process post initialization
This patch is a slight refactor to share more code used for genericprocess initialization. There will always be OS/backend specificinitialization, but as much as can be shared should be to preventduplicating of any logic (setting internal breakpoints, loading bininfo,etc).
This commit is contained in:
committed by
Alessandro Arzilli
parent
91953dd49c
commit
d61cd1c0d7
@ -75,7 +75,9 @@ func (dbp *Process) detach(kill bool) error {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
func (dbp *Process) entryPoint() (uint64, error) {
|
||||
// EntryPoint returns the entry point for the process,
|
||||
// useful for PIEs.
|
||||
func (dbp *Process) EntryPoint() (uint64, error) {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
@ -85,17 +87,17 @@ func (t *Thread) Blocked() bool {
|
||||
}
|
||||
|
||||
// SetPC sets the value of the PC register.
|
||||
func (thread *Thread) SetPC(pc uint64) error {
|
||||
func (t *Thread) SetPC(pc uint64) error {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
// SetSP sets the value of the SP register.
|
||||
func (thread *Thread) SetSP(sp uint64) error {
|
||||
func (t *Thread) SetSP(sp uint64) error {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
// SetDX sets the value of the DX register.
|
||||
func (thread *Thread) SetDX(dx uint64) error {
|
||||
func (t *Thread) SetDX(dx uint64) error {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
@ -126,3 +128,5 @@ func (t *Thread) restoreRegisters(sr proc.Registers) error {
|
||||
func (t *Thread) Stopped() bool {
|
||||
panic(ErrNativeBackendDisabled)
|
||||
}
|
||||
|
||||
func initialize(dbp *Process) error { return nil }
|
||||
|
||||
Reference in New Issue
Block a user