Skip to content

KCVM instructions should include a source offset #201

@adamchalmers

Description

@adamchalmers

Background

KCVM is a low-level language, its instructions are usually computed from a high-level language (e.g. KCL).

Problem

When debugging KCVM it's unclear why the high-level KCL generated a particular KCVM instruction.

Solution

Each Instruction should (optionally) support tracing back to a SourceRange{start: usize, end: usize} offset in the high-level program which generated it. This could be done as either:

  1. Adding a Option<SourceRange> field to the Instruction type
  2. Adding a map from instruction IDs to SourceRange

The KCVM debugger should optionally take a high-level program (e.g. a string of KCL source code), display that source code, and highlight the parts that correspond to each instruction.

Grackle should then add KCL source code offsets to the KCVM instructions it emits.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions