mirror of
https://github.com/go-delve/delve.git
synced 2025-10-27 20:23:41 +08:00
service,terminal: apply substitute path to trace/break argument
Change FindLocation to apply substitute path rules to location expressions. Changes terminal to always print paths after applying substitutions. Implements #2203
This commit is contained in:
committed by
Alessandro Arzilli
parent
6ab6929b9a
commit
db93049813
@ -600,6 +600,13 @@ type FindLocationIn struct {
|
||||
Scope api.EvalScope
|
||||
Loc string
|
||||
IncludeNonExecutableLines bool
|
||||
|
||||
// SubstitutePathRules is a slice of source code path substitution rules,
|
||||
// the first entry of each pair is the path of a directory as it appears in
|
||||
// the executable file (i.e. the location of a source file when the program
|
||||
// was compiled), the second entry of each pair is the location of the same
|
||||
// directory on the client system.
|
||||
SubstitutePathRules [][2]string
|
||||
}
|
||||
|
||||
type FindLocationOut struct {
|
||||
@ -621,7 +628,7 @@ type FindLocationOut struct {
|
||||
// NOTE: this function does not actually set breakpoints.
|
||||
func (c *RPCServer) FindLocation(arg FindLocationIn, out *FindLocationOut) error {
|
||||
var err error
|
||||
out.Locations, err = c.debugger.FindLocation(arg.Scope.GoroutineID, arg.Scope.Frame, arg.Scope.DeferredCall, arg.Loc, arg.IncludeNonExecutableLines)
|
||||
out.Locations, err = c.debugger.FindLocation(arg.Scope.GoroutineID, arg.Scope.Frame, arg.Scope.DeferredCall, arg.Loc, arg.IncludeNonExecutableLines, arg.SubstitutePathRules)
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user