Debugger: Add stop on entry support to debug adapter configs (#27942)

This PR adds passing in `stop_on_entry` to debug configs in debug.json
instead of going through initialization args.

This has two benefits:

1. It's more streamlined to a user since every internal adapter supports
`stop_on_entry` for launch requests and Go's adapter supports it for
attach requests too.
2. It will allow @osiewicz `NewSesssionModal` PR to use this field for
the stop on entry checkbox.

Release Notes:

- N/A
This commit is contained in:
Anthony Eid 2025-04-02 13:45:26 -04:00 committed by GitHub
parent e1a8a31fa4
commit 0ba8432b0b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
14 changed files with 25 additions and 2 deletions

View file

@ -79,7 +79,7 @@ impl DebugAdapter for GdbDebugAdapter {
json!({"pid": attach_config.process_id})
}
dap::DebugRequestType::Launch(launch_config) => {
json!({"program": launch_config.program, "cwd": launch_config.cwd})
json!({"program": launch_config.program, "cwd": launch_config.cwd, "stopOnEntry": config.stop_on_entry})
}
}
}

View file

@ -86,12 +86,14 @@ impl DebugAdapter for GoDebugAdapter {
match &config.request {
dap::DebugRequestType::Attach(attach_config) => {
json!({
"processId": attach_config.process_id
"processId": attach_config.process_id,
"stopOnEntry": config.stop_on_entry,
})
}
dap::DebugRequestType::Launch(launch_config) => json!({
"program": launch_config.program,
"cwd": launch_config.cwd,
"stopOnEntry": config.stop_on_entry,
}),
}
}

View file

@ -131,6 +131,7 @@ impl DebugAdapter for JsDebugAdapter {
match &config.request {
DebugRequestType::Attach(attach) => {
map.insert("processId".into(), attach.process_id.into());
map.insert("stopOnEntry".into(), config.stop_on_entry.into());
}
DebugRequestType::Launch(launch) => {
map.insert("program".into(), launch.program.clone().into());

View file

@ -78,6 +78,7 @@ impl DebugAdapter for LldbDebugAdapter {
match &config.request {
DebugRequestType::Attach(attach) => {
map.insert("pid".into(), attach.process_id.into());
map.insert("stopOnEntry".into(), config.stop_on_entry.into());
}
DebugRequestType::Launch(launch) => {
map.insert("program".into(), launch.program.clone().into());

View file

@ -118,6 +118,7 @@ impl DebugAdapter for PhpDebugAdapter {
json!({
"program": launch_config.program,
"cwd": launch_config.cwd,
"stopOnEntry": config.stop_on_entry,
})
}
}

View file

@ -133,6 +133,7 @@ impl DebugAdapter for PythonDebugAdapter {
"subProcess": true,
"cwd": launch_config.cwd,
"redirectOutput": true,
"StopOnEntry": config.stop_on_entry,
})
}
dap::DebugRequestType::Attach(attach_config) => {