From e9bd9d95eb703aaa10c4cb51a9ab5a19a49e104d Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Tue, 10 Jun 2025 21:27:31 -0600 Subject: [PATCH] Allow negative breakpoint ids These are returned by delve's internal breakpoints (for panic handling) c.f. https://github.com/go-delve/delve/pull/4027 --- dap-types/src/types.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/dap-types/src/types.rs b/dap-types/src/types.rs index 919be94..75543bf 100644 --- a/dap-types/src/types.rs +++ b/dap-types/src/types.rs @@ -1,8 +1,9 @@ // This file is autogenerated. Do not edit by hand. // To regenerate from schema, run `cargo run -p generator`. -use serde::{Deserialize, Serialize}; use schemars::JsonSchema; +use serde::{Deserialize, Serialize}; +use serde_json::Number; /// On error (whenever `success` is false), the body can provide more details. #[derive(Debug, Clone, Deserialize, Serialize, PartialEq, Eq, Hash)] @@ -73,7 +74,10 @@ pub struct StoppedEvent { #[serde(rename = "hitBreakpointIds")] #[serde(skip_serializing_if = "Option::is_none")] #[serde(default)] - pub hit_breakpoint_ids: Option>, + // Note: this is an Number because delve returns -1 when a panic is hit. + // Everywhere else we assume (though the spec doesn't specify) that breakpoint ids are u64s. + // https://github.com/go-delve/delve/pull/4027 + pub hit_breakpoint_ids: Option>, } /// The reason for the event.