mirror of
https://github.com/go-delve/delve.git
synced 2025-10-28 04:35:19 +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
@ -1443,7 +1443,7 @@ func (d *Debugger) CurrentPackage() (string, error) {
|
||||
}
|
||||
|
||||
// FindLocation will find the location specified by 'locStr'.
|
||||
func (d *Debugger) FindLocation(goid, frame, deferredCall int, locStr string, includeNonExecutableLines bool) ([]api.Location, error) {
|
||||
func (d *Debugger) FindLocation(goid, frame, deferredCall int, locStr string, includeNonExecutableLines bool, substitutePathRules [][2]string) ([]api.Location, error) {
|
||||
d.targetMutex.Lock()
|
||||
defer d.targetMutex.Unlock()
|
||||
|
||||
@ -1458,7 +1458,7 @@ func (d *Debugger) FindLocation(goid, frame, deferredCall int, locStr string, in
|
||||
|
||||
s, _ := proc.ConvertEvalScope(d.target, goid, frame, deferredCall)
|
||||
|
||||
locs, err := loc.Find(d.target, d.processArgs, s, locStr, includeNonExecutableLines)
|
||||
locs, err := loc.Find(d.target, d.processArgs, s, locStr, includeNonExecutableLines, substitutePathRules)
|
||||
for i := range locs {
|
||||
if locs[i].PC == 0 {
|
||||
continue
|
||||
|
||||
Reference in New Issue
Block a user