diff options
author | Mikhail Khodjaiants | 2006-04-11 19:31:59 +0000 |
---|---|---|
committer | Mikhail Khodjaiants | 2006-04-11 19:31:59 +0000 |
commit | 39e1b6c5d38270f0f586dd68a0fe6250cde9331e (patch) | |
tree | a8e35f25a92a5f66b2ffc700fdd6337dd1d46f09 /debug/org.eclipse.cdt.debug.mi.ui | |
parent | dae81c31ec4a2bd031b70ab874bd25820e786915 (diff) | |
download | org.eclipse.cdt-39e1b6c5d38270f0f586dd68a0fe6250cde9331e.tar.gz org.eclipse.cdt-39e1b6c5d38270f0f586dd68a0fe6250cde9331e.tar.xz org.eclipse.cdt-39e1b6c5d38270f0f586dd68a0fe6250cde9331e.zip |
Bug 119740: allow to specify only a subset of shared objects that we want symbols to be loaded for. Use soname instead of shared library name.
Diffstat (limited to 'debug/org.eclipse.cdt.debug.mi.ui')
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.ui/ChangeLog | 5 | ||||
-rw-r--r-- | debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java | 39 |
2 files changed, 42 insertions, 2 deletions
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog index 3d35198d6fd..8a33eb066fe 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog +++ b/debug/org.eclipse.cdt.debug.mi.ui/ChangeLog @@ -1,3 +1,8 @@ +2006-04-11 Mikhail Khodjaiants
+ Bug 119740: allow to specify only a subset of shared objects that we want symbols to be loaded for.
+ Use soname instead of shared library name.
+ * SolibSearchPathBlock.java
+
2006-04-10 Mikhail Khodjaiants
Bug 119740: allow to specify only a subset of shared objects that we want symbols to be loaded for.
* MANIFEST.MF
diff --git a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java index 649479168c9..88c11569af2 100644 --- a/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java +++ b/debug/org.eclipse.cdt.debug.mi.ui/src/org/eclipse/cdt/debug/mi/internal/ui/SolibSearchPathBlock.java @@ -489,8 +489,9 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu throw new InterruptedException(); } monitor.subTask( all[j].getPath() ); - if ( isSharedLibrary( all[j] ) ) { - libs.add( all[j] ); + String libName = getSharedLibraryName( all[j] ); + if ( libName != null ) { + libs.add( new File( libName ) ); } } } @@ -509,6 +510,40 @@ public class SolibSearchPathBlock extends Observable implements IMILaunchConfigu return result; } + protected String getSharedLibraryName( File file ) { + if ( !file.isFile() ) + return null; + IProject project = getProject(); + if ( project != null ) { + IPath fullPath = new Path( file.getPath() ); + try { + ICExtensionReference[] binaryParsersExt = CCorePlugin.getDefault().getBinaryParserExtensions( project ); + for( int i = 0; i < binaryParsersExt.length; i++ ) { + IBinaryParser parser = (IBinaryParser)binaryParsersExt[i].createExtension(); + try { + IBinaryFile bin = parser.getBinary( fullPath ); + if ( bin instanceof IBinaryShared ) { + String soname = ((IBinaryShared)bin).getSoName(); + return ( soname.length() != 0 ) ? soname : file.getName(); + } + } + catch( IOException e ) { + } + } + } + catch( CoreException e ) { + } + return null; + } + // no project: for now + IPath path = new Path( file.getPath() ); + String name = path.lastSegment(); + String extension = path.getFileExtension(); + if ( extension != null && (extension.compareTo( "so" ) == 0 || extension.compareToIgnoreCase( "dll" ) == 0) ) //$NON-NLS-1$ //$NON-NLS-2$ + return name; + return ( name.indexOf( ".so." ) >= 0 ) ? name : null; //$NON-NLS-1$ + } + protected boolean isSharedLibrary( File file ) { if ( !file.isFile() ) return false; |