Lines Matching +full:cancel +full:- +full:in +full:- +full:progress

1 //===-- DAP.cpp -------------------------------------------------*- C++ -*-===//
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
7 //===----------------------------------------------------------------------===//
22 #include "lldb/lldb-defines.h"
23 #include "lldb/lldb-enumerations.h"
64 output(std::move(output)), broadcaster("lldb-dap"),
90 exception_breakpoints->emplace_back(*this, "cpp_catch", "C++ Catch",
92 exception_breakpoints->emplace_back(*this, "cpp_throw", "C++ Throw",
96 exception_breakpoints->emplace_back(
97 *this, "objc_catch", "Objective-C Catch", lldb::eLanguageTypeObjC);
98 exception_breakpoints->emplace_back(
99 *this, "objc_throw", "Objective-C Throw", lldb::eLanguageTypeObjC);
102 exception_breakpoints->emplace_back(*this, "swift_catch", "Swift Catch",
104 exception_breakpoints->emplace_back(*this, "swift_throw", "Swift Throw",
134 exception_breakpoints->emplace_back(
145 exception_breakpoints->emplace_back(
150 assert(!exception_breakpoints->empty() && "should not be empty");
156 // in a request-initialize.
158 // But this GetExceptionBreakpoint() method may be called before attaching, in
161 // We also cannot call PopulateExceptionBreakpoints() in DAP::DAP() because
164 // So just calling PopulateExceptionBreakoints(),which does lazy-populating
166 // + call g_dap.PopulateExceptionBreakpoints() in lldb-dap.cpp::main()
180 // See comment in the other GetExceptionBreakpoint().
191 in = lldb::SBFile(std::fopen(DEV_NULL, "r"), /*transfer_ownership=*/true);
203 if (dup2(*fd, fileno(overrideOut)) == -1)
217 if (dup2(*fd, fileno(overrideErr)) == -1)
229 // Send the JSON in "json_str" to the "out" stream. Correctly send the
230 // "Content-Length:" field followed by the length, followed by the raw
233 output.write_full("Content-Length: ");
252 *log << llvm::formatv("{0:f9} <-- ", now.count()).str() << std::endl
253 << "Content-Length: " << json_str.size() << "\r\n\r\n"
258 // Read a JSON packet from the "in" stream.
264 if (!input.read_expected(log, "Content-Length: "))
282 *log << llvm::formatv("{0:f9} --> ", now.count()).str() << std::endl
283 << "Content-Length: " << length << "\r\n\r\n";
338 // the other categories the data is shown in JSON
374 end = output.size() - 1;
390 // * An ID that must be used in subsequent 'progressUpdate' and
392 // * events to make them refer to the same progress reporting.
398 // * Mandatory (short) title of the progress reporting. Shown in the UI to
404 // * The request ID that this progress report is related to. If specified a
406 // * progress events for the long running request until the request has
409 // * If the request ID is omitted, the progress report is assumed to be
415 // * If true, the request that reports progress may be canceled with a
416 // * 'cancel' request.
426 // * Optional, more detailed progress message.
431 // * Optional progress percentage to display (value range: 0 to 100). If
443 // * The ID that was introduced in the initial 'progressStart' event.
448 // * Optional, more detailed progress message. If omitted, the previous
454 // * Optional progress percentage to display (value range: 0 to 100). If
466 // * The ID that was introduced in the initial 'ProgressStartEvent'.
471 // * Optional, more detailed progress message. If omitted, the previous
557 // term is a variable or command. If it's a variable in scope we will prefer
589 // Variables take preference to commands in auto, since commands can always
671 // in launch info is useless because Target.Launch() will not change
674 // configuration, if given, since in some cases ELF file doesn't contain
681 auto target = this->debugger.CreateTarget(
697 this->target = target;
701 lldb::SBListener listener = this->debugger.GetListener();
703 this->target.GetBroadcaster(),
705 listener.StartListeningForEvents(this->broadcaster,
733 llvm::json::Object *object_ptr = json_value->getAsObject();
755 handler_pos->second(*this, object);
769 response_handler = std::move(inflight->second);
787 std::error_code(-1, std::generic_category()), message));
903 return pos->second;
907 return pos->second;
924 // Command format like: `start-debugging <launch|attach> <configuration>`
926 result.SetError("Invalid use of start-debugging, expected format "
927 "`start-debugging <launch|attach> <configuration>`.");
932 result.SetError("start-debugging request type missing.");
937 result.SetError("start-debugging debug configuration missing.");
976 // Command format like: `repl-mode <variable|command|auto>?`
992 result.Printf("lldb-dap repl-mode %s.\n", mode.c_str());
1008 error_message.Printf("Invalid repl-mode '%s'. Expected one of 'variable', "
1015 result.Printf("lldb-dap repl-mode %s set.\n", new_mode.data());
1023 // https://code.visualstudio.com/api/references/vscode-api#debug.onDidReceiveDebugSessionCustomEvent
1027 // Command format like: `send-event <name> <body>?`
1030 "`lldb-dap send-event <name> <body>?`.");
1035 // Events that are stateful and should be handled by lldb-dap internally.
1043 llvm::formatv("Invalid use of lldb-dap send-event, event \"{0}\" "
1044 "should be handled by lldb-dap internally.",
1057 "Additional arguments found, expected `lldb-dap send-event "