[Lldb-commits] [lldb] [lldb] Handle accelerator plugin breakpoint actions on the client (PR #201489)
David Spickett via lldb-commits
lldb-commits at lists.llvm.org
Fri Jun 5 08:41:04 PDT 2026
================
@@ -223,6 +225,79 @@ bool GDBRemoteCommunicationClient::GetMultiBreakpointSupported() {
return m_supports_multi_breakpoint == eLazyBoolYes;
}
+bool GDBRemoteCommunicationClient::GetAcceleratorPluginsSupported() {
+ if (m_supports_accelerator_plugins == eLazyBoolCalculate)
+ GetRemoteQSupported();
+ return m_supports_accelerator_plugins == eLazyBoolYes;
+}
+
+std::optional<std::vector<AcceleratorActions>>
+GDBRemoteCommunicationClient::GetAcceleratorInitializeActions() {
+ // Get the initial actions (e.g. breakpoints to set) requested by any
+ // accelerator plugins using the "jAcceleratorPluginInitialize" packet. This
+ // is sent once when a native process is launched or attached.
+ if (!GetAcceleratorPluginsSupported())
+ return std::nullopt;
+
+ StringExtractorGDBRemote response;
+ response.SetResponseValidatorToJSON();
+ if (SendPacketAndWaitForResponse("jAcceleratorPluginInitialize", response) !=
+ PacketResult::Success)
+ return std::nullopt;
+
+ if (response.IsUnsupportedResponse())
+ return std::nullopt;
+
+ if (response.IsErrorResponse()) {
+ Debugger::ReportError(response.GetStatus().AsCString());
----------------
DavidSpickett wrote:
Did you consider using `expected` and having the caller(s) report the error? Because if you want all errors from this call tree to be reported to the user, that's one way to ensure that.
Though you do have the situation where no error occurs and you get no actions. So in theory it's `expected<optional<vector<AcceleratorActions....`. But if you don't mind modelling the empty state as an empty vector, `expected<vector<AcceleratorActions...` is worth considering.
https://github.com/llvm/llvm-project/pull/201489
More information about the lldb-commits
mailing list