(file string, line int, column int)
| 243 | } |
| 244 | |
| 245 | func (d *Debugger) SetBreakpoint(file string, line int, column int) (string, error) { |
| 246 | valid, err := d.BreakpointLocations(file) |
| 247 | if err != nil { |
| 248 | return "", fmt.Errorf("getting valid breakpoint locations: %w", err) |
| 249 | } |
| 250 | target := "" |
| 251 | for _, b := range valid { |
| 252 | if b.Begin.Line == line { |
| 253 | if column < 0 { |
| 254 | target = b.String() |
| 255 | break |
| 256 | } else if b.Begin.Column == column { |
| 257 | target = b.String() |
| 258 | break |
| 259 | } |
| 260 | } |
| 261 | } |
| 262 | if target == "" { |
| 263 | return "", fmt.Errorf("breakpoint location invalid") |
| 264 | } |
| 265 | d.breakpoints[target] = true |
| 266 | return target, nil |
| 267 | } |
| 268 | func (d *Debugger) ClearBreakpoints(file string) { |
| 269 | abs, _ := filepath.Abs(file) |
| 270 | for k := range d.breakpoints { |
nothing calls this directly
no test coverage detected