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 source locations of preconditions #415

Closed
langston-barrett opened this issue Apr 22, 2019 · 4 comments
Closed

Track source locations of preconditions #415

langston-barrett opened this issue Apr 22, 2019 · 4 comments
Assignees
Labels
topics: error-messages Issues involving the messages SAW produces on error

Comments

@langston-barrett
Copy link
Contributor

While implementing #414, I noticed that matchArg can only report source locations on the level of overrides. It would be nice if we could provide the user with line numbers for each precondition.

This would probably involve changing

  , _csArgBindings     :: Map Integer (t, SetupValue) -- ^ function arguments

to something like

  , _csArgBindings     :: Map Integer (ArgSpec t)

where

data ArgSpec t = ArgSpec { _val :: SetupValue, _loc :: What4.ProgramLoc, _type :: t }
@langston-barrett langston-barrett added the topics: error-messages Issues involving the messages SAW produces on error label Apr 22, 2019
@atomb atomb added this to the 1.0 milestone Apr 30, 2019
@langston-barrett
Copy link
Contributor Author

This is especially important for points-to assertions. I might have tens of these in my preconditions, many with the same types involved. It's quite difficult to tell which one should be fixed when something goes wrong, especially if they're all symbolic.

@langston-barrett
Copy link
Contributor Author

It looks like the problem is that crucible_precond, crucible_points_to, etc. use getPosition from the TopLevel monad, which ignores their position inside the CrucibleSetup block.

@langston-barrett
Copy link
Contributor Author

The case of crucible_precond, crucible_points_to, etc. was fixed in #477. matchArg could still use the solution outlined above.

@atomb atomb modified the milestones: 0.5, 0.6 Apr 27, 2020
@atomb atomb modified the milestones: 0.6, 0.7 Aug 13, 2020
@atomb atomb modified the milestones: 0.7, 0.8 Dec 14, 2020
@atomb atomb removed this from the 0.8 milestone Apr 9, 2021
@robdockins robdockins self-assigned this May 19, 2022
@robdockins
Copy link
Contributor

PR #1679 implements most of this, to the point I think it's time to close this ticket.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topics: error-messages Issues involving the messages SAW produces on error
Projects
None yet
Development

No branches or pull requests

3 participants