use super::*;
mod active_file;
mod adapters;
mod attach;
mod breakpoint_list;
mod breakpoints;
mod builds;
mod compounds;
mod configs;
mod console;
mod controls;
mod debug_test;
mod events;
mod inline_values;
mod launch;
mod python;
mod setup;
mod view;
mod watches;
pub(super) use adapters::lldb_dap_missing_message;
pub(super) use adapters::lldb_dap_path;
#[cfg(test)]
pub(super) use adapters::lldb_dap_rank;
use breakpoint_list::*;
pub(super) use compounds::finished_settles_pending;
pub(super) use compounds::pending_abort_reason;
use console::*;
#[cfg(test)]
pub(super) use events::debug_end_message;
#[cfg(test)]
pub(super) use events::index_after_removals;
#[cfg(test)]
pub(crate) use launch::no_display;
#[cfg(test)]
pub(super) use launch::resolve_lldb_program;
pub(super) use python::config_project_python;
pub(super) use python::debug_test_python;
pub(super) use python::debuggee_python;
pub(super) use python::debuggee_python_note;
pub(super) use python::launch_request_python;
pub(super) use python::project_python_for;
use python::*;
pub(super) use setup::DebugSetup;
use setup::ParkedLaunch;
pub(super) struct DebugState {
pub(super) pause_reason: Option<String>,
pub(super) temp_breakpoint: Option<(PathBuf, usize)>,
pub(super) temp_note: Option<String>,
pub(super) sessions: crate::dap::session::DebugSessions,
pub(super) configs: Vec<crate::dap::configs::DebugConfig>,
pub(super) config_draft: Option<crate::dap::configs::ConfigDraft>,
pub(super) compounds: Vec<crate::dap::configs::Compound>,
pub(super) stop_all: bool,
pub(super) post_tasks: Vec<String>,
pub(super) compound: Option<String>,
pub(super) setups: Vec<debugger::DebugSetup>,
pub(super) tooling: std::sync::Arc<dyn crate::dap::install::DebugTooling>,
pub(super) build: Option<(
PathBuf,
std::sync::mpsc::Receiver<Result<crate::cpp_build::Built, crate::cpp_build::Failed>>,
)>,
pub(super) expanded: std::collections::HashSet<i64>,
pub(super) copy_pending: Option<(String, String)>,
pub(super) console: Vec<crate::ansi_text::AnsiLine>,
pub(super) console_dropped: usize,
pub(super) ever_stopped: bool,
}
impl DebugState {
pub(super) fn new() -> Self {
Self {
pause_reason: None,
temp_breakpoint: None,
temp_note: None,
sessions: Default::default(),
configs: Vec::new(),
config_draft: None,
compounds: Vec::new(),
stop_all: false,
post_tasks: Vec::new(),
compound: None,
setups: Vec::new(),
tooling: std::sync::Arc::new(crate::dap::install::MachineTooling),
build: None,
expanded: std::collections::HashSet::new(),
copy_pending: None,
console: Vec::new(),
console_dropped: 0,
ever_stopped: false,
}
}
}
pub(super) const REAPER_TEARDOWN_GRACE_MS: u64 = 250;
pub(super) enum PendingLaunchStep {
Resolved(Box<crate::dap::configs::ResolvedConfig>),
Member(Box<crate::dap::configs::DebugConfig>),
Members(Box<CompoundLaunch>),
}
#[derive(Clone, Copy, PartialEq)]
pub(super) enum MemberOutcome {
Launched,
Building,
Preparing,
TaskUnrun,
Failed,
}
#[derive(Clone, Copy)]
pub(super) enum LaunchSlot {
Replace,
Add,
}
pub(super) enum InputThen {
Launch(Box<crate::dap::configs::DebugConfig>),
Compound(Box<crate::dap::configs::Compound>),
Task(Box<crate::tasks::Task>),
}
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
pub(super) enum PreLaunchWait {
Exit,
FirstBuild,
Untracked,
}
impl PreLaunchWait {
pub(super) fn of(task: &crate::tasks::Task) -> Self {
if !task.is_background {
return Self::Exit;
}
let watches = task
.problem_matcher
.as_ref()
.and_then(crate::problem_matchers::from_tasks_json)
.is_some_and(|m| m.background.is_some());
if watches {
Self::FirstBuild
} else {
Self::Untracked
}
}
}
pub(super) const PRELAUNCH_MARK_GRACE: std::time::Duration = std::time::Duration::from_secs(15);