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

Track instruction source location to improve errors #40

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

HParker
Copy link

@HParker HParker commented Dec 16, 2023

This adds metadata constructed in the assembler and passed to the VM which provides information about instructions that can be used to improve error messages with line and column info.

Open to all feedback including, "This is not a feature UVM is looking for."

I think this could open the door to tracking additional information statically such as stack effects of an instruct etc. Do let me know if there is a more canonical way to track this kind of information.

Let me know what you think and if this is something I should pursue more.

This adds metadata constructed in the assembler and passed to the VM which provides information about instructions that can be used to improve error messages with line and column info.
@@ -498,6 +498,9 @@ pub struct Assembler

/// Current section
section: Section,

// Code Metadata
meta: HashMap<u64, OpMeta>,
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems useful and has been requested by another user.

Only comment I have would be, could you rename meta to op_meta, because eventually there's going to be program-level metadata as well.

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

Successfully merging this pull request may close these issues.

None yet

2 participants