mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-06-07 01:36:01 +02:00
Fix for 225099: Breakpoint toggling for files outside projects is broken in CDT CVS HEAD
Patch by Øyvind Harboe <oyvind.harboe@zylin.com>
This commit is contained in:
parent
a6d874156f
commit
cfae4dbc59
1 changed files with 7 additions and 2 deletions
|
@ -9,6 +9,7 @@
|
||||||
* QNX Software Systems - Initial API and implementation
|
* QNX Software Systems - Initial API and implementation
|
||||||
* Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299
|
* Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299
|
||||||
* Warren Paul (Nokia) - Bug 217485, Bug 218342
|
* Warren Paul (Nokia) - Bug 217485, Bug 218342
|
||||||
|
* Oyvind Harboe (oyvind.harboe@zylin.com) - Bug 225099
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
package org.eclipse.cdt.debug.internal.ui.actions;
|
package org.eclipse.cdt.debug.internal.ui.actions;
|
||||||
|
|
||||||
|
@ -290,11 +291,15 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
|
||||||
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
|
||||||
if ( part instanceof IEditorPart ) {
|
if ( part instanceof IEditorPart ) {
|
||||||
IEditorInput editorInput = ((IEditorPart)part).getEditorInput();
|
IEditorInput editorInput = ((IEditorPart)part).getEditorInput();
|
||||||
|
IResource resource = null;
|
||||||
if ( editorInput instanceof IFileEditorInput ) {
|
if ( editorInput instanceof IFileEditorInput ) {
|
||||||
return ((IFileEditorInput)editorInput).getFile();
|
resource = ((IFileEditorInput)editorInput).getFile();
|
||||||
} else if (editorInput instanceof ExternalEditorInput) {
|
} else if (editorInput instanceof ExternalEditorInput) {
|
||||||
return ((ExternalEditorInput)editorInput).getMarkerResource();
|
resource = ((ExternalEditorInput)editorInput).getMarkerResource();
|
||||||
}
|
}
|
||||||
|
if (resource != null)
|
||||||
|
return resource;
|
||||||
|
/* This file is not in a project, let default case handle it */
|
||||||
ILocationProvider provider = (ILocationProvider)editorInput.getAdapter( ILocationProvider.class );
|
ILocationProvider provider = (ILocationProvider)editorInput.getAdapter( ILocationProvider.class );
|
||||||
if ( provider != null ) {
|
if ( provider != null ) {
|
||||||
IPath location = provider.getPath( editorInput );
|
IPath location = provider.getPath( editorInput );
|
||||||
|
|
Loading…
Add table
Reference in a new issue