debugger: Add breakpoint list (#28496)

![image](https://github.com/user-attachments/assets/2cbe60cc-bf04-4233-a7bc-32affff8eef5)
Release Notes:

- N/A

---------

Co-authored-by: Anthony Eid <hello@anthonyeid.me>
This commit is contained in:
Piotr Osiewicz 2025-04-10 20:18:58 +02:00 committed by GitHub
parent 3abf95216c
commit 26f4705198
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
13 changed files with 711 additions and 18 deletions

View file

@ -2,7 +2,7 @@ use std::sync::Arc;
use anyhow::{Ok, Result, anyhow};
use dap::{
Capabilities, ContinueArguments, InitializeRequestArguments,
Capabilities, ContinueArguments, ExceptionFilterOptions, InitializeRequestArguments,
InitializeRequestArgumentsPathFormat, NextArguments, SetVariableResponse, SourceBreakpoint,
StepInArguments, StepOutArguments, SteppingGranularity, ValueFormat, Variable,
VariablesArgumentsFilter,
@ -1665,6 +1665,44 @@ impl LocalDapCommand for SetBreakpoints {
Ok(message.breakpoints)
}
}
#[derive(Clone, Debug, Hash, PartialEq)]
pub(super) enum SetExceptionBreakpoints {
Plain {
filters: Vec<String>,
},
WithOptions {
filters: Vec<ExceptionFilterOptions>,
},
}
impl LocalDapCommand for SetExceptionBreakpoints {
type Response = Vec<dap::Breakpoint>;
type DapRequest = dap::requests::SetExceptionBreakpoints;
fn to_dap(&self) -> <Self::DapRequest as dap::requests::Request>::Arguments {
match self {
SetExceptionBreakpoints::Plain { filters } => dap::SetExceptionBreakpointsArguments {
filters: filters.clone(),
exception_options: None,
filter_options: None,
},
SetExceptionBreakpoints::WithOptions { filters } => {
dap::SetExceptionBreakpointsArguments {
filters: vec![],
filter_options: Some(filters.clone()),
exception_options: None,
}
}
}
}
fn response_from_dap(
&self,
message: <Self::DapRequest as dap::requests::Request>::Response,
) -> Result<Self::Response> {
Ok(message.breakpoints.unwrap_or_default())
}
}
#[derive(Clone, Debug, Hash, PartialEq, Eq)]
pub(super) struct LocationsCommand {