diff --git a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java index 58f0ce164fd..a7b561ee4fc 100644 --- a/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java +++ b/debug/org.eclipse.cdt.debug.ui/src/org/eclipse/cdt/debug/internal/ui/CDebugUIUtils.java @@ -1,5 +1,5 @@ /******************************************************************************* - * Copyright (c) 2000, 2010 QNX Software Systems and others. + * Copyright (c) 2000, 2013 QNX Software Systems and others. * All rights reserved. This program and the accompanying materials * are made available under the terms of the Eclipse Public License v1.0 * which accompanies this distribution, and is available at @@ -11,6 +11,7 @@ *******************************************************************************/ package org.eclipse.cdt.debug.internal.ui; +import java.net.URI; import java.util.Iterator; import org.eclipse.cdt.debug.core.CDebugUtils; @@ -127,7 +128,7 @@ public class CDebugUIUtils { static public String getValueText( IValue value ) { StringBuffer label = new StringBuffer(); if ( value instanceof ICDebugElementStatus && !((ICDebugElementStatus)value).isOK() ) { - label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.4" ), new String[] { ((ICDebugElementStatus)value).getMessage() } ) ); //$NON-NLS-1$ + label.append( MessageFormat.format( CDebugUIMessages.getString( "CDTDebugModelPresentation.4" ), (Object[]) new String[] { ((ICDebugElementStatus)value).getMessage() } ) ); //$NON-NLS-1$ } else if ( value instanceof ICValue ) { ICType type = null; @@ -201,7 +202,18 @@ public class CDebugUIUtils { public static String getEditorFilePath( IEditorInput input ) throws CoreException { if ( input instanceof IFileEditorInput ) { - return ((IFileEditorInput)input).getFile().getLocation().toOSString(); + IPath location = ((IFileEditorInput)input).getFile().getLocation(); + if (location != null) { + return location.toOSString(); + } + URI locationURI = ((IFileEditorInput)input).getFile().getLocationURI(); + if (locationURI != null) { + IPath uriPath = URIUtil.toPath(locationURI); + if (uriPath != null) { + return uriPath.toOSString(); + } + } + return ""; //$NON-NLS-1$ } if ( input instanceof IStorageEditorInput ) { return ((IStorageEditorInput)input).getStorage().getFullPath().toOSString();