Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KCVM instructions should include a source offset #201

Open
adamchalmers opened this issue Mar 13, 2024 · 0 comments
Open

KCVM instructions should include a source offset #201

adamchalmers opened this issue Mar 13, 2024 · 0 comments

Comments

@adamchalmers
Copy link
Collaborator

adamchalmers commented Mar 13, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant