[lldb] [llvm] [lldb-dap] Migrating breakpointLocations request to use typed RequestHandler (PR #137426)
Jonas Devlieghere via llvm-commits
llvm-commits at lists.llvm.org
Fri Apr 25 20:56:03 PDT 2025
================
@@ -245,6 +245,23 @@ bool fromJSON(const json::Value &Params, Configuration &C, json::Path P) {
parseSourceMap(Params, C.sourceMap, P);
}
+bool fromJSON(const json::Value &Params, BreakpointLocationsArguments &BLA,
+ json::Path P) {
+ json::ObjectMapper O(Params, P);
+ return O && O.map("source", BLA.source) && O.map("line", BLA.line) &&
+ O.mapOptional("column", BLA.column) &&
+ O.mapOptional("endLine", BLA.endLine) &&
+ O.mapOptional("endColumn", BLA.endColumn);
+}
+
+llvm::json::Value toJSON(const BreakpointLocationsResponseBody &BLRB) {
+ llvm::json::Array breakpoints_json;
+ for (const auto &breakpoint : BLRB.breakpoints) {
+ breakpoints_json.push_back(toJSON(breakpoint));
+ }
----------------
JDevlieghere wrote:
```suggestion
for (const auto &breakpoint : BLRB.breakpoints)
breakpoints_json.push_back(toJSON(breakpoint));
```
https://github.com/llvm/llvm-project/pull/137426
More information about the llvm-commits
mailing list