# Debugger

`import { Debugger } from "destack:debug";`

Debugger for one world.

```ds title="Debugger"
export class Debugger {
    world: WorldHandle;
    constructor(world: WorldHandle);
    stop(): Result<Stop, HostError>;
    point(view: WorldViewHandle, worker: WorkerId, frame: FrameId): Result<Point, HostError>;
    scopes(view: WorldViewHandle, frame: FrameId, limit: uint32, after?: ScopeId | undefined): Result<ScopePage, HostError>;
    bindings(view: WorldViewHandle, scope: ScopeId, limit: uint32, after?: BindingId | undefined): Result<BindingPage, HostError>;
    read(view: WorldViewHandle, frame: FrameId, binding: BindingId): Result<Value, HostError>;
    pause(): Result<Stop, HostError>;
    resume(): Result<Stop, HostError>;
    step(worker: WorkerId, options: StepOptions): Result<Stop, HostError>;
    rewind(moment: Moment): Result<Stop, HostError>;
    runTo(moment: Moment): Result<Stop, HostError>;
    forkAt(moment: Moment): Result<BranchId, HostError>;
}
```

[language/library/src/debug/debug.ds:176:261](https://github.com/destack-sh/destack/blob/main/language/library/src/debug/debug.ds#L176-L261)

## Members

### `world: WorldHandle`

World controlled by this debugger.

### `constructor(world: WorldHandle)`

Create a debugger.

### `stop(): Result<Stop, HostError>`

Return the current stop state.

### `point(view: WorldViewHandle, worker: WorkerId, frame: FrameId): Result<Point, HostError>`

Return the debug point for one frame.

### `scopes(view: WorldViewHandle, frame: FrameId, limit: uint32, after?: ScopeId | undefined): Result<ScopePage, HostError>`

List source scopes visible from one frame.

### `bindings(view: WorldViewHandle, scope: ScopeId, limit: uint32, after?: BindingId | undefined): Result<BindingPage, HostError>`

List source bindings visible from one scope.

### `read(view: WorldViewHandle, frame: FrameId, binding: BindingId): Result<Value, HostError>`

Read one source binding value.

### `pause(): Result<Stop, HostError>`

Pause execution.

### `resume(): Result<Stop, HostError>`

Resume execution.

### `step(worker: WorkerId, options: StepOptions): Result<Stop, HostError>`

Step execution.

### `rewind(moment: Moment): Result<Stop, HostError>`

Rewind execution to one moment.

### `runTo(moment: Moment): Result<Stop, HostError>`

Run execution to one moment.

### `forkAt(moment: Moment): Result<BranchId, HostError>`

Fork execution at one moment.
