================ @@ -131,11 +131,13 @@ void BreakpointLocationsRequestHandler::operator()( auto *arguments = request.getObject("arguments"); auto *source = arguments->getObject("source"); std::string path = GetString(source, "path").str(); - uint64_t start_line = GetUnsigned(arguments, "line", 0); - uint64_t start_column = GetUnsigned(arguments, "column", 0); - uint64_t end_line = GetUnsigned(arguments, "endLine", start_line); - uint64_t end_column = - GetUnsigned(arguments, "endColumn", std::numeric_limits<uint64_t>::max()); + const auto start_line = GetInteger<uint64_t>(arguments, "line").value_or(0); + const auto start_column = + GetInteger<uint64_t>(arguments, "column").value_or(0); + const auto end_line = + GetInteger<uint64_t>(arguments, "endLine").value_or(start_line); + const auto end_column = GetInteger<uint64_t>(arguments, "endColumn") + .value_or(std::numeric_limits<uint64_t>::max()); ---------------- ashgti wrote:
Should we use `LLDB_INVALID_LINE_NUMBER` as the default for any of the 'line' values? And for the 'column' should default to `LLDB_INVALID_COLUMN_NUMBER`, which is also 0, but the value makes it more explicit that we're using it as a fallback. I suppose that may result in a change of behavior, so we may not want to but it seems like some like we may want to have more specific fallbacks. For example, I haven't actually tried if I can set a breakpoint on line 0 (or 1 depending on how you count) of a file. https://github.com/llvm/llvm-project/pull/129823 _______________________________________________ lldb-commits mailing list lldb-commits@lists.llvm.org https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits