debugger: Fix not being able to stop a Go debug session when no breakpoints were ever hit (#35190)

Fixes #35030

Release Notes:

- debugger: Fixed a bug where a Go debug session could not be stopped if
no breakpoint was ever hit.
This commit is contained in:
Piotr Osiewicz 2025-07-28 15:14:36 +02:00 committed by GitHub
parent cef7d53607
commit 4aae7aed93
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 19 additions and 24 deletions

View file

@ -107,7 +107,7 @@ impl<T: DapCommand> DapCommand for Arc<T> {
#[derive(Debug, Hash, PartialEq, Eq)]
pub struct StepCommand {
pub thread_id: u64,
pub thread_id: i64,
pub granularity: Option<SteppingGranularity>,
pub single_thread: Option<bool>,
}
@ -483,7 +483,7 @@ impl DapCommand for ContinueCommand {
#[derive(Debug, Hash, PartialEq, Eq)]
pub(crate) struct PauseCommand {
pub thread_id: u64,
pub thread_id: i64,
}
impl LocalDapCommand for PauseCommand {
@ -612,7 +612,7 @@ impl DapCommand for DisconnectCommand {
#[derive(Debug, Hash, PartialEq, Eq)]
pub(crate) struct TerminateThreadsCommand {
pub thread_ids: Option<Vec<u64>>,
pub thread_ids: Option<Vec<i64>>,
}
impl LocalDapCommand for TerminateThreadsCommand {
@ -1182,7 +1182,7 @@ impl DapCommand for LoadedSourcesCommand {
#[derive(Debug, Clone, Hash, PartialEq, Eq)]
pub(crate) struct StackTraceCommand {
pub thread_id: u64,
pub thread_id: i64,
pub start_frame: Option<u64>,
pub levels: Option<u64>,
}

View file

@ -61,15 +61,10 @@ use worktree::Worktree;
#[derive(Debug, Copy, Clone, Hash, PartialEq, PartialOrd, Ord, Eq)]
#[repr(transparent)]
pub struct ThreadId(pub u64);
pub struct ThreadId(pub i64);
impl ThreadId {
pub const MIN: ThreadId = ThreadId(u64::MIN);
pub const MAX: ThreadId = ThreadId(u64::MAX);
}
impl From<u64> for ThreadId {
fn from(id: u64) -> Self {
impl From<i64> for ThreadId {
fn from(id: i64) -> Self {
Self(id)
}
}