{"record":{"id":"50e23755b9044a9c","repo":"go-delve/delve","slug":"breakpoint-names-that-are-relative-paths-are-not-s","errorCode":null,"errorMessage":"breakpoint names that are relative paths are not supported","messagePattern":"breakpoint names that are relative paths are not supported","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"service/dap/server.go","lineNumber":1873,"sourceCode":"\t\t\thitCondition: want.HitCondition,\n\t\t\tlogMessage:   \"\",\n\t\t}\n\t}, func(i int) (*bpLocation, error) {\n\t\twant := request.Arguments.Breakpoints[i]\n\t\t// Set the function breakpoint\n\t\tspec, err := locspec.Parse(want.Name)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif loc, ok := spec.(*locspec.NormalLocationSpec); !ok || loc.FuncBase == nil {\n\t\t\t// Other locations do not make sense in the context of function breakpoints.\n\t\t\t// Regex locations are likely to resolve to multiple places and offset locations\n\t\t\t// are only meaningful at the time the breakpoint was created.\n\t\t\treturn nil, fmt.Errorf(\"breakpoint name %q could not be parsed as a function. name must be in the format 'funcName', 'funcName:line' or 'fileName:line'\", want.Name)\n\t\t}\n\n\t\tif want.Name[0] == '.' {\n\t\t\treturn nil, errors.New(\"breakpoint names that are relative paths are not supported\")\n\t\t}\n\t\t// Find the location of the function name. CreateBreakpoint requires the name to include the base\n\t\t// (e.g. main.functionName is supported but not functionName).\n\t\t// We first find the location of the function, and then set breakpoints for that location.\n\t\tvar locs []api.Location\n\t\tlocs, err = s.debugger.FindLocationSpec(-1, 0, 0, want.Name, spec, true, s.args.substitutePathClientToServer)\n\t\tif err != nil {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(locs) == 0 {\n\t\t\treturn nil, err\n\t\t}\n\t\tif len(locs) > 1 {\n\t\t\ts.config.log.Debugf(\"multiple locations found for %s\", want.Name)\n\t\t}\n\n\t\t// Set breakpoint using the PCs that were found.\n\t\tloc := locs[0]","sourceCodeStart":1855,"sourceCodeEnd":1891,"githubUrl":"https://github.com/go-delve/delve/blob/a23773e6c31361e43246bc43a424ee009679b174/service/dap/server.go#L1855-L1891","documentation":"When parsing a named breakpoint whose name starts with '.', the session rejects it because relative paths are not supported for breakpoint names. Names are resolved as function names or base-inclusive file paths, and a leading '.' indicates an ambiguous relative path that delve cannot map reliably.","triggerScenarios":"Sending a setBreakpoints request with name './main.go:10' or any './'-prefixed path; IDE passing workspace-relative file paths instead of absolute paths into name-based breakpoint locations.","commonSituations":"Client configurations that build breakpoint names from relative editor paths; users typing relative paths into a 'function or file' breakpoint field; remote debugging where paths were recorded relatively.","solutions":["Use an absolute path (e.g. '/abs/path/main.go:10') in the breakpoint name","Use the function form ('pkg.funcName:line') instead of a file path","Configure the client/IDE to send absolute file paths (or fix path mappings) before creating breakpoints"],"exampleFix":"// before\n{name: './cmd/app/main.go:42'}\n// after\n{name: '/home/user/proj/cmd/app/main.go:42'}","handlingStrategy":"validation","validationCode":"// reject relative-path breakpoint names before sending\nif strings.HasPrefix(bp.Name, \".\") {\n    return fmt.Errorf(\"use absolute path or function name: %s\", bp.Name)\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure the IDE to send absolute file paths","Prefer function-name breakpoint forms (pkg.Func:line)","Normalize paths client-side before creating breakpoints"],"tags":["dap","breakpoints","paths","go"],"backgroundTag":"relative-path-breakpoint-unsupported","analyzedSha":"a23773e6c31361e43246bc43a424ee009679b174","analyzedAt":"2026-08-31T15:12:45.221Z","schemaVersion":2},"datasetVersion":"2026-08-31T19:17:28.585Z"}