Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[jdt-debug-dev] Dynamic patterns in pattern breakpoints

See http://bugs.eclipse.org/bugs/show_bug.cgi?id=9290.

Statement of problem:
Pattern breakpoints are not flexible enough to handle multiple JSP engines.
Each JSP engines mangles JSP file names differently.  For example, some JSP
engines create all JSPs with the same package name whereas others put each
JSP into the package that corresponds to the folder structure that contains
the JSP.

It is unacceptable to force clients to add one pattern breakpoint per
engine that they could potentially use to run a JSP.  Therefore we need
some mechanism that will allow the client to set the pattern on a debug
target basis.

Proposed solution:

NOTE:  There is no commitment to this solution at this time!

The IJavaBreakpointListener class gives pre-installation notification of
breakpoint installs using breakpointAdded(IJavaDebugTarget target,
IJavaBreakpoint breakpoint).  If a client registered itself as a
IJavaBreakpointListener it could set the pattern that the debugger would
use on the specific IJavaDebugTarget.

This solution requires the ILaunchConfigurationDelegate that the client
implements correctly initialize its state so that it can keep track of
which type of JSP engine it used to launch a given IJavaDebugTarget.

Proposed API changes:

org.eclipse.jdt.debug.core.IJavaPatternBreakpoint
      add methods:
            /**
             * Sets the pattern to be used for the given IJavaDebugTarget.
             */
            public void setPattern(String pattern, IJavaDebugTarget
target);

            /**
             * Answers the pattern that is used for the given
IJavaDebugTarget or null, if none exists.
             */
            public String getPattern(IJavaDebugTarget target)

org.eclipse.jdt.launching.IVMRunner
      change method
            VMRunnerResult run(VMRunnerConfiguration configuration) throws
CoreException;
      to
            VMRunnerResult run(VMRunnerConfiguration configuration, ILaunch
launch) throws CoreException;


Implementations of the run(VMRunnerConfiguration, ILaunch) method must take
care to add any debug targets created to the launch ASAP.  This primarily
effects org.eclipse.jdt.internal.debug.ui.launcher.JDKDebugLauncher.

org.eclipse.jdt.debug.core.JDIDebugTarget
      both newDebugTarget(...) methods would have to take an ILaunch as an
argument.

The implementation of this method would have to call
ILaunch.addDebugTarget(JDIDebugTarget) promptly in order to allow clients
to change patterns.


jkca



Back to the top