Skip to content

Debugger records all old heaps and their parent heaps - #973

Open
jackstodart wants to merge 34 commits into
viperproject:masterfrom
jackstodart:reworking_debugger
Open

Debugger records all old heaps and their parent heaps#973
jackstodart wants to merge 34 commits into
viperproject:masterfrom
jackstodart:reworking_debugger

Conversation

@jackstodart

Copy link
Copy Markdown

Changing the debugger from recording only heaps referenced in assumptions, to recording all heaps when they are created. Also records the statement or expression that caused the heap to be created, and any possible branch conditions.

Debugger now prints the parents and causes when printOldHeaps is on; it's a little verbose maybe, but it's off by default anyway.

Comment thread src/main/scala/rules/Evaluator.scala Outdated
Comment thread src/main/scala/verifier/Verifier.scala Outdated
Comment thread src/main/scala/state/State.scala Outdated
@jackstodart
jackstodart marked this pull request as draft May 27, 2026 21:23
@jackstodart
jackstodart marked this pull request as ready for review May 29, 2026 19:19
# Conflicts:
#	src/main/scala/rules/Consumer.scala
#	src/main/scala/rules/Evaluator.scala
#	src/main/scala/rules/Executor.scala
#	src/main/scala/rules/MagicWandSupporter.scala
@jackstodart
jackstodart marked this pull request as draft July 21, 2026 14:39
@jackstodart
jackstodart marked this pull request as ready for review July 21, 2026 16:40
@jackstodart
jackstodart requested a review from AndreaKe July 31, 2026 12:03

@AndreaKe AndreaKe left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I left some comments. Otherwise, LGTM.

Comment thread src/main/scala/state/State.scala Outdated
Comment thread src/main/scala/state/State.scala Outdated
)
val temporaryHeapRecord3 = (temporaryHeapRecord1, temporaryHeapRecord2) match {
case (Some((label1, cause1, pcs1, heaps1)), Some((label2, cause2, _, heaps2))) =>
if (label1 == label2 && cause1 == cause2) Some(label1, cause1, pcs1, heaps1 ++ heaps2) else None

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Is having different labels/causes something that can actually happen? Or does it indicate that something is wrong?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

This should not actually happen but I didn't want to cause crashes here if the debugger records heaps incorrectly. Added logger warning in this case. It would be very finicky to record the children heaps because I would have to put this condition inside the new debugOldHeaps.

Comment thread src/main/scala/supporters/functions/FunctionVerificationUnit.scala
Comment thread src/main/scala/supporters/MethodSupporter.scala
Comment thread src/main/scala/verifier/Verifier.scala Outdated
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.

3 participants