From d2cba6c8c9cc686df2ef0657a52d38198833878e Mon Sep 17 00:00:00 2001 From: Alena Laskavaia Date: Tue, 12 Aug 2008 21:00:40 +0000 Subject: [PATCH] - fixed module loading to avoid wrong error reported --- .../debug/internal/core/model/CModule.java | 29 ++++++++++++------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModule.java b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModule.java index 4c274317ec3..cfb8e7d5c30 100644 --- a/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModule.java +++ b/debug/org.eclipse.cdt.debug.core/src/org/eclipse/cdt/debug/internal/core/model/CModule.java @@ -11,6 +11,8 @@ package org.eclipse.cdt.debug.internal.core.model; import java.math.BigInteger; +import java.text.MessageFormat; + import org.eclipse.cdt.core.IAddress; import org.eclipse.cdt.core.IAddressFactory; import org.eclipse.cdt.core.IBinaryParser.IBinaryFile; @@ -272,16 +274,23 @@ public class CModule extends CDebugElement implements ICModule { return fCElement; } - private void loadSymbolsFromFile( IPath path ) throws DebugException { - if ( path == null || path.isEmpty() ) { - requestFailed( CoreModelMessages.getString( "CModule.2" ), null ); //$NON-NLS-1$ - } - else if ( fCDIObject instanceof ICDISharedLibrary && path.equals( getSymbolsFileName() )) { - try { - ((ICDISharedLibrary)fCDIObject).loadSymbols(); - } - catch( CDIException e ) { - targetRequestFailed( e.getMessage(), null ); + private void loadSymbolsFromFile(IPath path) throws DebugException { + if (fCDIObject instanceof ICDISharedLibrary) { + if (path == null || path.isEmpty()) { + requestFailed(CoreModelMessages.getString("CModule.2"), null); //$NON-NLS-1$ + } else { + if (path.equals(getSymbolsFileName())) { + try { + ((ICDISharedLibrary) fCDIObject).loadSymbols(); + } catch (CDIException e) { + targetRequestFailed(e.getMessage(), null); + } + } else { + String message = MessageFormat.format( // + CoreModelMessages.getString("CModule.5"), //$NON-NLS-1$ + new Object[] { path.toString() }); + targetRequestFailed(message, null); + } } } }