1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-23 14:42:11 +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:
Anton Leherbauer 2008-04-02 07:25:33 +00:00
parent a6d874156f
commit cfae4dbc59

View file

@ -9,6 +9,7 @@
* QNX Software Systems - Initial API and implementation
* Freescale Semiconductor - Address watchpoints, https://bugs.eclipse.org/bugs/show_bug.cgi?id=118299
* Warren Paul (Nokia) - Bug 217485, Bug 218342
* Oyvind Harboe (oyvind.harboe@zylin.com) - Bug 225099
*******************************************************************************/
package org.eclipse.cdt.debug.internal.ui.actions;
@ -290,11 +291,15 @@ public class ToggleBreakpointAdapter implements IToggleBreakpointsTarget {
IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot();
if ( part instanceof IEditorPart ) {
IEditorInput editorInput = ((IEditorPart)part).getEditorInput();
IResource resource = null;
if ( editorInput instanceof IFileEditorInput ) {
return ((IFileEditorInput)editorInput).getFile();
resource = ((IFileEditorInput)editorInput).getFile();
} 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 );
if ( provider != null ) {
IPath location = provider.getPath( editorInput );