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

Auto resume trigger breakpoints once hit #620

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

Conversation

SougandhS
Copy link
Contributor

@SougandhS SougandhS commented Feb 20, 2025

This PR introduces an option to resume the virtual machine execution once a trigger breakpoint is hit. This allows trigger breakpoints to act as barriers for other breakpoints, enabling less priority breakpoints to remain active without requiring them to be disabled.

Screens -
image

Once trigger is enabled then users will be able to choose 'Resume' , Selecting 'Resume' will also include 'Ignored' tag to breakpoint label
image

On debugging trigger wont suspend at breakpoint line, it will only suspend on next breakpoint




Additionally a new option has been added to the Java editor to toggle Triggerpoints, allowing users to
instantly create a Resume-Triggerpoint.

Screenshot 2025-02-24 at 1 33 24 PM

Fixes #614

What it does

How to test

Author checklist

@SougandhS SougandhS force-pushed the NonBreakingTriggerPoints branch from 1c4768d to a4737ab Compare February 20, 2025 08:38
@SougandhS
Copy link
Contributor Author

Hi @jukzi , could you pls check this when you have time..

@SougandhS SougandhS added the enhancement New feature or request label Feb 20, 2025
@SougandhS SougandhS force-pushed the NonBreakingTriggerPoints branch 4 times, most recently from 62b4f94 to 3af58fc Compare February 20, 2025 09:30
@jukzi
Copy link
Contributor

jukzi commented Feb 20, 2025

Hi @jukzi , could you pls check this when you have time..

Code looks fine. I am testing it, thanks for working on that!! And congrats to your Election.

@jukzi jukzi added the noteworthy Noteworthy feature label Feb 20, 2025
@SougandhS
Copy link
Contributor Author

Code looks fine. I am testing it, thanks for working on that!! And congrats to your Election.

Thank you so much @jukzi 😇👏

@jukzi
Copy link
Contributor

jukzi commented Feb 20, 2025

It works almost like i wished it would.
I see a single unexpected behaviour:
Lets have a Resume point with a Condition. When i edit the Condition the Breakpoint disables its "Resume" behavior back to single thread (may be an existing bug):
image
image

Also i would like to see a "Toggle Trigger Point" in the context menu, which would "Resume" by default (debatable) :
image

/**
* Suspend policy constant indicating a breakpoint will not suspend the target VM when hit.
*
* @since 3.5
Copy link
Contributor

Choose a reason for hiding this comment

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

expecting @since 3.22

00:01:32.006  [ERROR] Failed to execute goal org.eclipse.tycho:tycho-apitools-plugin:4.0.11:verify (verify) on project org.eclipse.jdt.debug: There are API errors:
00:01:32.006  [ERROR] model/org/eclipse/jdt/debug/core/IJavaBreakpoint.java:54 Invalid @since 3.5 tag on RESUME_THREAD; expecting @since 3.22

note that this change has to wait for M1 anyway and then you may need to bump one more time

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, will correct for next M1

Copy link
Contributor

@jukzi jukzi left a comment

Choose a reason for hiding this comment

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

fix API error

@SougandhS
Copy link
Contributor Author

When i edit the Condition the Breakpoint disables its "Resume" behavior back to single thread

Will check this

Also i would like to see a "Toggle Trigger Point" in the context menu, which would "Resume" by default (debatable) :

Sure 👍

@SougandhS SougandhS force-pushed the NonBreakingTriggerPoints branch from 3af58fc to 6f042e2 Compare February 24, 2025 07:56
@SougandhS
Copy link
Contributor Author

Added additional handling for conditional-resume-triggerpoints

Once resume is enabled, resume based labels will be shown for condition options

Screenshot 2025-02-24 at 1 27 24 PM

Added toggling Trigger points from context menu (by default it will be Resume-Triggers)

image

@SougandhS SougandhS requested a review from jukzi February 24, 2025 08:24
@jukzi
Copy link
Contributor

jukzi commented Feb 24, 2025

Take this example:

package p1;

public class TestResume {
public static void main(String[] args) throws InterruptedException {
	System.out.println("main");
	Thread thread = new Thread(TestResume::runAsync);
	thread.start(); // add Triggerpoint with condition=false
	thread.join();
}
public static void runAsync() {
	System.out.println("async"); // add breakpint
}
}

and add the breakpoint as in the comments:
image

I found two problems:
Error 1: The Triggerpoint stops the program (should not happen, its a Triggerpoint, not a Breakpoint)
Error 2: The program never ends - even if i press Resume(F8). Thats fatal

from editor

This commit introduces an option to resume virtual machine execution
when a trigger breakpoint is hit. This allows trigger breakpoints to act
as barriers, enabling lower-priority breakpoints to remain active
without needing to be disabled. Additionally, a new option has been
added to the Java editor to toggle Triggerpoints, allowing users to
instantly create a Resume-Triggerpoint.

Fixes eclipse-jdt#614
@SougandhS SougandhS force-pushed the NonBreakingTriggerPoints branch from 6f042e2 to c47e110 Compare February 25, 2025 02:52
@SougandhS
Copy link
Contributor Author

Take this example:

thanks for this example

Error 1: The Triggerpoint stops the program (should not happen, its a Triggerpoint, not a Breakpoint)
Error 2: The program never ends - even if i press Resume(F8). Thats fatal

fixed both now 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request noteworthy Noteworthy feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement Trigger Points that do not suspend anything
2 participants