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

New halt implementation #18026

Merged
merged 20 commits into from
Mar 25, 2025
Merged

Conversation

Ducasse
Copy link
Member

@Ducasse Ducasse commented Mar 20, 2025

a new implementation of haltOnce with nice tests showing that
executing two times in a row the same haltOnce call will bark only the first time and
that we can have multiple call sites in the same method with each one their own "counter"

@Ducasse
Copy link
Member Author

Ducasse commented Mar 20, 2025

As a bonus no need for the compiler, not reparse and semantical analysis.

@Ducasse
Copy link
Member Author

Ducasse commented Mar 21, 2025

Working on reimplementing HaltCount: too.
No need to scan the full memory for senders and in addition reparse the methods :)

@@ -184,24 +193,36 @@ Halt class >> onCountWithBehavior: behaviorBlock [
Halt class >> once [
"Stop once and only once the execution of the method containing the expression Halt once. If you need to get it stops another time after the first stop, use Halt resetOnce."

| callingContext senderContext node |
<debuggerCompleteToSender>
Copy link
Member

Choose a reason for hiding this comment

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

Maybe the pragma should be kept, because this is used to hint the debugger that this method should be filtered from the shown stack by default (and usually we want to stop at the caller, not here right?

Or maybe it's not needed? What does the debugger show when this halts without the pragma?

Copy link
Member

Choose a reason for hiding this comment

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

I mean, if you do Halt once directly in a method

Copy link
Member Author

Choose a reason for hiding this comment

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

Tx I thought that I kept it so I will added back

@Ducasse
Copy link
Member Author

Ducasse commented Mar 21, 2025

Ready for review.
I will do another pass once this PR is integrated to introduce haltOnce: n to be able to haltOnce n times.

@Ducasse Ducasse merged commit 3296150 into pharo-project:Pharo13 Mar 25, 2025
1 check passed
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