[llvm-branch-commits] [lldb] [lldbremote][NFC] Factor out code handling breakpoint packets (PR #192915)

Felipe de Azevedo Piovezan via llvm-branch-commits llvm-branch-commits at lists.llvm.org
Sat Apr 25 02:44:14 PDT 2026


================
@@ -307,6 +307,34 @@ class GDBRemoteCommunicationServerLLGS
 private:
   llvm::Expected<std::unique_ptr<llvm::MemoryBuffer>> BuildTargetXml();
 
+  /// Helper struct for the Execute{Set,Remove}Breakpoint methods.
+  struct BreakpointResult {
+    enum class Kind { OK, Error, IllFormed };
+
+    Kind kind;
+    uint8_t error_code = 0; // Only meaningful when kind == Error.
+    std::string message;    // Only meaningful when kind == IllFormed.
----------------
felipepiovezan wrote:

>Only problem is the OK state 

We can definitely use monostate for that, but any empty struct serves the same type-theory purpose here, and we can give it our name.

https://github.com/llvm/llvm-project/pull/192915


More information about the llvm-branch-commits mailing list