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:
- Adding a
Option<SourceRange> field to the Instruction type
- 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.
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
Instructionshould (optionally) support tracing back to aSourceRange{start: usize, end: usize}offset in the high-level program which generated it. This could be done as either:Option<SourceRange>field to theInstructiontypeThe 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.