Beispiel #1
0
func (d *Debugger) FindLocation(locStr string) ([]api.Location, error) {
	loc, err := parseLocationSpec(locStr)
	if err != nil {
		return nil, err
	}

	locs, err := loc.Find(d, locStr)
	for i := range locs {
		file, line, fn := d.process.PCToLine(locs[i].PC)
		locs[i].File = file
		locs[i].Line = line
		locs[i].Function = api.ConvertFunction(fn)
	}
	return locs, err
}
Beispiel #2
0
// FindLocation will find the location specified by 'locStr'.
func (d *Debugger) FindLocation(scope api.EvalScope, locStr string) ([]api.Location, error) {
	loc, err := parseLocationSpec(locStr)
	if err != nil {
		return nil, err
	}

	s, _ := d.process.ConvertEvalScope(scope.GoroutineID, scope.Frame)

	locs, err := loc.Find(d, s, locStr)
	for i := range locs {
		file, line, fn := d.process.PCToLine(locs[i].PC)
		locs[i].File = file
		locs[i].Line = line
		locs[i].Function = api.ConvertFunction(fn)
	}
	return locs, err
}