Skip to content

Commit

Permalink
Revert "Allow user to manipulate Truffle breakpoints"
Browse files Browse the repository at this point in the history
  • Loading branch information
mbien authored Apr 11, 2024
1 parent e8fb660 commit e19ed99
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@
import org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper;
import org.netbeans.modules.debugger.jpda.jdi.VirtualMachineWrapper;
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
import static org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager.configureTruffleBreakpoint;

import org.openide.util.Exceptions;
import org.openide.util.RequestProcessor;
Expand Down Expand Up @@ -331,7 +330,7 @@ private static void runOnBreakpoint(final JPDAThread awtThread, String bpClass,

mb.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
mb.setSuspend(MethodBreakpoint.SUSPEND_EVENT_THREAD);
configureTruffleBreakpoint(mb);
mb.setHidden(true);
mb.setThreadFilters(dbg, new JPDAThread[] { awtThread });
mb.addJPDABreakpointListener(new JPDABreakpointListener() {
@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@
import org.netbeans.modules.javascript2.debug.breakpoints.JSLineBreakpoint;
import org.netbeans.spi.debugger.ActionsProvider;
import org.netbeans.spi.debugger.DebuggerServiceRegistration;
import org.openide.util.NbBundle;

/**
* Initiates guest language debugging, detects Engine in the JVM.
Expand Down Expand Up @@ -95,7 +94,7 @@ private synchronized void initLoadBP() {
*/
debugManagerLoadBP = MethodBreakpoint.create(ENGINE_BUILDER_CLASS, "build");
((MethodBreakpoint) debugManagerLoadBP).setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
configureTruffleBreakpoint(debugManagerLoadBP);
debugManagerLoadBP.setHidden(true);

LOG.log(Level.FINE, "TruffleDebugManager.initBreakpoints(): submitted BP {0}", debugManagerLoadBP);
TruffleAccess.init();
Expand Down Expand Up @@ -156,7 +155,7 @@ public void sessionRemoved(Session session) {
private JPDABreakpoint addRemoteServiceInitBP(final JPDADebugger debugger) {
MethodBreakpoint bp = MethodBreakpoint.create(REMOTE_SERVICES_TRIGGER_CLASS, REMOTE_SERVICES_TRIGGER_METHOD);
bp.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
configureTruffleBreakpoint(bp);
bp.setHidden(true);
bp.setSession(debugger);

JPDABreakpointListener bpl = new JPDABreakpointListener() {
Expand Down Expand Up @@ -228,11 +227,11 @@ public void propertyChange(PropertyChangeEvent evt) {
*/
private void handleEngineBuilder(final JPDADebugger debugger, JPDABreakpointEvent entryEvent) {
MethodBreakpoint builderExitBreakpoint = MethodBreakpoint.create(ENGINE_BUILDER_CLASS, "build");
builderExitBreakpoint.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
builderExitBreakpoint.setBreakpointType(MethodBreakpoint.TYPE_METHOD_EXIT);
builderExitBreakpoint.setThreadFilters(debugger, new JPDAThread[]{entryEvent.getThread()});
builderExitBreakpoint.setSuspend(JPDABreakpoint.SUSPEND_EVENT_THREAD);
builderExitBreakpoint.setSession(debugger);
configureTruffleBreakpoint(builderExitBreakpoint);
builderExitBreakpoint.setHidden(true);
builderExitBreakpoint.addJPDABreakpointListener(exitEvent -> {
try {
builderExitBreakpoint.disable();
Expand All @@ -253,7 +252,7 @@ private void submitExistingEnginesProbe(final JPDADebugger debugger, List<JPDACl
haveExistingEnginesTrigger.put(debugger, Boolean.TRUE);
}
MethodBreakpoint execTrigger = MethodBreakpoint.create(EXISTING_ENGINES_TRIGGER, "*");
configureTruffleBreakpoint(execTrigger);
execTrigger.setHidden(true);
execTrigger.setSession(debugger);
execTrigger.addJPDABreakpointListener((event) -> {
DebuggerManager.getDebuggerManager().removeBreakpoint(execTrigger);
Expand Down Expand Up @@ -350,10 +349,4 @@ public static JPDAClassType getDebugAccessorJPDAClass(JPDADebugger debugger) {
}
}

@NbBundle.Messages({
"CTL_BreakpointGroup=Truffle"
})
public static void configureTruffleBreakpoint(JPDABreakpoint b) {
b.setGroupName(Bundle.CTL_BreakpointGroup());
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
import org.netbeans.modules.debugger.jpda.truffle.LanguageName;
import org.netbeans.modules.debugger.jpda.truffle.RemoteServices;
import org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager;
import static org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager.configureTruffleBreakpoint;
import org.netbeans.modules.debugger.jpda.truffle.Utils;
import org.netbeans.modules.debugger.jpda.truffle.actions.StepActionProvider;
import org.netbeans.modules.debugger.jpda.truffle.ast.TruffleNode;
Expand Down Expand Up @@ -176,7 +175,7 @@ private void initBPs() {
private JPDABreakpoint createBP(String className, String methodName, JPDADebugger debugger) {
final MethodBreakpoint mb = MethodBreakpoint.create(className, methodName);
mb.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
configureTruffleBreakpoint(mb);
mb.setHidden(true);
mb.setSession(debugger);
mb.addJPDABreakpointListener(this);
DebuggerManager.getDebuggerManager().addBreakpoint(mb);
Expand Down Expand Up @@ -311,7 +310,7 @@ private static Runnable skipSuspendedEventClearLeakingReferences(JPDADebugger de
MethodBreakpoint clearLeakingReferencesBreakpoint = MethodBreakpoint.create(CLEAR_REFERENCES_CLASS, CLEAR_REFERENCES_METHOD);
clearLeakingReferencesBreakpoint.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
clearLeakingReferencesBreakpoint.setThreadFilters(debugger, new JPDAThread[] { thread });
configureTruffleBreakpoint(clearLeakingReferencesBreakpoint);
clearLeakingReferencesBreakpoint.setHidden(true);
Function<EventSet, Boolean> breakpointEventInterceptor = eventSet -> {
try {
ThreadReference etr = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@
import org.netbeans.modules.debugger.jpda.jdi.request.EventRequestManagerWrapper;
import org.netbeans.modules.debugger.jpda.models.AbstractVariable;
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
import static org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager.configureTruffleBreakpoint;
import org.netbeans.modules.debugger.jpda.truffle.access.CurrentPCInfo;
import org.netbeans.modules.debugger.jpda.truffle.access.TruffleAccess;
import org.netbeans.modules.debugger.jpda.truffle.access.TruffleStrataProvider;
Expand Down Expand Up @@ -179,7 +178,7 @@ private void setBreakpoint2Java(JPDAThread currentThread) {
MethodBreakpoint stepIntoJavaBreakpoint = MethodBreakpoint.create(STEP2JAVA_CLASS, STEP2JAVA_METHOD);
stepIntoJavaBreakpoint.setBreakpointType(MethodBreakpoint.TYPE_METHOD_ENTRY);
stepIntoJavaBreakpoint.setThreadFilters(debugger, new JPDAThread[]{currentThread});
configureTruffleBreakpoint(stepIntoJavaBreakpoint);
stepIntoJavaBreakpoint.setHidden(true);
stepIntoJavaBreakpoint.addJPDABreakpointListener(new JPDABreakpointListener() {
@Override
public void breakpointReached(JPDABreakpointEvent event) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,6 @@
import org.netbeans.modules.debugger.jpda.jdi.VMDisconnectedExceptionWrapper;
import org.netbeans.modules.debugger.jpda.models.JPDAThreadImpl;
import org.netbeans.modules.debugger.jpda.truffle.PersistentValues;
import static org.netbeans.modules.debugger.jpda.truffle.TruffleDebugManager.configureTruffleBreakpoint;
import org.netbeans.modules.debugger.jpda.truffle.access.TruffleAccess;
import org.netbeans.modules.debugger.jpda.truffle.source.Source;
import org.netbeans.modules.debugger.jpda.truffle.source.SourceBinaryTranslator;
Expand Down Expand Up @@ -125,7 +124,7 @@ private void setBreakpointResolvedHandler(ClassType accessorClass) {
if (this.breakpointResolvedHandler == null) {
MethodBreakpoint methodBreakpoint = MethodBreakpoint.create(accessorClass.name(), ACCESSOR_LINE_BREAKPOINT_RESOLVED);
methodBreakpoint.setSession(debugger);
configureTruffleBreakpoint(methodBreakpoint);
methodBreakpoint.setHidden(true);
methodBreakpoint.setSuspend(JPDABreakpoint.SUSPEND_EVENT_THREAD);
methodBreakpoint.addJPDABreakpointListener(new JPDABreakpointListener() {
@Override
Expand Down

0 comments on commit e19ed99

Please sign in to comment.