Sign in

    moondbg

    Download zip
    Version
    0.2.1
    License
    Apache-2.0
    Last updated
    last month
    Downloads
    43

    #moondbg

    MoonBit native 程序的 REPL 调试器,通过 lldb-dap 调试,不依赖 Python formatter。

    VS Code 调试及逐步操作说明见 扩展 README。 从本仓库根目录选择“运行 moondbg 扩展(开发窗口)”,再在新窗口选择“moondbg:调试 main(预编译)”。 支持预编译 native 程序的行断点、调用栈、继续、输出和停止;暂不支持自动构建、变量树、表达式求值或 DAP 单步。 当前支持 moondbg --dap 的初始化与会话结束,不启动用户程序或 lldb-dap。

    #命令行使用

    在 MoonBit 项目目录中运行 moondbg <包目录>,例如 moondbg main。 也支持包的项目内相对名称和完整包名。目标必须是支持 native 的可执行包;library 包会被拒绝。 启动时调用当前环境中的 moon check 获取包信息,再调用 moon run --build-only --target native -g 构建目标,自动传入包名和 import alias。 调试构建及元数据保存在项目 _build/moondbg 下。 当前元数据获取需要完整项目检查,其他包或测试的检查错误也会阻止启动。

    进入提示符后可执行:

    b main run next locals bt continue quit

    help 显示完整命令。REPL 内 run 会重新运行已构建的程序;修改源码后重新启动 moondbg 以重新构建。

    已有可执行文件仍可通过 moondbg ./program.exe 调试;需要函数断点时,传入 --current-package <完整包名> 及可重复的 --package-alias alias=package。 显式指定 --current-package 时,整套显式包名和 alias 会替代自动上下文,不会合并。

    #开发与验证

    开发工具链要求见 AGENTS.md。先选择工具链并构建 moondbg:

    source ~/.zshrc set_moon_stable moon info && moon fmt moon check moon test moon build --target native -g repl alias moondbg="$PWD/_build/native/debug/build/repl/repl.exe"

    默认测试不启动真实工具链验收。显式开启后,通过真实 PTY 执行 moondbg:

    MOONDBG_TOOLCHAIN_ACCEPTANCE=1 moon test acceptance/breakpoint_management_wbtest.mbt --no-parallelize MOONDBG_TOOLCHAIN_ACCEPTANCE=1 moon test acceptance --no-parallelize

    第二条包含包启动、断点管理、调用栈、变量及 DAP 验收。2026-09-14 本机 stable 完整验收 20/20 通过,环境和复现说明见测试文档。 T-07 保留此前开发工具链的历史记录。

    #手动体验断点管理

    cd testdata/dwarf_probe moondbg breakpoint_management

    停止后可使用 b 18 或 break 18,在当前选中 frame 的源码文件设置第 18 行断点。 数字是从 1 开始的绝对行号,不支持 +3、-3 或不带参数的 b。源码选择与 list 一致,frame、up、down 会影响此后新建的裸行号断点;已创建的断点固定在原路径上。 尚未停止或选中 frame 没有源码时,会提示使用 b <file>:<line>,不会猜测文件。 原来的 b <function>、b @alias.function 和 b <file>:<line> 仍可使用。

    breakpoints 列出稳定逻辑 ID、启用状态、当前/历史安装结果及已知落点。delete <id>、 disable <id>、enable <id> 只接受一个十进制正整数,不接受范围或 all。禁用保留逻辑 断点,删除不复用 ID;设置跨 run 保持,底层句柄每次运行重新建立。

    以下从新会话开始。第 18 行是 MOONDBG_BREAKPOINT_CHECKPOINT 标记的第一处 println; 若修改了示例,请先核对标记所在行。自动测试从标记读取行号。

    b main b identity b breakpoint_management/main.mbt:18 run breakpoints disable 2 continue

    此时跳过第一轮两个 identity 调用,停在 main 的第一处 println。重新启用并移除该行断点:

    enable 2 delete 3 continue p value continue p value

    两次分别停在第二轮的 identity[Int] 和 identity[Double],value 为 21 和 2.5。 一个 family 逻辑 ID 管理所有落点,locations 是 LLDB 落点数,不是泛型实例统计。

    delete 2 continue breakpoints run delete 1 continue breakpoints quit

    删除 family 后第三轮不再命中;第一次结束后的 breakpoints 将 main 的旧安装标为 previous。重新 run 仍由逻辑 ID 1 停在 main,删除后再次运行至结束,列表为空。

    源码与精确函数的重复目标、零落点 family、非零 frame 选择和变量观察保持由上述两个 门控测试覆盖。当前工具链下该示例此观察点的调用者 frame 局部变量显示不可用;切回 frame 0 可用 p value 观察,不代表管理命令改变了变量状态。

    本轮真实验收只针对本机的 LLDB/lldb-dap;未承诺其他 adapter 版本的 CLI 文本兼容性。 短期不提供交互式 stdin,readline 编辑中的异步输出/重绘仍沿用已有边界。

    DebugBackend

    pub(open) trait DebugBackend {
    async fn launch(Self, executable : String, source_breakpoints : Array[SourceBreakpoint], function_breakpoints : Array[FunctionBreakpoint]) -> RunOutcome
    async fn synchronize_breakpoints(Self, configuration : BreakpointConfiguration) -> BreakpointSyncResult
    async fn abandon_execution(Self) -> Unit
    async fn continue_execution(Self, thread : ThreadSelection) -> RunOutcome
    async fn next(Self, thread : ThreadSelection) -> RunOutcome
    async fn step(Self, thread : ThreadSelection) -> RunOutcome
    async fn finish(Self, thread : ThreadSelection) -> RunOutcome
    async fn stack_snapshot(Self, thread : ThreadSelection, window : StackWindow) -> StackSnapshot
    async fn find_variable(Self, thread : ThreadSelection, frame : FrameSelection, path : VariablePath) -> VariableLookupResult
    async fn local_variables(Self, thread : ThreadSelection, frame : FrameSelection) -> LocalVariablesSnapshot
    fn breakpoint_snapshots(Self) -> Array[BreakpointSnapshot]
    fn function_breakpoint_snapshots(Self) -> Array[FunctionBreakpointSnapshot]
    fn take_output(Self) -> Array[DebugOutput]
    async fn disconnect(Self) -> Unit
    fn close(Self) -> Unit
    }

    High-level debugger capabilities consumed by DebugSession.

    Implementations own adapter processes, executions, capabilities and all protocol-scoped identifiers. Inputs and results are debugger domain values; implementations must not expose protocol messages or transport state.

    BreakpointSyncError

    pub(all) suberror BreakpointSyncError {
    BreakpointSyncRejected(String)
    BreakpointSyncUncertain(String)
    } derive(
    Debug
    )

    DebugBackendError

    pub suberror DebugBackendError {
    BackendFailure(String)
    } derive(
    Debug
    )

    A failure reported by a debugger backend after protocol details have been translated at the adapter boundary.

    DebugBackendError::failure

    fn DebugBackendError::failure(message : String) -> DebugBackendError

    Creates a backend failure after an adapter has removed protocol details.

    DebugContextError

    pub(all) suberror DebugContextError {
    MissingCurrentPackage
    InvalidCurrentPackage(String)
    InvalidPackageAlias(String)
    DuplicatePackageAlias(String)
    UnknownPackageAlias(String)
    } derive(Eq,
    Debug
    )

    Errors produced while constructing or resolving source-visible package names for debugger operations.

    DebugContextError::equal

    DebugContextError::not_equal

    fn DebugContextError::not_equal(x : DebugContextError, y : DebugContextError) -> Bool

    DebugSessionError

    pub suberror DebugSessionError {
    OperationNotAllowed(state~ : DebugSessionState, action~ : String)
    FrameNotLoaded(Int)
    FrameNotFound(Int)
    NoFrameSelected
    NoVisibleCaller(Int)
    NoVisibleCallee(Int)
    AdapterFailure(String)
    BreakpointNotFound(Int)
    BreakpointManagementRejected(String)
    } derive(
    Debug
    )

    StackSnapshotError

    pub(all) suberror StackSnapshotError {
    InvalidLogicalThreadIndex(Int)
    InvalidPhysicalFrameIndex(Int)
    InvalidStackWindow(start~ : Int, count~ : Int)
    InvalidLoadedFrameRange(start~ : Int, count~ : Int)
    LoadedFrameCountMismatch(expected~ : Int, actual~ : Int)
    UnexpectedPhysicalFrameIndex(expected~ : Int, actual~ : Int)
    CompleteStackStartsAfterZero(Int)
    StackExtensionThreadMismatch(expected~ : Int, actual~ : Int)
    StackExtensionMustStartAtZero(Int)
    StackExtensionWentBackwards(previous~ : Int, next~ : Int)
    StackExtensionChangedFrame(Int)
    StackExtensionMadeNoProgress(Int)
    } derive(Eq,
    Debug
    )

    Rejects malformed backend-independent stack values at their construction boundary, before navigation can depend on physical ordering.

    StackSnapshotError::equal

    StackSnapshotError::not_equal

    VariableSnapshotError

    pub(all) suberror VariableSnapshotError {
    InvalidIndexedCollectionElementType(String)
    InvalidIndexedCollectionLength(Int)
    InvalidIndexedCollectionIndex(index~ : Int, total_length~ : Int)
    UnorderedIndexedCollectionIndex(previous~ : Int, index~ : Int)
    InvalidEnumConstructor(String)
    InvalidEnumPayloadType(position~ : Int, type_name~ : String)
    InvalidEnumPayloadPosition(expected~ : Int, actual~ : Int)
    } derive(Eq,
    Debug
    )

    VariableSnapshotError::equal

    VariableSnapshotError::not_equal

    BreakpointConfiguration

    pub struct BreakpointConfiguration {
    // private fields
    }

    A detached desired-configuration value. Accessors return copies: a backend cannot mutate the session's authoritative arrays.

    BreakpointConfiguration::functions

    BreakpointConfiguration::sources

    BreakpointInstallation

    pub enum BreakpointInstallation {
    NotInstalled
    CurrentInstallation(BreakpointStatus)
    PreviousInstallation(BreakpointStatus)
    } derive(Eq,
    Debug
    )

    Installation freshness is independent from the desired enabled flag.

    BreakpointInstallation::equal

    BreakpointInstallation::not_equal

    BreakpointListEntry

    pub struct BreakpointListEntry {
    id : Int
    target : BreakpointTarget
    enabled : Bool
    installation : BreakpointInstallation
    actual_line : Int?
    location_count : Int?
    locations : Array[BreakpointLocation]
    } derive(
    Debug
    )

    BreakpointLocation

    pub(all) struct BreakpointLocation {
    source_path : String?
    line : Int?
    column : Int?
    instruction_reference : String?
    } derive(Eq,
    Debug
    )

    Locations actually reported by the backend; one representative DAP location does not imply that the breakpoint has exactly one resolved location.

    BreakpointLocation::equal

    BreakpointLocation::not_equal

    BreakpointManagementResult

    pub struct BreakpointManagementResult {
    operation : BreakpointOperation
    breakpoint : BreakpointListEntry
    changed : Bool
    } derive(
    Debug
    )

    BreakpointOperation

    pub(all) enum BreakpointOperation {
    DeleteBreakpoint
    DisableBreakpoint
    EnableBreakpoint
    } derive(Eq,
    Debug
    )

    BreakpointOperation::equal

    BreakpointOperation::not_equal

    BreakpointSnapshot

    pub struct BreakpointSnapshot {
    // private fields
    }

    BreakpointSnapshot::actual_line

    fn BreakpointSnapshot::actual_line(self : BreakpointSnapshot) -> Int?

    BreakpointSnapshot::id

    BreakpointSnapshot::locations

    BreakpointSnapshot::pending

    fn BreakpointSnapshot::pending(id : Int, source_path : String, requested_line : Int) -> BreakpointSnapshot

    Creates a pending application-level breakpoint result.

    BreakpointSnapshot::rejected

    fn BreakpointSnapshot::rejected(id : Int, source_path : String, requested_line : Int, message : String) -> BreakpointSnapshot

    Creates a rejected application-level breakpoint result.

    BreakpointSnapshot::requested_line

    fn BreakpointSnapshot::requested_line(self : BreakpointSnapshot) -> Int

    BreakpointSnapshot::source_path

    fn BreakpointSnapshot::source_path(self : BreakpointSnapshot) -> String

    BreakpointSnapshot::status

    BreakpointSnapshot::verified

    fn BreakpointSnapshot::verified(id : Int, source_path : String, requested_line : Int, actual_line : Int?) -> BreakpointSnapshot

    Creates a verified application-level breakpoint result.

    BreakpointSnapshot::with_locations

    BreakpointStatus

    pub enum BreakpointStatus {
    Pending
    Verified
    Rejected(String)
    } derive(Eq,
    Debug
    )

    BreakpointStatus::equal

    BreakpointStatus::not_equal

    fn BreakpointStatus::not_equal(x : BreakpointStatus, y : BreakpointStatus) -> Bool

    BreakpointSyncResult

    pub struct BreakpointSyncResult {
    // private fields
    }

    BreakpointSyncResult::functions

    BreakpointSyncResult::new

    BreakpointSyncResult::sources

    BreakpointTarget

    pub enum BreakpointTarget {
    SourceTarget(display_path~ : String, source_path~ : String, line~ : Int)
    FunctionTarget(display_name~ : String, selector~ : FunctionBreakpointSelector)
    } derive(Eq,
    Debug
    )

    BreakpointTarget::equal

    BreakpointTarget::not_equal

    fn BreakpointTarget::not_equal(x : BreakpointTarget, y : BreakpointTarget) -> Bool

    DebugContext

    pub struct DebugContext {
    // private fields
    }

    Build-system context needed to resolve source package names.

    Alias keys exclude the source-level @. Values are canonical package names used by the compiler and native name mangling.

    DebugContext::current_package

    fn DebugContext::current_package(self : DebugContext) -> String raise DebugContextError

    DebugContext::empty

    fn DebugContext::empty() -> DebugContext

    DebugContext::new

    fn DebugContext::new(current_package : String, package_aliases : Array[(String, String)]) -> DebugContext raise DebugContextError

    DebugContext::package_for_alias

    fn DebugContext::package_for_alias(self : DebugContext, alias_name : StringView) -> String raise DebugContextError

    DebugOutput

    pub struct DebugOutput {
    // private fields
    }

    DebugOutput::kind

    DebugOutput::other

    fn DebugOutput::other(text : String) -> DebugOutput

    Creates output which is neither stdout nor stderr.

    DebugOutput::standard_error

    fn DebugOutput::standard_error(text : String) -> DebugOutput

    Creates standard error after an adapter has classified its channel.

    DebugOutput::standard_output

    fn DebugOutput::standard_output(text : String) -> DebugOutput

    Creates standard output after an adapter has classified its channel.

    DebugOutput::text

    fn DebugOutput::text(self : DebugOutput) -> String

    DebugOutputKind

    pub enum DebugOutputKind {
    StandardOutput
    StandardError
    OtherOutput
    } derive(Eq,
    Debug
    )

    DebugOutputKind::equal

    DebugOutputKind::not_equal

    fn DebugOutputKind::not_equal(x : DebugOutputKind, y : DebugOutputKind) -> Bool

    DebugSession

    pub struct DebugSession {
    // private fields
    }

    Owns debugger configuration and application state for one frontend session. Adapter resources and protocol state are held behind backend.

    DebugSession::add_function_breakpoint

    async fn DebugSession::add_function_breakpoint(self : DebugSession, request : FunctionBreakpointRequest) -> FunctionBreakpointSnapshot

    DebugSession::add_source_breakpoint

    async fn DebugSession::add_source_breakpoint(self : DebugSession, source_path : String, line : Int, display_path? : String) -> BreakpointSnapshot

    DebugSession::breakpoint_configuration

    fn DebugSession::breakpoint_configuration(self : DebugSession) -> BreakpointConfiguration

    DebugSession::breakpoints

    This query performs no async work and never waits for adapter preparation.

    DebugSession::close

    fn DebugSession::close(self : DebugSession) -> Unit

    DebugSession::complete_stack_snapshot

    async fn DebugSession::complete_stack_snapshot(self : DebugSession) -> StackSnapshot raise DebugSessionError

    Loads the complete physical stack for the current thread. totalFrames hints never terminate this loop; only a backend-confirmed short/empty page marks the returned snapshot complete.

    DebugSession::continue_execution

    async fn DebugSession::continue_execution(self : DebugSession) -> RunOutcome

    DebugSession::disconnect

    async fn DebugSession::disconnect(self : DebugSession) -> Unit

    DebugSession::execution_epoch

    fn DebugSession::execution_epoch(self : DebugSession) -> ExecutionEpoch?

    DebugSession::find_variable

    async fn DebugSession::find_variable(self : DebugSession, path : VariablePath) -> VariableLookupResult

    DebugSession::finish

    async fn DebugSession::finish(self : DebugSession) -> RunOutcome

    DebugSession::function_breakpoints

    fn DebugSession::function_breakpoints(self : DebugSession) -> Array[FunctionBreakpointSnapshot]

    DebugSession::last_stop_snapshot

    fn DebugSession::last_stop_snapshot(self : DebugSession) -> StopSnapshot?

    DebugSession::local_variables

    async fn DebugSession::local_variables(self : DebugSession) -> LocalVariablesSnapshot

    Returns bounded local-variable summaries for the selected physical frame.

    DebugSession::manage_breakpoint

    async fn DebugSession::manage_breakpoint(self : DebugSession, id : Int, operation : BreakpointOperation) -> BreakpointManagementResult

    DebugSession::new

    fn DebugSession::new(executable : String, backend : &DebugBackend, debug_context? : DebugContext) -> DebugSession

    Creates a session around an injected debugger backend.

    DebugSession::next

    async fn DebugSession::next(self : DebugSession) -> RunOutcome

    DebugSession::run

    async fn DebugSession::run(self : DebugSession) -> RunOutcome

    DebugSession::select_frame

    async fn DebugSession::select_frame(self : DebugSession, physical_index : Int) -> StackFrameSnapshot raise DebugSessionError

    Selects a frame by physical stack index, loading consecutive windows when necessary.

    DebugSession::select_visible_callee_frame

    fn DebugSession::select_visible_callee_frame(self : DebugSession) -> StackFrameSnapshot raise DebugSessionError

    Selects the next visible callee without renumbering hidden frames.

    DebugSession::select_visible_caller_frame

    async fn DebugSession::select_visible_caller_frame(self : DebugSession) -> StackFrameSnapshot raise DebugSessionError

    Selects the next visible caller without renumbering hidden frames.

    DebugSession::selected_frame

    fn DebugSession::selected_frame(self : DebugSession) -> FrameSelection?

    DebugSession::selected_frame_snapshot

    fn DebugSession::selected_frame_snapshot(self : DebugSession) -> StackFrameSnapshot?

    Returns the selected frame without changing the original stop snapshot.

    DebugSession::selected_thread

    fn DebugSession::selected_thread(self : DebugSession) -> ThreadSelection?

    DebugSession::source_breakpoints

    fn DebugSession::source_breakpoints(self : DebugSession) -> Array[BreakpointSnapshot]

    DebugSession::stack_snapshot

    fn DebugSession::stack_snapshot(self : DebugSession) -> StackSnapshot?

    Returns the currently loaded stack window for the stable stop.

    DebugSession::state

    DebugSession::step

    async fn DebugSession::step(self : DebugSession) -> RunOutcome

    DebugSession::stop_epoch

    fn DebugSession::stop_epoch(self : DebugSession) -> StopEpoch?

    DebugSession::take_output

    fn DebugSession::take_output(self : DebugSession) -> Array[DebugOutput]

    DebugSessionState

    pub enum DebugSessionState {
    Ready
    Running
    Stopped
    Exited
    Failed
    } derive(Eq,
    Debug
    )

    User-visible debugger phase owned by DebugSession.

    Adapter initialization and protocol configuration states intentionally do not appear here.

    DebugSessionState::equal

    DebugSessionState::not_equal

    fn DebugSessionState::not_equal(x : DebugSessionState, y : DebugSessionState) -> Bool

    ExecutionEpoch

    pub struct ExecutionEpoch {
    // private fields
    } derive(Eq,
    Debug
    )

    Identifies one launch attempt within a DebugSession. Values are monotonic and contain no adapter execution identifier.

    ExecutionEpoch::equal

    ExecutionEpoch::not_equal

    fn ExecutionEpoch::not_equal(x : ExecutionEpoch, y : ExecutionEpoch) -> Bool

    ExecutionEpoch::number

    fn ExecutionEpoch::number(self : ExecutionEpoch) -> Int

    FrameKind

    pub(all) enum FrameKind {
    MoonBitUserFrame
    MoonBitRuntimeFrame
    NativeFrame
    UnknownFrame
    } derive(Eq,
    Debug
    )

    Application-level classification used by default stack filtering.

    UnknownFrame deliberately preserves uncertainty when an adapter does not provide enough information to distinguish runtime and native frames.

    FrameKind::equal

    fn FrameKind::equal(FrameKind, FrameKind) -> Bool

    FrameKind::not_equal

    fn FrameKind::not_equal(x : FrameKind, y : FrameKind) -> Bool

    FrameNavigationResult

    pub enum FrameNavigationResult {
    FrameAvailable(FrameSelection)
    MoreFramesRequired(start_frame~ : Int)
    VisibleFrameBoundary
    } derive(Eq,
    Debug
    )

    Result of moving through frames visible under the default filter.

    FrameNavigationResult::equal

    FrameNavigationResult::not_equal

    FrameSelection

    pub struct FrameSelection {
    // private fields
    } derive(Eq,
    Debug
    )

    A zero-based physical frame selection inside the selected thread.

    Hidden runtime/native frames keep their physical positions, so visible frame numbers may contain gaps. Backend-specific stack-frame identifiers never appear in this value.

    FrameSelection::equal

    FrameSelection::index

    fn FrameSelection::index(self : FrameSelection) -> Int

    FrameSelection::not_equal

    fn FrameSelection::not_equal(x : FrameSelection, y : FrameSelection) -> Bool

    FunctionBreakpoint

    pub struct FunctionBreakpoint {
    // private fields
    }

    A stable application-level function breakpoint after package and native symbol resolution. Adapter-specific breakpoint identifiers are not stored.

    FunctionBreakpoint::display_name

    fn FunctionBreakpoint::display_name(self : FunctionBreakpoint) -> String

    FunctionBreakpoint::enabled

    fn FunctionBreakpoint::enabled(self : FunctionBreakpoint) -> Bool

    FunctionBreakpoint::id

    FunctionBreakpoint::selector

    FunctionBreakpointRequest

    pub enum FunctionBreakpointRequest {
    CurrentPackageFunction(String)
    ImportedPackageFunction(String, String)
    } derive(Eq,
    Debug
    )

    A source-level request for one top-level MoonBit function.

    Package aliases stay unresolved until DebugSession applies the build-system DebugContext. Physical native symbols are intentionally absent here.

    FunctionBreakpointRequest::current

    fn FunctionBreakpointRequest::current(function_name : String) -> FunctionBreakpointRequest

    FunctionBreakpointRequest::display_name

    fn FunctionBreakpointRequest::display_name(self : FunctionBreakpointRequest) -> String

    FunctionBreakpointRequest::equal

    FunctionBreakpointRequest::imported

    fn FunctionBreakpointRequest::imported(package_alias : String, function_name : String) -> FunctionBreakpointRequest

    FunctionBreakpointRequest::not_equal

    FunctionBreakpointSelector

    pub enum FunctionBreakpointSelector {
    ExactPhysicalFunction(String)
    MoonBitFunctionFamily(String)
    } derive(Eq,
    Debug
    )

    Backend-independent physical matching strategy for a function breakpoint.

    FunctionBreakpointSelector::equal

    FunctionBreakpointSelector::exact_physical

    fn FunctionBreakpointSelector::exact_physical(physical_name : String) -> FunctionBreakpointSelector

    FunctionBreakpointSelector::family

    fn FunctionBreakpointSelector::family(mangled_base : String) -> FunctionBreakpointSelector

    FunctionBreakpointSelector::not_equal

    FunctionBreakpointSnapshot

    pub struct FunctionBreakpointSnapshot {
    // private fields
    }

    FunctionBreakpointSnapshot::display_name

    fn FunctionBreakpointSnapshot::display_name(self : FunctionBreakpointSnapshot) -> String

    FunctionBreakpointSnapshot::id

    FunctionBreakpointSnapshot::location_count

    fn FunctionBreakpointSnapshot::location_count(self : FunctionBreakpointSnapshot) -> Int?

    FunctionBreakpointSnapshot::locations

    FunctionBreakpointSnapshot::pending

    fn FunctionBreakpointSnapshot::pending(id : Int, display_name : String) -> FunctionBreakpointSnapshot

    FunctionBreakpointSnapshot::rejected

    fn FunctionBreakpointSnapshot::rejected(id : Int, display_name : String, message : String, location_count? : Int?) -> FunctionBreakpointSnapshot

    FunctionBreakpointSnapshot::status

    FunctionBreakpointSnapshot::verified

    fn FunctionBreakpointSnapshot::verified(id : Int, display_name : String, location_count? : Int?) -> FunctionBreakpointSnapshot

    FunctionBreakpointSnapshot::with_locations

    IndexedCollectionKind

    pub(all) enum IndexedCollectionKind {
    FixedArrayCollection
    ArrayCollection
    } derive(Eq,
    Debug
    )

    The source-level MoonBit collection represented by an indexed preview.

    IndexedCollectionKind::equal

    IndexedCollectionKind::not_equal

    IndexedCollectionKind::source_name

    fn IndexedCollectionKind::source_name(self : IndexedCollectionKind) -> String

    IndexedCollectionSnapshot

    pub struct IndexedCollectionSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    IndexedCollectionSnapshot::element_type_name

    fn IndexedCollectionSnapshot::element_type_name(self : IndexedCollectionSnapshot) -> String

    IndexedCollectionSnapshot::equal

    IndexedCollectionSnapshot::is_complete

    IndexedCollectionSnapshot::kind

    IndexedCollectionSnapshot::new

    fn IndexedCollectionSnapshot::new(kind : IndexedCollectionKind, element_type_name : String, total_length : Int, preview_elements : Array[IndexedVariableElement]) -> IndexedCollectionSnapshot raise VariableSnapshotError

    IndexedCollectionSnapshot::not_equal

    IndexedCollectionSnapshot::omitted_count

    fn IndexedCollectionSnapshot::omitted_count(self : IndexedCollectionSnapshot) -> Int

    IndexedCollectionSnapshot::preview_elements

    fn IndexedCollectionSnapshot::preview_elements(self : IndexedCollectionSnapshot) -> ReadOnlyArray[IndexedVariableElement]

    IndexedCollectionSnapshot::total_length

    IndexedVariableElement

    pub struct IndexedVariableElement {
    // private fields
    } derive(Eq,
    Debug
    )

    IndexedVariableElement::equal

    IndexedVariableElement::index

    IndexedVariableElement::not_equal

    IndexedVariableElement::placeholder

    fn IndexedVariableElement::placeholder(index : Int) -> IndexedVariableElement

    IndexedVariableElement::value

    IndexedVariableElement::with_value

    fn IndexedVariableElement::with_value(index : Int, value : VariableSnapshot) -> IndexedVariableElement

    LocalCompactValue

    pub(all) enum LocalCompactValue {
    LocalScalar(String)
    LocalCollection(IndexedCollectionKind, Int)
    LocalStructure
    LocalEnumConstructor(String)
    LocalOpaque
    } derive(Eq,
    Debug
    )

    A bounded, presentation-independent summary of one available local value.

    LocalCompactValue::equal

    LocalCompactValue::not_equal

    fn LocalCompactValue::not_equal(x : LocalCompactValue, y : LocalCompactValue) -> Bool

    LocalScopeAvailability

    pub(all) enum LocalScopeAvailability {
    LocalScopeAvailable
    LocalScopeUnavailable
    } derive(Eq,
    Debug
    )

    Whether lldb-dap exposed a Locals scope for the selected physical frame.

    LocalScopeAvailability::equal

    LocalScopeAvailability::not_equal

    LocalVariableAvailability

    pub(all) enum LocalVariableAvailability {
    LocalVariableAvailable(LocalCompactValue)
    LocalVariableUnavailable
    LocalVariableAmbiguous
    } derive(Eq,
    Debug
    )

    Availability is kept separate from value shape so frontends never have to parse adapter error strings or invent a value for an ambiguous binding.

    LocalVariableAvailability::equal

    LocalVariableAvailability::not_equal

    LocalVariableSnapshot

    pub struct LocalVariableSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    One source-facing local or parameter in the selected physical frame.

    LocalVariableSnapshot::availability

    LocalVariableSnapshot::equal

    LocalVariableSnapshot::name

    fn LocalVariableSnapshot::name(self : LocalVariableSnapshot) -> String

    LocalVariableSnapshot::new

    fn LocalVariableSnapshot::new(name : String, type_name : String?, availability : LocalVariableAvailability) -> LocalVariableSnapshot

    LocalVariableSnapshot::not_equal

    LocalVariableSnapshot::type_name

    fn LocalVariableSnapshot::type_name(self : LocalVariableSnapshot) -> String?

    LocalVariablesSnapshot

    pub struct LocalVariablesSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    The local-variable result for one selected physical frame. An available empty scope is intentionally distinct from a frame with no Locals scope.

    LocalVariablesSnapshot::available

    LocalVariablesSnapshot::equal

    LocalVariablesSnapshot::frame

    LocalVariablesSnapshot::not_equal

    LocalVariablesSnapshot::scope_availability

    LocalVariablesSnapshot::scope_unavailable

    LocalVariablesSnapshot::thread

    LocalVariablesSnapshot::variables

    RunOutcome

    pub enum RunOutcome {
    Stopped(StopSnapshot)
    Exited(Int?)
    }

    RunOutcome::exited

    fn RunOutcome::exited(exit_code : Int?) -> RunOutcome

    RunOutcome::stopped

    fn RunOutcome::stopped(snapshot : StopSnapshot) -> RunOutcome

    SourceBreakpoint

    pub struct SourceBreakpoint {
    // private fields
    }

    A source breakpoint configured by the application layer.

    Its id is stable for the lifetime of a DebugSession. Backend-specific breakpoint identifiers must not be stored in this value.

    SourceBreakpoint::display_path

    fn SourceBreakpoint::display_path(self : SourceBreakpoint) -> String

    SourceBreakpoint::enabled

    fn SourceBreakpoint::enabled(self : SourceBreakpoint) -> Bool

    SourceBreakpoint::id

    fn SourceBreakpoint::id(self : SourceBreakpoint) -> Int

    SourceBreakpoint::requested_line

    fn SourceBreakpoint::requested_line(self : SourceBreakpoint) -> Int

    SourceBreakpoint::source_path

    fn SourceBreakpoint::source_path(self : SourceBreakpoint) -> String

    StackFrameSnapshot

    pub struct StackFrameSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    A backend-independent frame description at one physical stack depth.

    StackFrameSnapshot::column

    fn StackFrameSnapshot::column(self : StackFrameSnapshot) -> Int?

    StackFrameSnapshot::display_name

    fn StackFrameSnapshot::display_name(self : StackFrameSnapshot) -> String

    StackFrameSnapshot::equal

    StackFrameSnapshot::kind

    StackFrameSnapshot::line

    fn StackFrameSnapshot::line(self : StackFrameSnapshot) -> Int?

    StackFrameSnapshot::linkage_name

    fn StackFrameSnapshot::linkage_name(self : StackFrameSnapshot) -> String?

    StackFrameSnapshot::new

    fn StackFrameSnapshot::new(physical_index : Int, raw_name : String, display_name : String, linkage_name : String?, source_path : String?, line : Int?, column : Int?, kind : FrameKind) -> StackFrameSnapshot raise StackSnapshotError

    StackFrameSnapshot::not_equal

    StackFrameSnapshot::physical_index

    fn StackFrameSnapshot::physical_index(self : StackFrameSnapshot) -> Int

    StackFrameSnapshot::raw_name

    fn StackFrameSnapshot::raw_name(self : StackFrameSnapshot) -> String

    StackFrameSnapshot::source_path

    fn StackFrameSnapshot::source_path(self : StackFrameSnapshot) -> String?

    StackSnapshot

    pub struct StackSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    A possibly partial stack snapshot for one logical thread.

    The loaded range is [loaded_start, loaded_start + loaded_count). A total_frames_hint is advisory only: adapters may report an unstable total. complete is the backend's positive assertion that no physical frame lies outside the loaded range.

    StackSnapshot::default_selection

    fn StackSnapshot::default_selection(self : StackSnapshot) -> FrameSelection?

    Chooses the nearest loaded MoonBit user frame, retaining its physical index. A partial stack with no user frame remains unselected so its caller can load the next window. Only a complete non-empty stack falls back to its first frame for diagnostics.

    StackSnapshot::equal

    StackSnapshot::frame

    fn StackSnapshot::frame(self : StackSnapshot, physical_index : Int) -> StackFrameSnapshot?

    StackSnapshot::frames

    fn StackSnapshot::frames(self : StackSnapshot) -> ReadOnlyArray[StackFrameSnapshot]

    StackSnapshot::is_complete

    fn StackSnapshot::is_complete(self : StackSnapshot) -> Bool

    StackSnapshot::is_loaded

    fn StackSnapshot::is_loaded(self : StackSnapshot, physical_index : Int) -> Bool

    StackSnapshot::loaded_count

    fn StackSnapshot::loaded_count(self : StackSnapshot) -> Int

    StackSnapshot::loaded_end

    fn StackSnapshot::loaded_end(self : StackSnapshot) -> Int

    StackSnapshot::loaded_start

    fn StackSnapshot::loaded_start(self : StackSnapshot) -> Int

    StackSnapshot::new

    fn StackSnapshot::new(thread : ThreadSelection, frames : Array[StackFrameSnapshot], loaded_start : Int, loaded_count : Int, total_frames_hint : Int?, complete : Bool) -> StackSnapshot raise StackSnapshotError

    StackSnapshot::not_equal

    fn StackSnapshot::not_equal(x : StackSnapshot, y : StackSnapshot) -> Bool

    StackSnapshot::selection

    fn StackSnapshot::selection(self : StackSnapshot, physical_index : Int) -> FrameSelection?

    StackSnapshot::thread

    StackSnapshot::total_frames_hint

    fn StackSnapshot::total_frames_hint(self : StackSnapshot) -> Int?

    StackSnapshot::validate_extension

    fn StackSnapshot::validate_extension(self : StackSnapshot, next : StackSnapshot) -> Unit raise StackSnapshotError

    Validates a cumulative prefix returned after requesting a later window. Existing physical frames are immutable, and an incomplete extension must add at least one frame.

    StackSnapshot::visible_callee

    fn StackSnapshot::visible_callee(self : StackSnapshot, selection : FrameSelection) -> FrameNavigationResult

    StackSnapshot::visible_caller

    fn StackSnapshot::visible_caller(self : StackSnapshot, selection : FrameSelection) -> FrameNavigationResult

    StackSnapshot::visible_frames

    fn StackSnapshot::visible_frames(self : StackSnapshot) -> Array[StackFrameSnapshot]

    StackWindow

    pub struct StackWindow {
    // private fields
    } derive(Eq,
    Debug
    )

    A requested physical stack range. It is independent of DAP pagination and can be satisfied from a backend cache.

    StackWindow::count

    fn StackWindow::count(self : StackWindow) -> Int

    StackWindow::equal

    fn StackWindow::equal(StackWindow, StackWindow) -> Bool

    StackWindow::initial

    fn StackWindow::initial() -> StackWindow

    StackWindow::new

    fn StackWindow::new(start : Int, count : Int) -> StackWindow raise StackSnapshotError

    StackWindow::not_equal

    fn StackWindow::not_equal(x : StackWindow, y : StackWindow) -> Bool

    StackWindow::start

    fn StackWindow::start(self : StackWindow) -> Int

    StopEpoch

    pub struct StopEpoch {
    // private fields
    } derive(Eq,
    Debug
    )

    Identifies one stable stop inside an application execution epoch. The stop number restarts at one for each execution.

    StopEpoch::equal

    fn StopEpoch::equal(StopEpoch, StopEpoch) -> Bool

    StopEpoch::execution

    fn StopEpoch::execution(self : StopEpoch) -> ExecutionEpoch

    StopEpoch::not_equal

    fn StopEpoch::not_equal(x : StopEpoch, y : StopEpoch) -> Bool

    StopEpoch::number

    fn StopEpoch::number(self : StopEpoch) -> Int

    StopSnapshot

    pub struct StopSnapshot {
    // private fields
    }

    StopSnapshot::column

    fn StopSnapshot::column(self : StopSnapshot) -> Int?

    StopSnapshot::function_name

    fn StopSnapshot::function_name(self : StopSnapshot) -> String

    StopSnapshot::line

    fn StopSnapshot::line(self : StopSnapshot) -> Int?

    StopSnapshot::new

    fn StopSnapshot::new(reason : String, function_name : String, source_path : String?, line : Int?, column : Int?) -> StopSnapshot

    Creates an application-level stopped-location snapshot.

    StopSnapshot::reason

    fn StopSnapshot::reason(self : StopSnapshot) -> String

    StopSnapshot::source_path

    fn StopSnapshot::source_path(self : StopSnapshot) -> String?

    ThreadSelection

    pub struct ThreadSelection {
    // private fields
    } derive(Eq,
    Debug
    )

    A zero-based logical thread selection inside the current stable stop. Backend-specific thread identifiers never appear in this value.

    ThreadSelection::at

    ThreadSelection::equal

    ThreadSelection::index

    fn ThreadSelection::index(self : ThreadSelection) -> Int

    ThreadSelection::initial

    ThreadSelection::not_equal

    fn ThreadSelection::not_equal(x : ThreadSelection, y : ThreadSelection) -> Bool

    VariableContent

    pub enum VariableContent {
    VariableLeaf
    VariableStructure(VariableStructureSnapshot)
    VariableIndexedCollection(IndexedCollectionSnapshot)
    VariableEnum(VariableEnumSnapshot)
    } derive(Eq,
    Debug
    )

    VariableContent::equal

    VariableContent::not_equal

    fn VariableContent::not_equal(x : VariableContent, y : VariableContent) -> Bool

    VariableEnumPayload

    pub struct VariableEnumPayload {
    // private fields
    } derive(Eq,
    Debug
    )

    One direct payload slot in an active MoonBit enum constructor.

    The position is retained explicitly for a future PayloadIndex lookup step. A missing scalar value means the payload is represented by its source type only; it does not mean that adapter children remain available.

    VariableEnumPayload::aggregate

    fn VariableEnumPayload::aggregate(position : Int, type_name : String) -> VariableEnumPayload

    VariableEnumPayload::equal

    VariableEnumPayload::not_equal

    VariableEnumPayload::position

    fn VariableEnumPayload::position(self : VariableEnumPayload) -> Int

    VariableEnumPayload::scalar

    fn VariableEnumPayload::scalar(position : Int, type_name : String, value : String) -> VariableEnumPayload

    VariableEnumPayload::scalar_value

    fn VariableEnumPayload::scalar_value(self : VariableEnumPayload) -> String?

    VariableEnumPayload::type_name

    fn VariableEnumPayload::type_name(self : VariableEnumPayload) -> String

    VariableEnumSnapshot

    pub struct VariableEnumSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    VariableEnumSnapshot::constructor_name

    fn VariableEnumSnapshot::constructor_name(self : VariableEnumSnapshot) -> String

    VariableEnumSnapshot::equal

    VariableEnumSnapshot::new

    fn VariableEnumSnapshot::new(constructor_name : String, payload : Array[VariableEnumPayload]) -> VariableEnumSnapshot raise VariableSnapshotError

    VariableEnumSnapshot::not_equal

    VariableEnumSnapshot::payload

    fn VariableEnumSnapshot::payload(self : VariableEnumSnapshot) -> ReadOnlyArray[VariableEnumPayload]

    VariableLookupFailure

    pub enum VariableLookupFailure {
    VariableRootNotFound(String)
    VariableFieldNotFound(String, String)
    VariableFieldAccessOnNonStruct(String, String, String?)
    VariableIndexAccessOnNonCollection(String, Int, String?)
    VariableIndexOutOfBounds(String, Int, Int)
    VariableUnavailable(String)
    } derive(Eq,
    Debug
    )

    A domain-level reason why one variable path could not be inspected.

    VariableLookupFailure::equal

    VariableLookupFailure::not_equal

    VariableLookupFailure::requested_path

    fn VariableLookupFailure::requested_path(self : VariableLookupFailure) -> String

    VariableLookupResult

    pub enum VariableLookupResult {
    VariableFound(VariableSnapshot)
    VariableLookupFailed(VariableLookupFailure)
    } derive(Eq,
    Debug
    )

    VariableLookupResult::equal

    VariableLookupResult::field_access_on_non_struct

    fn VariableLookupResult::field_access_on_non_struct(owner : String, field : String, type_name : String?) -> VariableLookupResult

    VariableLookupResult::field_not_found

    fn VariableLookupResult::field_not_found(owner : String, field : String) -> VariableLookupResult

    VariableLookupResult::found

    VariableLookupResult::index_access_on_non_collection

    fn VariableLookupResult::index_access_on_non_collection(owner : String, index : Int, type_name : String?) -> VariableLookupResult

    VariableLookupResult::index_out_of_bounds

    fn VariableLookupResult::index_out_of_bounds(owner : String, index : Int, total_length : Int) -> VariableLookupResult

    VariableLookupResult::not_equal

    VariableLookupResult::not_found

    fn VariableLookupResult::not_found(name : String) -> VariableLookupResult

    VariableLookupResult::unavailable

    fn VariableLookupResult::unavailable(path : String) -> VariableLookupResult

    VariablePath

    pub struct VariablePath {
    // private fields
    } derive(Eq,
    Debug
    )

    A parsed variable lookup path owned by debugger core.

    Adapter references and expression-evaluator text intentionally do not appear in this value.

    VariablePath::display_name

    fn VariablePath::display_name(self : VariablePath) -> String

    VariablePath::equal

    VariablePath::new

    fn VariablePath::new(root : String, steps : Array[VariablePathStep]) -> VariablePath

    Creates a variable path from an ordered sequence of field and index steps.

    VariablePath::not_equal

    fn VariablePath::not_equal(x : VariablePath, y : VariablePath) -> Bool

    VariablePath::root

    fn VariablePath::root(root : String) -> VariablePath

    VariablePath::root_name

    fn VariablePath::root_name(self : VariablePath) -> String

    VariablePath::steps

    fn VariablePath::steps(self : VariablePath) -> ReadOnlyArray[VariablePathStep]

    VariablePath::with_fields

    fn VariablePath::with_fields(root : String, fields : Array[String]) -> VariablePath

    VariablePathStep

    pub(all) enum VariablePathStep {
    Field(String)
    Index(Int)
    } derive(Eq,
    Debug
    )

    One backend-independent step in a variable lookup path.

    VariablePathStep::equal

    VariablePathStep::not_equal

    fn VariablePathStep::not_equal(x : VariablePathStep, y : VariablePathStep) -> Bool

    VariableSnapshot

    pub struct VariableSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    VariableSnapshot::content

    VariableSnapshot::enum_value

    fn VariableSnapshot::enum_value(name : String, type_name : String?, enum_value : VariableEnumSnapshot) -> VariableSnapshot

    Creates a debugger-domain enum value without retaining an adapter pointer.

    VariableSnapshot::equal

    VariableSnapshot::expanded

    fn VariableSnapshot::expanded(name : String, value : String, type_name : String?, children : Array[VariableSnapshot]) -> VariableSnapshot

    Creates a debugger-domain variable whose structure was fully materialized.

    VariableSnapshot::indexed_collection

    fn VariableSnapshot::indexed_collection(name : String, value : String, type_name : String?, collection : IndexedCollectionSnapshot) -> VariableSnapshot

    Creates a debugger-domain indexed collection with an adapter-free preview.

    VariableSnapshot::name

    fn VariableSnapshot::name(self : VariableSnapshot) -> String

    VariableSnapshot::new

    fn VariableSnapshot::new(name : String, value : String, type_name : String?) -> VariableSnapshot

    Creates a debugger-domain variable value with no adapter reference.

    VariableSnapshot::not_equal

    fn VariableSnapshot::not_equal(x : VariableSnapshot, y : VariableSnapshot) -> Bool

    VariableSnapshot::truncated

    fn VariableSnapshot::truncated(name : String, value : String, type_name : String?, children : Array[VariableSnapshot]) -> VariableSnapshot

    Creates a debugger-domain structure whose remaining children were omitted.

    VariableSnapshot::type_name

    fn VariableSnapshot::type_name(self : VariableSnapshot) -> String?

    VariableSnapshot::value

    fn VariableSnapshot::value(self : VariableSnapshot) -> String

    VariableStructureSnapshot

    pub struct VariableStructureSnapshot {
    // private fields
    } derive(Eq,
    Debug
    )

    VariableStructureSnapshot::children

    VariableStructureSnapshot::equal

    VariableStructureSnapshot::is_truncated

    fn VariableStructureSnapshot::is_truncated(self : VariableStructureSnapshot) -> Bool

    VariableStructureSnapshot::not_equal