mirror of
https://github.com/go-delve/delve.git
synced 2025-11-02 12:59:01 +08:00
Two bugfixes regarding stale executable files, and executables changing between restarts (#689)
* service/debugger: Restore breakpoints using file:line on restart Restoring by address can cause the breakpoint to be inserted in the middle of an instruction if the executable file has changed. * terminal: Warn of stale executable when printing source
This commit is contained in:
committed by
Derek Parker
parent
8f0646e426
commit
f4aaffbbf3
@ -3,6 +3,7 @@ package rpc2
|
||||
import (
|
||||
"errors"
|
||||
"fmt"
|
||||
"time"
|
||||
|
||||
"github.com/derekparker/delve/service"
|
||||
"github.com/derekparker/delve/service/api"
|
||||
@ -33,6 +34,18 @@ func (s *RPCServer) ProcessPid(arg ProcessPidIn, out *ProcessPidOut) error {
|
||||
return nil
|
||||
}
|
||||
|
||||
type LastModifiedIn struct {
|
||||
}
|
||||
|
||||
type LastModifiedOut struct {
|
||||
Time time.Time
|
||||
}
|
||||
|
||||
func (s *RPCServer) LastModified(arg LastModifiedIn, out *LastModifiedOut) error {
|
||||
out.Time = s.debugger.LastModified()
|
||||
return nil
|
||||
}
|
||||
|
||||
type DetachIn struct {
|
||||
Kill bool
|
||||
}
|
||||
@ -49,6 +62,7 @@ type RestartIn struct {
|
||||
}
|
||||
|
||||
type RestartOut struct {
|
||||
DiscardedBreakpoints []api.DiscardedBreakpoint
|
||||
}
|
||||
|
||||
// Restart restarts program.
|
||||
@ -56,7 +70,9 @@ func (s *RPCServer) Restart(arg RestartIn, out *RestartOut) error {
|
||||
if s.config.AttachPid != 0 {
|
||||
return errors.New("cannot restart process Delve did not create")
|
||||
}
|
||||
return s.debugger.Restart()
|
||||
var err error
|
||||
out.DiscardedBreakpoints, err = s.debugger.Restart()
|
||||
return err
|
||||
}
|
||||
|
||||
type StateIn struct {
|
||||
|
||||
Reference in New Issue
Block a user