| Summary: | Profile mode not handled by the launch shortcut | ||
|---|---|---|---|
| Product: | [Eclipse Project] JDT | Reporter: | Stanley Shiah <shiah> |
| Component: | Debug | Assignee: | JDT-Debug-Inbox <jdt-debug-inbox> |
| Status: | RESOLVED WONTFIX | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | chris, curtispd, who |
| Version: | 3.0 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows 2000 | ||
| Whiteboard: | |||
|
Description
Stanley Shiah
*** Bug 53781 has been marked as a duplicate of this bug. *** The SDK does not provide a profiler. Whoever provides the profiler provides the shortcut. Please move this to the correct component. The platform provides the notion of a "profile" mode, though. Shouldn't it be the responsibility of the provider of the launch configuration type to _allow_ shortcutting for any of the 3 basic launch modes defined by the platform that make sense? After all, the implementation of launch shortcuts is the same for all modes. If this isn't the case, the profilers' launch shortcuts would simply be copy & pasted from the original shortcuts, which seems slightly less than clean. Perhaps there is room for an enhancement here. However, the existing launch shortcut extension allows a shortcut to define the modes it is applicable to. The Java short cut contributes for run/debug, since that is all we know about. Adding Chris as CC for comment, since he owns the run context menu support. Darin is correct. The context launch menu supports *any* kind of shortcut,
including run, debug, profile, and any other "mode" that ever gets added to the
core debug platform. What appears in the Run-> context menu depends on what
shortcuts have been contributed. As Darin said, the JDT-Debug only contributes
"run" and "debug" modes. However, if third party plugins contribute shortcuts
with a "mode=profile", they will appear in the context menu as well. Here is
the snippet from org.eclipse.jdt.debug.ui/plugin.xml to show you what we mean.
<extension
point="org.eclipse.debug.ui.launchShortcuts">
<shortcut
label="%JavaApplicationShortcut.label"
modes="run, debug"
...
...
</extension>
It is the launch shortcut's responsibility to create a launch config with appropriate default values/attributes, and launch it (or re-use an existing config). Since the Java Application launch shortcut has no knowledge of "profiling", it would have no idea what to set as default values/attributes on a profiling launch config. Ok, I can accept that, since a profiler may decide not to use the IJavaLaunchConfigurationConstants keys for the launch configuration. The only option I see now is to duplicate all the code from the launch shortcuts I want to extend with the profile mode (because the launch shortcuts are internal). The major problem with this (aside from the duplication itself) is that launch shortcuts tend to use internal classes. For example, the JavaModelUtil class (internal) is used to determine whether a class has a main, which in turn uses other internal code. Obviously, I can't duplicate the entire dependency tree of internal code. So, the only feasible option for profilers is to use internal JDT code. Do you see any solutions to this problem? Options: * Open a new feature request or re-open this feature request as enhancement aksing for new API (likely will not happen in 3.0). * Subclass the internal stuff knowning that you will be broken, but hope for API in a future release. * Contribute a fix |