mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-08-08 08:45:44 +02:00
Fix warnings.
This commit is contained in:
parent
30ddbb8708
commit
93fe4bbc48
52 changed files with 318 additions and 315 deletions
|
@ -1,4 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<?eclipse-cdt version="2.0"?>
|
|
||||||
|
|
||||||
<cdtproject/>
|
|
|
@ -1,13 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<?fileVersion 4.0.0?>
|
|
||||||
|
|
||||||
<cproject>
|
|
||||||
<storageModule moduleId="org.eclipse.cdt.core.settings">
|
|
||||||
<cconfiguration id="converted.config.1532818698">
|
|
||||||
<storageModule buildSystemId="org.eclipse.cdt.core.defaultConfigDataProvider" id="converted.config.1532818698" moduleId="org.eclipse.cdt.core.settings" name="convertedConfig">
|
|
||||||
<externalSettings/>
|
|
||||||
<extensions/>
|
|
||||||
</storageModule>
|
|
||||||
</cconfiguration>
|
|
||||||
</storageModule>
|
|
||||||
</cproject>
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -55,6 +55,9 @@ public final class ASTRewrite {
|
||||||
private final ASTModificationStore fModificationStore;
|
private final ASTModificationStore fModificationStore;
|
||||||
private final ASTModification fParentMod;
|
private final ASTModification fParentMod;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noreference This constructor is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
public ASTRewrite(IASTNode root, ASTModificationStore modStore, ASTModification parentMod) {
|
public ASTRewrite(IASTNode root, ASTModificationStore modStore, ASTModification parentMod) {
|
||||||
fRoot= root;
|
fRoot= root;
|
||||||
fModificationStore= modStore;
|
fModificationStore= modStore;
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.core.parser.token;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
import org.eclipse.cdt.core.dom.ast.IASTTypeId;
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
import org.eclipse.cdt.core.parser.IToken;
|
||||||
import org.eclipse.cdt.core.parser.ITokenDuple;
|
import org.eclipse.cdt.core.parser.ITokenDuple;
|
||||||
|
@ -80,7 +81,7 @@ public class OperatorTokenDuple implements ITokenDuple {
|
||||||
return token.getLastToken();
|
return token.getLastToken();
|
||||||
}
|
}
|
||||||
|
|
||||||
public List[] getTemplateIdArgLists() {
|
public List<IASTNode>[] getTemplateIdArgLists() {
|
||||||
return token.getTemplateIdArgLists();
|
return token.getTemplateIdArgLists();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -96,7 +97,7 @@ public class OperatorTokenDuple implements ITokenDuple {
|
||||||
return token.getSegmentCount();
|
return token.getSegmentCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
public Iterator iterator() {
|
public Iterator<IToken> iterator() {
|
||||||
return token.iterator();
|
return token.iterator();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -13,6 +13,7 @@ package org.eclipse.cdt.internal.core.parser.token;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
import org.eclipse.cdt.core.parser.IToken;
|
||||||
import org.eclipse.cdt.core.parser.ITokenDuple;
|
import org.eclipse.cdt.core.parser.ITokenDuple;
|
||||||
|
|
||||||
|
@ -22,20 +23,27 @@ import org.eclipse.cdt.core.parser.ITokenDuple;
|
||||||
*/
|
*/
|
||||||
public class TemplateTokenDuple extends BasicTokenDuple {
|
public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
|
|
||||||
protected final List [] argLists;
|
protected final List<IASTNode>[] argLists;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param first
|
* @param first
|
||||||
* @param last
|
* @param last
|
||||||
* @param templateArgLists
|
* @param templateArgLists
|
||||||
*/
|
*/
|
||||||
public TemplateTokenDuple(IToken first, IToken last, List templateArgLists) {
|
public TemplateTokenDuple(IToken first, IToken last, List<List<IASTNode>> templateArgLists) {
|
||||||
super(first, last);
|
super(first, last);
|
||||||
argLists = (List[]) templateArgLists.toArray( new List [templateArgLists.size()] );
|
argLists = toArray(templateArgLists);
|
||||||
numSegments = calculateSegmentCount();
|
numSegments = calculateSegmentCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private <T> List<T>[] toArray(List<List<T>> templateArgLists) {
|
||||||
|
return templateArgLists.toArray( new List[templateArgLists.size()] );
|
||||||
|
}
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
|
private <T> List<T>[] newArrayOfLists(int size) {
|
||||||
|
return new List[size];
|
||||||
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ITokenDuple#getSegmentCount()
|
* @see org.eclipse.cdt.core.parser.ITokenDuple#getSegmentCount()
|
||||||
|
@ -63,9 +71,9 @@ public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
last = token;
|
last = token;
|
||||||
}
|
}
|
||||||
|
|
||||||
List [] args = getTemplateIdArgLists();
|
List<IASTNode>[] args = getTemplateIdArgLists();
|
||||||
if( args != null && args[ args.length - 1 ] != null ){
|
if( args != null && args[ args.length - 1 ] != null ){
|
||||||
List newArgs = new ArrayList( 1 );
|
List<List<IASTNode>> newArgs = new ArrayList<List<IASTNode>>( 1 );
|
||||||
newArgs.add( args[ args.length - 1 ] );
|
newArgs.add( args[ args.length - 1 ] );
|
||||||
return TokenFactory.createTokenDuple( first, last, newArgs );
|
return TokenFactory.createTokenDuple( first, last, newArgs );
|
||||||
}
|
}
|
||||||
|
@ -76,12 +84,12 @@ public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
public TemplateTokenDuple( ITokenDuple first, ITokenDuple last )
|
public TemplateTokenDuple( ITokenDuple first, ITokenDuple last )
|
||||||
{
|
{
|
||||||
super( first, last );
|
super( first, last );
|
||||||
List [] a1 = first.getTemplateIdArgLists();
|
List<IASTNode>[] a1 = first.getTemplateIdArgLists();
|
||||||
List [] a2 = last.getTemplateIdArgLists();
|
List<IASTNode>[] a2 = last.getTemplateIdArgLists();
|
||||||
|
|
||||||
int l1 = ( a1 != null ) ? a1.length : first.getSegmentCount();
|
int l1 = ( a1 != null ) ? a1.length : first.getSegmentCount();
|
||||||
int l2 = ( a2 != null ) ? a2.length : first.getSegmentCount();
|
int l2 = ( a2 != null ) ? a2.length : first.getSegmentCount();
|
||||||
argLists = new List[ l1 + l2 ];
|
argLists = newArrayOfLists(l1 + l2);
|
||||||
if( a1 != null )
|
if( a1 != null )
|
||||||
System.arraycopy( a1, 0, argLists, 0, l1 );
|
System.arraycopy( a1, 0, argLists, 0, l1 );
|
||||||
if( a2 != null )
|
if( a2 != null )
|
||||||
|
@ -89,18 +97,19 @@ public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
numSegments = calculateSegmentCount();
|
numSegments = calculateSegmentCount();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.cdt.core.parser.ITokenDuple#getTemplateIdArgLists()
|
* @see org.eclipse.cdt.core.parser.ITokenDuple#getTemplateIdArgLists()
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List[] getTemplateIdArgLists() {
|
public List<IASTNode>[] getTemplateIdArgLists() {
|
||||||
return argLists;
|
return argLists;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ITokenDuple[] getSegments()
|
public ITokenDuple[] getSegments()
|
||||||
{
|
{
|
||||||
List r = new ArrayList();
|
List<ITokenDuple> r = new ArrayList<ITokenDuple>();
|
||||||
IToken token = null;
|
IToken token = null;
|
||||||
IToken prev = null;
|
IToken prev = null;
|
||||||
IToken last = getLastToken();
|
IToken last = getLastToken();
|
||||||
|
@ -114,10 +123,10 @@ public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
if( token.getType() == IToken.tLT )
|
if( token.getType() == IToken.tLT )
|
||||||
token = TokenFactory.consumeTemplateIdArguments( token, last );
|
token = TokenFactory.consumeTemplateIdArguments( token, last );
|
||||||
if( token.getType() == IToken.tCOLONCOLON ){
|
if( token.getType() == IToken.tCOLONCOLON ){
|
||||||
List newArgs = null;
|
List<List<IASTNode>> newArgs = null;
|
||||||
if( argLists[count] != null )
|
if( argLists[count] != null )
|
||||||
{
|
{
|
||||||
newArgs = new ArrayList( 1 );
|
newArgs = new ArrayList<List<IASTNode>>(1);
|
||||||
newArgs.add( argLists[count]);
|
newArgs.add( argLists[count]);
|
||||||
}
|
}
|
||||||
ITokenDuple d = TokenFactory.createTokenDuple( startOfSegment, prev != null ? prev : startOfSegment, newArgs );
|
ITokenDuple d = TokenFactory.createTokenDuple( startOfSegment, prev != null ? prev : startOfSegment, newArgs );
|
||||||
|
@ -127,16 +136,16 @@ public class TemplateTokenDuple extends BasicTokenDuple {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
List newArgs = null;
|
List<List<IASTNode>> newArgs = null;
|
||||||
//pointer to members could have a A::B<int>::
|
//pointer to members could have a A::B<int>::
|
||||||
if( count < argLists.length && argLists[count] != null )
|
if( count < argLists.length && argLists[count] != null )
|
||||||
{
|
{
|
||||||
newArgs = new ArrayList( 1 );
|
newArgs = new ArrayList<List<IASTNode>>(1);
|
||||||
newArgs.add(argLists[count]);
|
newArgs.add(argLists[count]);
|
||||||
}
|
}
|
||||||
ITokenDuple d = TokenFactory.createTokenDuple( startOfSegment, last, newArgs);
|
ITokenDuple d = TokenFactory.createTokenDuple( startOfSegment, last, newArgs);
|
||||||
r.add( d );
|
r.add( d );
|
||||||
return (ITokenDuple[]) r.toArray( new ITokenDuple[ r.size() ]);
|
return r.toArray( new ITokenDuple[ r.size() ]);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -15,6 +15,7 @@ import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.core.dom.ast.IASTNode;
|
||||||
import org.eclipse.cdt.core.parser.IToken;
|
import org.eclipse.cdt.core.parser.IToken;
|
||||||
import org.eclipse.cdt.core.parser.ITokenDuple;
|
import org.eclipse.cdt.core.parser.ITokenDuple;
|
||||||
|
|
||||||
|
@ -56,15 +57,15 @@ public class TokenFactory {
|
||||||
public int getStartOffset() {
|
public int getStartOffset() {
|
||||||
return fToken.getOffset();
|
return fToken.getOffset();
|
||||||
}
|
}
|
||||||
public List[] getTemplateIdArgLists() {
|
public List<IASTNode>[] getTemplateIdArgLists() {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public IToken getToken(int index) {
|
public IToken getToken(int index) {
|
||||||
if( index == 0 ) return fToken;
|
if( index == 0 ) return fToken;
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
public Iterator iterator() {
|
public Iterator<IToken> iterator() {
|
||||||
return new Iterator() {
|
return new Iterator<IToken>() {
|
||||||
private boolean hasNext = true;
|
private boolean hasNext = true;
|
||||||
public void remove() {
|
public void remove() {
|
||||||
throw new UnsupportedOperationException();
|
throw new UnsupportedOperationException();
|
||||||
|
@ -72,7 +73,7 @@ public class TokenFactory {
|
||||||
public boolean hasNext() {
|
public boolean hasNext() {
|
||||||
return hasNext;
|
return hasNext;
|
||||||
}
|
}
|
||||||
public Object next() {
|
public IToken next() {
|
||||||
hasNext = false;
|
hasNext = false;
|
||||||
return fToken;
|
return fToken;
|
||||||
}
|
}
|
||||||
|
@ -102,7 +103,7 @@ public class TokenFactory {
|
||||||
return new BasicTokenDuple( first, last );
|
return new BasicTokenDuple( first, last );
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ITokenDuple createTokenDuple(IToken first, IToken last, List templateArgLists) {
|
public static ITokenDuple createTokenDuple(IToken first, IToken last, List<List<IASTNode>> templateArgLists) {
|
||||||
if (templateArgLists == null || templateArgLists.isEmpty()) {
|
if (templateArgLists == null || templateArgLists.isEmpty()) {
|
||||||
return createTokenDuple(first, last);
|
return createTokenDuple(first, last);
|
||||||
}
|
}
|
||||||
|
@ -112,8 +113,8 @@ public class TokenFactory {
|
||||||
public static ITokenDuple createTokenDuple( ITokenDuple firstDuple, ITokenDuple secondDuple ){
|
public static ITokenDuple createTokenDuple( ITokenDuple firstDuple, ITokenDuple secondDuple ){
|
||||||
if( secondDuple == null ) return firstDuple;
|
if( secondDuple == null ) return firstDuple;
|
||||||
if( firstDuple == null ) return secondDuple;
|
if( firstDuple == null ) return secondDuple;
|
||||||
List [] f1 = firstDuple.getTemplateIdArgLists();
|
List<IASTNode>[] f1 = firstDuple.getTemplateIdArgLists();
|
||||||
List [] f2 = secondDuple.getTemplateIdArgLists();
|
List<IASTNode>[] f2 = secondDuple.getTemplateIdArgLists();
|
||||||
if( f1 == null && f2 == null )
|
if( f1 == null && f2 == null )
|
||||||
return new BasicTokenDuple( firstDuple, secondDuple );
|
return new BasicTokenDuple( firstDuple, secondDuple );
|
||||||
return new TemplateTokenDuple( firstDuple, secondDuple );
|
return new TemplateTokenDuple( firstDuple, secondDuple );
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class Checksums {
|
||||||
* @throws NoSuchAlgorithmException
|
* @throws NoSuchAlgorithmException
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public static MessageDigest getAlgorithm(Map<String, Object> persistedMap) throws NoSuchAlgorithmException {
|
public static MessageDigest getAlgorithm(Map<?, ?> persistedMap) throws NoSuchAlgorithmException {
|
||||||
Object obj= persistedMap.get(KEY_ALGORITHM);
|
Object obj= persistedMap.get(KEY_ALGORITHM);
|
||||||
String alg= obj instanceof String ? (String) obj : DEFAULT_ALGORITHM;
|
String alg= obj instanceof String ? (String) obj : DEFAULT_ALGORITHM;
|
||||||
return MessageDigest.getInstance(alg);
|
return MessageDigest.getInstance(alg);
|
||||||
|
@ -80,7 +80,7 @@ public class Checksums {
|
||||||
* Retrieves a checksum for a file from the persisted map. May return <code>null</code>.
|
* Retrieves a checksum for a file from the persisted map. May return <code>null</code>.
|
||||||
* @since 4.0
|
* @since 4.0
|
||||||
*/
|
*/
|
||||||
public static byte[] getChecksum(Map<String, Object> persistedMap, IFile file) {
|
public static byte[] getChecksum(Map<?, ?> persistedMap, IFile file) {
|
||||||
IPath prjRel= file.getProjectRelativePath();
|
IPath prjRel= file.getProjectRelativePath();
|
||||||
Object checksum= persistedMap.get(prjRel.toString());
|
Object checksum= persistedMap.get(prjRel.toString());
|
||||||
if (checksum instanceof byte[])
|
if (checksum instanceof byte[])
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -144,7 +143,7 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void createChecksums(ICProject cproject, PDOM pdom, File target, IProgressMonitor monitor) throws CoreException {
|
private void createChecksums(ICProject cproject, PDOM pdom, File target, IProgressMonitor monitor) throws CoreException {
|
||||||
HashSet fullPaths= new HashSet();
|
HashSet<String> fullPaths= new HashSet<String>();
|
||||||
try {
|
try {
|
||||||
pdom.acquireReadLock();
|
pdom.acquireReadLock();
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
|
@ -165,15 +164,15 @@ public class TeamPDOMExportOperation implements IWorkspaceRunnable {
|
||||||
int i=0;
|
int i=0;
|
||||||
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
|
IWorkspaceRoot root= ResourcesPlugin.getWorkspace().getRoot();
|
||||||
IFile[] files= new IFile[fullPaths.size()];
|
IFile[] files= new IFile[fullPaths.size()];
|
||||||
for (Iterator iterator = fullPaths.iterator(); iterator.hasNext();) {
|
for (Iterator<String> iterator = fullPaths.iterator(); iterator.hasNext();) {
|
||||||
String fullPath= (String) iterator.next();
|
String fullPath= iterator.next();
|
||||||
files[i++]= root.getFile(new Path(fullPath));
|
files[i++]= root.getFile(new Path(fullPath));
|
||||||
}
|
}
|
||||||
Map map= Checksums.createChecksumMap(files, fMessageDigest, monitor);
|
Map<String, Object> map= Checksums.createChecksumMap(files, fMessageDigest, monitor);
|
||||||
writeChecksums(map, target);
|
writeChecksums(map, target);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void writeChecksums(Map map, File target) throws CoreException {
|
private void writeChecksums(Map<?, ?> map, File target) throws CoreException {
|
||||||
ObjectOutputStream out= null;
|
ObjectOutputStream out= null;
|
||||||
try {
|
try {
|
||||||
out= new ObjectOutputStream(new FileOutputStream(target));
|
out= new ObjectOutputStream(new FileOutputStream(target));
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Wind River Systems, Inc. and others.
|
* Copyright (c) 2007, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core.pdom;
|
package org.eclipse.cdt.internal.core.pdom;
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
|
@ -146,7 +145,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
|
|
||||||
private void doImportIndex(File importFile, IProgressMonitor monitor) throws CoreException, InterruptedException, IOException {
|
private void doImportIndex(File importFile, IProgressMonitor monitor) throws CoreException, InterruptedException, IOException {
|
||||||
ZipFile zip= new ZipFile(importFile);
|
ZipFile zip= new ZipFile(importFile);
|
||||||
Map checksums= null;
|
Map<?, ?> checksums= null;
|
||||||
try {
|
try {
|
||||||
importIndex(zip, monitor);
|
importIndex(zip, monitor);
|
||||||
checksums= getChecksums(zip);
|
checksums= getChecksums(zip);
|
||||||
|
@ -172,7 +171,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
CCoreInternals.getPDOMManager().importProjectPDOM(fProject, stream);
|
CCoreInternals.getPDOMManager().importProjectPDOM(fProject, stream);
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getChecksums(ZipFile zip) {
|
private Map<?, ?> getChecksums(ZipFile zip) {
|
||||||
ZipEntry indexEntry= zip.getEntry(CHECKSUMS_NAME);
|
ZipEntry indexEntry= zip.getEntry(CHECKSUMS_NAME);
|
||||||
if (indexEntry != null) {
|
if (indexEntry != null) {
|
||||||
try {
|
try {
|
||||||
|
@ -180,7 +179,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
try {
|
try {
|
||||||
Object obj= input.readObject();
|
Object obj= input.readObject();
|
||||||
if (obj instanceof Map) {
|
if (obj instanceof Map) {
|
||||||
return (Map) obj;
|
return (Map<?,?>) obj;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
finally {
|
finally {
|
||||||
|
@ -194,7 +193,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
return Collections.EMPTY_MAP;
|
return Collections.EMPTY_MAP;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void checkIndex(Map checksums, IProgressMonitor monitor) throws CoreException, InterruptedException {
|
private void checkIndex(Map<?, ?> checksums, IProgressMonitor monitor) throws CoreException, InterruptedException {
|
||||||
IPDOM obj= CCoreInternals.getPDOMManager().getPDOM(fProject);
|
IPDOM obj= CCoreInternals.getPDOMManager().getPDOM(fProject);
|
||||||
if (!(obj instanceof WritablePDOM)) {
|
if (!(obj instanceof WritablePDOM)) {
|
||||||
return;
|
return;
|
||||||
|
@ -203,7 +202,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
WritablePDOM pdom= (WritablePDOM) obj;
|
WritablePDOM pdom= (WritablePDOM) obj;
|
||||||
pdom.acquireReadLock();
|
pdom.acquireReadLock();
|
||||||
try {
|
try {
|
||||||
List filesToCheck= new ArrayList();
|
List<FileAndChecksum> filesToCheck= new ArrayList<FileAndChecksum>();
|
||||||
if (!pdom.isSupportedVersion()) {
|
if (!pdom.isSupportedVersion()) {
|
||||||
throw new CoreException(CCorePlugin.createStatus(
|
throw new CoreException(CCorePlugin.createStatus(
|
||||||
NLS.bind(Messages.PDOMImportTask_errorInvalidPDOMVersion, fProject.getElementName())));
|
NLS.bind(Messages.PDOMImportTask_errorInvalidPDOMVersion, fProject.getElementName())));
|
||||||
|
@ -264,7 +263,7 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void deleteFiles(WritablePDOM pdom, final int giveupReadlocks, IIndexFragmentFile[] filesToDelete,
|
private void deleteFiles(WritablePDOM pdom, final int giveupReadlocks, IIndexFragmentFile[] filesToDelete,
|
||||||
List updateTimestamps, IProgressMonitor monitor) throws InterruptedException, CoreException {
|
List<FileAndChecksum> updateTimestamps, IProgressMonitor monitor) throws InterruptedException, CoreException {
|
||||||
pdom.acquireWriteLock(giveupReadlocks);
|
pdom.acquireWriteLock(giveupReadlocks);
|
||||||
try {
|
try {
|
||||||
for (int i = 0; i < filesToDelete.length; i++) {
|
for (int i = 0; i < filesToDelete.length; i++) {
|
||||||
|
@ -274,10 +273,10 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
pdom.clearFile(ifile, null);
|
pdom.clearFile(ifile, null);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (Iterator i = updateTimestamps.iterator(); i.hasNext();) {
|
for (Iterator<FileAndChecksum> i = updateTimestamps.iterator(); i.hasNext();) {
|
||||||
checkMonitor(monitor);
|
checkMonitor(monitor);
|
||||||
|
|
||||||
FileAndChecksum fc = (FileAndChecksum) i.next();
|
FileAndChecksum fc = i.next();
|
||||||
IIndexFragmentFile file= fc.fIFile;
|
IIndexFragmentFile file= fc.fIFile;
|
||||||
if (file != null) {
|
if (file != null) {
|
||||||
IResource r= fc.fFile.getResource();
|
IResource r= fc.fFile.getResource();
|
||||||
|
@ -293,12 +292,12 @@ public class TeamPDOMImportOperation implements IWorkspaceRunnable {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void removeOutdatedFiles(Map checksums, List filesToCheck, IProgressMonitor monitor) throws NoSuchAlgorithmException {
|
private void removeOutdatedFiles(Map<?, ?> checksums, List<FileAndChecksum> filesToCheck, IProgressMonitor monitor) throws NoSuchAlgorithmException {
|
||||||
MessageDigest md= Checksums.getAlgorithm(checksums);
|
MessageDigest md= Checksums.getAlgorithm(checksums);
|
||||||
for (Iterator i = filesToCheck.iterator(); i.hasNext();) {
|
for (Iterator<FileAndChecksum> i = filesToCheck.iterator(); i.hasNext();) {
|
||||||
checkMonitor(monitor);
|
checkMonitor(monitor);
|
||||||
|
|
||||||
FileAndChecksum cs= (FileAndChecksum) i.next();
|
FileAndChecksum cs= i.next();
|
||||||
ITranslationUnit tu= cs.fFile;
|
ITranslationUnit tu= cs.fFile;
|
||||||
if (tu != null) {
|
if (tu != null) {
|
||||||
IPath location= tu.getLocation();
|
IPath location= tu.getLocation();
|
||||||
|
|
|
@ -11,7 +11,6 @@
|
||||||
* Andrew Ferguson (Symbian)
|
* Andrew Ferguson (Symbian)
|
||||||
* Anton Leherbauer (Wind River Systems)
|
* Anton Leherbauer (Wind River Systems)
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.core;
|
package org.eclipse.cdt.core;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
@ -176,11 +175,15 @@ public class CCorePlugin extends Plugin {
|
||||||
*/
|
*/
|
||||||
public static final String SPACE = "space"; //$NON-NLS-1$
|
public static final String SPACE = "space"; //$NON-NLS-1$
|
||||||
|
|
||||||
public CDTLogWriter cdtLog = null;
|
|
||||||
|
|
||||||
private static CCorePlugin fgCPlugin;
|
private static CCorePlugin fgCPlugin;
|
||||||
private static ResourceBundle fgResourceBundle;
|
private static ResourceBundle fgResourceBundle;
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @noreference This field is not intended to be referenced by clients.
|
||||||
|
*/
|
||||||
|
public CDTLogWriter cdtLog = null;
|
||||||
|
|
||||||
private CProjectDescriptionManager fNewCProjectDescriptionManager;
|
private CProjectDescriptionManager fNewCProjectDescriptionManager;
|
||||||
|
|
||||||
private CoreModel fCoreModel;
|
private CoreModel fCoreModel;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -59,29 +59,29 @@ import org.w3c.dom.Element;
|
||||||
public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
private static CConfigBasedDescriptorManager fInstance;
|
private static CConfigBasedDescriptorManager fInstance;
|
||||||
public static final String NULL_OWNER_ID = ""; //$NON-NLS-1$
|
public static final String NULL_OWNER_ID = ""; //$NON-NLS-1$
|
||||||
private Map fOwnerConfigMap = null;
|
private Map<String, COwnerConfiguration> fOwnerConfigMap = null;
|
||||||
private ICProjectDescriptionListener fDescriptionListener;
|
private ICProjectDescriptionListener fDescriptionListener;
|
||||||
|
|
||||||
private static final QualifiedName DESCRIPTOR_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "CDescriptor"); //$NON-NLS-1$
|
private static final QualifiedName DESCRIPTOR_PROPERTY = new QualifiedName(CCorePlugin.PLUGIN_ID, "CDescriptor"); //$NON-NLS-1$
|
||||||
|
|
||||||
private List fListeners = Collections.synchronizedList(new Vector());
|
private List<ICDescriptorListener> fListeners = Collections.synchronizedList(new Vector<ICDescriptorListener>());
|
||||||
// private ThreadLocal fApplyingDescriptorMap = new ThreadLocal();
|
// private ThreadLocal fApplyingDescriptorMap = new ThreadLocal();
|
||||||
private ThreadLocal fThreadInfo = new ThreadLocal();
|
private ThreadLocal<ThreadInfo> fThreadInfo = new ThreadLocal<ThreadInfo>();
|
||||||
|
|
||||||
private class ThreadInfo {
|
private class ThreadInfo {
|
||||||
Map fApplyingDescriptorMap;
|
Map<IProject, CConfigBasedDescriptor> fApplyingDescriptorMap;
|
||||||
Map fOperatingDescriptorMap;
|
Map<IProject, CConfigBasedDescriptor> fOperatingDescriptorMap;
|
||||||
|
|
||||||
public Map getApplyingDescriptorMap(boolean create){
|
public Map<IProject, CConfigBasedDescriptor> getApplyingDescriptorMap(boolean create){
|
||||||
if(fApplyingDescriptorMap == null && create){
|
if(fApplyingDescriptorMap == null && create){
|
||||||
fApplyingDescriptorMap = new HashMap(1);
|
fApplyingDescriptorMap = new HashMap<IProject, CConfigBasedDescriptor>(1);
|
||||||
}
|
}
|
||||||
return fApplyingDescriptorMap;
|
return fApplyingDescriptorMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map getOperatingDescriptorMap(boolean create){
|
public Map<IProject, CConfigBasedDescriptor> getOperatingDescriptorMap(boolean create){
|
||||||
if(fOperatingDescriptorMap == null && create){
|
if(fOperatingDescriptorMap == null && create){
|
||||||
fOperatingDescriptorMap = new HashMap(1);
|
fOperatingDescriptorMap = new HashMap<IProject, CConfigBasedDescriptor>(1);
|
||||||
}
|
}
|
||||||
return fOperatingDescriptorMap;
|
return fOperatingDescriptorMap;
|
||||||
}
|
}
|
||||||
|
@ -386,7 +386,7 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
if (fOwnerConfigMap == null) {
|
if (fOwnerConfigMap == null) {
|
||||||
initializeOwnerConfiguration();
|
initializeOwnerConfiguration();
|
||||||
}
|
}
|
||||||
COwnerConfiguration config = (COwnerConfiguration)fOwnerConfigMap.get(id);
|
COwnerConfiguration config = fOwnerConfigMap.get(id);
|
||||||
if (config == null) { // no install owner, lets create place holder config for it.
|
if (config == null) { // no install owner, lets create place holder config for it.
|
||||||
config = new COwnerConfiguration(id, CCorePlugin.getResourceString("CDescriptorManager.owner_not_Installed")); //$NON-NLS-1$
|
config = new COwnerConfiguration(id, CCorePlugin.getResourceString("CDescriptorManager.owner_not_Installed")); //$NON-NLS-1$
|
||||||
fOwnerConfigMap.put(id, config);
|
fOwnerConfigMap.put(id, config);
|
||||||
|
@ -397,7 +397,7 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
private void initializeOwnerConfiguration() {
|
private void initializeOwnerConfiguration() {
|
||||||
IExtensionPoint extpoint = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "CProject"); //$NON-NLS-1$
|
IExtensionPoint extpoint = Platform.getExtensionRegistry().getExtensionPoint(CCorePlugin.PLUGIN_ID, "CProject"); //$NON-NLS-1$
|
||||||
IExtension extension[] = extpoint.getExtensions();
|
IExtension extension[] = extpoint.getExtensions();
|
||||||
fOwnerConfigMap = new HashMap(extension.length);
|
fOwnerConfigMap = new HashMap<String, COwnerConfiguration>(extension.length);
|
||||||
for (int i = 0; i < extension.length; i++) {
|
for (int i = 0; i < extension.length; i++) {
|
||||||
IConfigurationElement element[] = extension[i].getConfigurationElements();
|
IConfigurationElement element[] = extension[i].getConfigurationElements();
|
||||||
for (int j = 0; j < element.length; j++) {
|
for (int j = 0; j < element.length; j++) {
|
||||||
|
@ -552,7 +552,7 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
protected void notifyListeners(final CDescriptorEvent event) {
|
protected void notifyListeners(final CDescriptorEvent event) {
|
||||||
final ICDescriptorListener[] listeners;
|
final ICDescriptorListener[] listeners;
|
||||||
synchronized (fListeners) {
|
synchronized (fListeners) {
|
||||||
listeners = (ICDescriptorListener[])fListeners.toArray(new ICDescriptorListener[fListeners.size()]);
|
listeners = fListeners.toArray(new ICDescriptorListener[fListeners.size()]);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < listeners.length; i++) {
|
for (int i = 0; i < listeners.length; i++) {
|
||||||
final int index = i;
|
final int index = i;
|
||||||
|
@ -572,13 +572,13 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean reconsile(CConfigBasedDescriptor descriptor, ICProjectDescription des){
|
public boolean reconsile(CConfigBasedDescriptor descriptor, ICProjectDescription des){
|
||||||
Map map = descriptor.getStorageDataElMap();
|
Map<String, Element> map = descriptor.getStorageDataElMap();
|
||||||
boolean reconsiled = false;
|
boolean reconsiled = false;
|
||||||
if(map.size() != 0){
|
if(map.size() != 0){
|
||||||
for(Iterator iter = map.entrySet().iterator(); iter.hasNext();){
|
for(Iterator<Map.Entry<String, Element>> iter = map.entrySet().iterator(); iter.hasNext();){
|
||||||
Map.Entry entry = (Map.Entry)iter.next();
|
Map.Entry<String, Element> entry = iter.next();
|
||||||
String id = (String)entry.getKey();
|
String id = entry.getKey();
|
||||||
Element el = (Element)entry.getValue();
|
Element el = entry.getValue();
|
||||||
if(reconsile(id, el.getParentNode() != null ? el : null, des))
|
if(reconsile(id, el.getParentNode() != null ? el : null, des))
|
||||||
reconsiled = true;
|
reconsiled = true;
|
||||||
}
|
}
|
||||||
|
@ -629,9 +629,9 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private CConfigBasedDescriptor getApplyingDescriptor(IProject project){
|
private CConfigBasedDescriptor getApplyingDescriptor(IProject project){
|
||||||
Map map = getApplyingDescriptorMap(false);
|
Map<IProject, CConfigBasedDescriptor> map = getApplyingDescriptorMap(false);
|
||||||
if(map != null){
|
if(map != null){
|
||||||
return (CConfigBasedDescriptor)map.get(project);
|
return map.get(project);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -640,20 +640,20 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
if(dr == null)
|
if(dr == null)
|
||||||
clearApplyingDescriptor(project);
|
clearApplyingDescriptor(project);
|
||||||
else {
|
else {
|
||||||
Map map = getApplyingDescriptorMap(true);
|
Map<IProject, CConfigBasedDescriptor> map = getApplyingDescriptorMap(true);
|
||||||
map.put(project, dr);
|
map.put(project, dr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CConfigBasedDescriptor clearApplyingDescriptor(IProject project){
|
private CConfigBasedDescriptor clearApplyingDescriptor(IProject project){
|
||||||
Map map = getApplyingDescriptorMap(false);
|
Map<IProject, CConfigBasedDescriptor> map = getApplyingDescriptorMap(false);
|
||||||
if(map != null){
|
if(map != null){
|
||||||
return (CConfigBasedDescriptor)map.remove(project);
|
return map.remove(project);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getApplyingDescriptorMap(boolean create){
|
private Map<IProject, CConfigBasedDescriptor> getApplyingDescriptorMap(boolean create){
|
||||||
ThreadInfo info = getThreadInfo(create);
|
ThreadInfo info = getThreadInfo(create);
|
||||||
if(info == null)
|
if(info == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -668,9 +668,9 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private CConfigBasedDescriptor getOperatingDescriptor(IProject project){
|
private CConfigBasedDescriptor getOperatingDescriptor(IProject project){
|
||||||
Map map = getOperatingDescriptorMap(false);
|
Map<IProject, CConfigBasedDescriptor> map = getOperatingDescriptorMap(false);
|
||||||
if(map != null){
|
if(map != null){
|
||||||
return (CConfigBasedDescriptor)map.get(project);
|
return map.get(project);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
@ -679,20 +679,20 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
if(dr == null)
|
if(dr == null)
|
||||||
clearOperatingDescriptor(project);
|
clearOperatingDescriptor(project);
|
||||||
else {
|
else {
|
||||||
Map map = getOperatingDescriptorMap(true);
|
Map<IProject, CConfigBasedDescriptor> map = getOperatingDescriptorMap(true);
|
||||||
map.put(project, dr);
|
map.put(project, dr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private CConfigBasedDescriptor clearOperatingDescriptor(IProject project){
|
private CConfigBasedDescriptor clearOperatingDescriptor(IProject project){
|
||||||
Map map = getOperatingDescriptorMap(false);
|
Map<IProject, CConfigBasedDescriptor> map = getOperatingDescriptorMap(false);
|
||||||
if(map != null){
|
if(map != null){
|
||||||
return (CConfigBasedDescriptor)map.remove(project);
|
return map.remove(project);
|
||||||
}
|
}
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private Map getOperatingDescriptorMap(boolean create){
|
private Map<IProject, CConfigBasedDescriptor> getOperatingDescriptorMap(boolean create){
|
||||||
ThreadInfo info = getThreadInfo(create);
|
ThreadInfo info = getThreadInfo(create);
|
||||||
if(info == null)
|
if(info == null)
|
||||||
return null;
|
return null;
|
||||||
|
@ -701,7 +701,7 @@ public class CConfigBasedDescriptorManager implements ICDescriptorManager {
|
||||||
}
|
}
|
||||||
|
|
||||||
private ThreadInfo getThreadInfo(boolean create){
|
private ThreadInfo getThreadInfo(boolean create){
|
||||||
ThreadInfo info = (ThreadInfo)fThreadInfo.get();
|
ThreadInfo info = fThreadInfo.get();
|
||||||
if(info == null && create){
|
if(info == null && create){
|
||||||
info = new ThreadInfo();
|
info = new ThreadInfo();
|
||||||
fThreadInfo.set(info);
|
fThreadInfo.set(info);
|
||||||
|
|
|
@ -13,7 +13,6 @@
|
||||||
package org.eclipse.cdt.internal.core;
|
package org.eclipse.cdt.internal.core;
|
||||||
|
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
import java.util.Iterator;
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
|
@ -35,10 +34,10 @@ public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void initializeDefaultPreferences() {
|
public void initializeDefaultPreferences() {
|
||||||
HashSet optionNames = CModelManager.OptionNames;
|
HashSet<String> optionNames = CModelManager.OptionNames;
|
||||||
|
|
||||||
// Formatter settings
|
// Formatter settings
|
||||||
Map defaultOptionsMap = DefaultCodeFormatterConstants.getDefaultSettings(); // code formatter defaults
|
Map<String, String> defaultOptionsMap = DefaultCodeFormatterConstants.getDefaultSettings(); // code formatter defaults
|
||||||
|
|
||||||
// Compiler settings
|
// Compiler settings
|
||||||
defaultOptionsMap.put(CCorePreferenceConstants.TODO_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG);
|
defaultOptionsMap.put(CCorePreferenceConstants.TODO_TASK_TAGS, CCorePreferenceConstants.DEFAULT_TASK_TAG);
|
||||||
|
@ -52,10 +51,9 @@ public class CCorePreferenceInitializer extends AbstractPreferenceInitializer {
|
||||||
|
|
||||||
// Store default values to default preferences
|
// Store default values to default preferences
|
||||||
IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(CCorePlugin.PLUGIN_ID);
|
IEclipsePreferences defaultPreferences = ((IScopeContext) new DefaultScope()).getNode(CCorePlugin.PLUGIN_ID);
|
||||||
for (Iterator iter = defaultOptionsMap.entrySet().iterator(); iter.hasNext();) {
|
for (Map.Entry<String,String> entry : defaultOptionsMap.entrySet()) {
|
||||||
Map.Entry entry = (Map.Entry) iter.next();
|
String optionName = entry.getKey();
|
||||||
String optionName = (String) entry.getKey();
|
defaultPreferences.put(optionName, entry.getValue());
|
||||||
defaultPreferences.put(optionName, (String)entry.getValue());
|
|
||||||
optionNames.add(optionName);
|
optionNames.add(optionName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -14,7 +14,7 @@ import java.util.HashMap;
|
||||||
|
|
||||||
public class CExtensionInfo {
|
public class CExtensionInfo {
|
||||||
|
|
||||||
protected HashMap attribMap = new HashMap(4);
|
protected HashMap<String, String> attribMap = new HashMap<String, String>(4);
|
||||||
|
|
||||||
public CExtensionInfo(){
|
public CExtensionInfo(){
|
||||||
|
|
||||||
|
@ -24,7 +24,7 @@ public class CExtensionInfo {
|
||||||
attribMap.putAll(base.attribMap);
|
attribMap.putAll(base.attribMap);
|
||||||
}
|
}
|
||||||
|
|
||||||
public HashMap getAttributes() {
|
public HashMap<String, String> getAttributes() {
|
||||||
return attribMap;
|
return attribMap;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,7 +37,7 @@ public class CExtensionInfo {
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getAttribute(String key) {
|
public String getAttribute(String key) {
|
||||||
return (String) attribMap.get(key);
|
return attribMap.get(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -48,7 +48,7 @@ public class CdtVarPathEntryVariableManager implements
|
||||||
private UserDefinedVariableSupplier fUserVarSupplier = UserDefinedVariableSupplier.getInstance();
|
private UserDefinedVariableSupplier fUserVarSupplier = UserDefinedVariableSupplier.getInstance();
|
||||||
private VarSubstitutor fSubstitutor = new VarSubstitutor();
|
private VarSubstitutor fSubstitutor = new VarSubstitutor();
|
||||||
private VarSupplier fVarSupplier = new VarSupplier();
|
private VarSupplier fVarSupplier = new VarSupplier();
|
||||||
private Set fListeners;
|
private Set<IPathEntryVariableChangeListener> fListeners;
|
||||||
|
|
||||||
private class VarSubstitutor extends SupplierBasedCdtVariableSubstitutor {
|
private class VarSubstitutor extends SupplierBasedCdtVariableSubstitutor {
|
||||||
public VarSubstitutor() {
|
public VarSubstitutor() {
|
||||||
|
@ -91,12 +91,12 @@ public class CdtVarPathEntryVariableManager implements
|
||||||
|
|
||||||
public ICdtVariable[] getVariables(IVariableContextInfo context) {
|
public ICdtVariable[] getVariables(IVariableContextInfo context) {
|
||||||
ICdtVariable vars[] = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
|
ICdtVariable vars[] = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
|
||||||
List list = new ArrayList();
|
List<ICdtVariable> list = new ArrayList<ICdtVariable>();
|
||||||
for (ICdtVariable var : vars) {
|
for (ICdtVariable var : vars) {
|
||||||
if(getVariablePath(var) != null)
|
if(getVariablePath(var) != null)
|
||||||
list.add(var);
|
list.add(var);
|
||||||
}
|
}
|
||||||
return (ICdtVariable[])list.toArray(new ICdtVariable[list.size()]);
|
return list.toArray(new ICdtVariable[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -104,7 +104,7 @@ public class CdtVarPathEntryVariableManager implements
|
||||||
|
|
||||||
|
|
||||||
public CdtVarPathEntryVariableManager(){
|
public CdtVarPathEntryVariableManager(){
|
||||||
fListeners = Collections.synchronizedSet(new HashSet());
|
fListeners = Collections.synchronizedSet(new HashSet<IPathEntryVariableChangeListener>());
|
||||||
fUserVarSupplier.addListener(this);
|
fUserVarSupplier.addListener(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -151,12 +151,12 @@ public class CdtVarPathEntryVariableManager implements
|
||||||
|
|
||||||
public String[] getVariableNames() {
|
public String[] getVariableNames() {
|
||||||
ICdtVariable[] vars = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
|
ICdtVariable[] vars = fUserVarSupplier.getMacros(ICoreVariableContextInfo.CONTEXT_WORKSPACE, null);
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<String> list = new ArrayList<String>();
|
||||||
for(int i = 0; i > vars.length; i++){
|
for(int i = 0; i > vars.length; i++){
|
||||||
if(getVariablePath(vars[i]) != null)
|
if(getVariablePath(vars[i]) != null)
|
||||||
list.add(vars[i].getName());
|
list.add(vars[i].getName());
|
||||||
}
|
}
|
||||||
return (String[])list.toArray(new String[list.size()]);
|
return list.toArray(new String[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean isDefined(String name) {
|
public boolean isDefined(String name) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core;
|
package org.eclipse.cdt.internal.core;
|
||||||
|
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
|
@ -27,7 +26,7 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
private static final int MAX_DEPTH = 100; // 100 saves
|
private static final int MAX_DEPTH = 100; // 100 saves
|
||||||
private static final long MAX_AGE = 24 * 60 * 60 * 1000; // one day
|
private static final long MAX_AGE = 24 * 60 * 60 * 1000; // one day
|
||||||
|
|
||||||
private LinkedList fTrackers= new LinkedList();
|
private LinkedList<PositionTracker> fTrackers= new LinkedList<PositionTracker>();
|
||||||
private PositionTracker fActiveTracker;
|
private PositionTracker fActiveTracker;
|
||||||
private IDocument fDocument;
|
private IDocument fDocument;
|
||||||
|
|
||||||
|
@ -43,7 +42,7 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
fActiveTracker= null;
|
fActiveTracker= null;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
fActiveTracker= (PositionTracker) fTrackers.getLast();
|
fActiveTracker= fTrackers.getLast();
|
||||||
fActiveTracker.revive();
|
fActiveTracker.revive();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -67,8 +66,8 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
fTrackers.removeFirst();
|
fTrackers.removeFirst();
|
||||||
}
|
}
|
||||||
long minTimeStamp= fActiveTracker.getTimeStamp() - MAX_AGE;
|
long minTimeStamp= fActiveTracker.getTimeStamp() - MAX_AGE;
|
||||||
for (Iterator iter = fTrackers.iterator(); iter.hasNext();) {
|
for (Iterator<PositionTracker> iter = fTrackers.iterator(); iter.hasNext();) {
|
||||||
PositionTracker tracker= (PositionTracker) iter.next();
|
PositionTracker tracker= iter.next();
|
||||||
if (tracker.getRetiredTimeStamp() >= minTimeStamp) {
|
if (tracker.getRetiredTimeStamp() >= minTimeStamp) {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -100,8 +99,8 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
*/
|
*/
|
||||||
public PositionTracker findTrackerAtOrAfter(long timestamp) {
|
public PositionTracker findTrackerAtOrAfter(long timestamp) {
|
||||||
PositionTracker candidate= null;
|
PositionTracker candidate= null;
|
||||||
for (ListIterator iter = fTrackers.listIterator(fTrackers.size()); iter.hasPrevious();) {
|
for (ListIterator<PositionTracker> iter = fTrackers.listIterator(fTrackers.size()); iter.hasPrevious();) {
|
||||||
PositionTracker tracker = (PositionTracker) iter.previous();
|
PositionTracker tracker = iter.previous();
|
||||||
long trackerTimestamp= tracker.getTimeStamp();
|
long trackerTimestamp= tracker.getTimeStamp();
|
||||||
if (trackerTimestamp >= timestamp) {
|
if (trackerTimestamp >= timestamp) {
|
||||||
candidate= tracker;
|
candidate= tracker;
|
||||||
|
@ -119,8 +118,8 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
* @return the tracker at the timestamp, <code>null</code> if none created at the given time.
|
* @return the tracker at the timestamp, <code>null</code> if none created at the given time.
|
||||||
*/
|
*/
|
||||||
public PositionTracker findTrackerAt(long timestamp) {
|
public PositionTracker findTrackerAt(long timestamp) {
|
||||||
for (ListIterator iter = fTrackers.listIterator(fTrackers.size()); iter.hasPrevious();) {
|
for (ListIterator<PositionTracker> iter = fTrackers.listIterator(fTrackers.size()); iter.hasPrevious();) {
|
||||||
PositionTracker tracker = (PositionTracker) iter.previous();
|
PositionTracker tracker = iter.previous();
|
||||||
long trackerTimestamp= tracker.getTimeStamp();
|
long trackerTimestamp= tracker.getTimeStamp();
|
||||||
if (trackerTimestamp == timestamp) {
|
if (trackerTimestamp == timestamp) {
|
||||||
return tracker;
|
return tracker;
|
||||||
|
@ -178,8 +177,7 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
|
|
||||||
public int getMemorySize() {
|
public int getMemorySize() {
|
||||||
int size= MEMORY_SIZE;
|
int size= MEMORY_SIZE;
|
||||||
for (Iterator iter = fTrackers.iterator(); iter.hasNext();) {
|
for (PositionTracker tracker : fTrackers) {
|
||||||
PositionTracker tracker = (PositionTracker) iter.next();
|
|
||||||
size+= LINKED_LIST_ENTRY_SIZE;
|
size+= LINKED_LIST_ENTRY_SIZE;
|
||||||
size+= tracker.getMemorySize();
|
size+= tracker.getMemorySize();
|
||||||
}
|
}
|
||||||
|
@ -189,7 +187,7 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
public int removeOldest() {
|
public int removeOldest() {
|
||||||
int memdiff= 0;
|
int memdiff= 0;
|
||||||
if (fTrackers.size() > 1) {
|
if (fTrackers.size() > 1) {
|
||||||
PositionTracker tracker= (PositionTracker) fTrackers.removeFirst();
|
PositionTracker tracker= fTrackers.removeFirst();
|
||||||
memdiff= tracker.getMemorySize() + LINKED_LIST_ENTRY_SIZE;
|
memdiff= tracker.getMemorySize() + LINKED_LIST_ENTRY_SIZE;
|
||||||
tracker.clear();
|
tracker.clear();
|
||||||
}
|
}
|
||||||
|
@ -198,7 +196,7 @@ class PositionTrackerChain implements IDocumentListener {
|
||||||
|
|
||||||
public long getOldestRetirement() {
|
public long getOldestRetirement() {
|
||||||
if (fTrackers.size() > 1) {
|
if (fTrackers.size() > 1) {
|
||||||
PositionTracker tracker= (PositionTracker) fTrackers.getFirst();
|
PositionTracker tracker= fTrackers.getFirst();
|
||||||
return tracker.getRetiredTimeStamp();
|
return tracker.getRetiredTimeStamp();
|
||||||
}
|
}
|
||||||
return Long.MAX_VALUE;
|
return Long.MAX_VALUE;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Wind River Systems, Inc. and others.
|
* Copyright (c) 2006, 2008 Wind River Systems, Inc. and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -8,7 +8,6 @@
|
||||||
* Contributors:
|
* Contributors:
|
||||||
* Markus Schorn - initial API and implementation
|
* Markus Schorn - initial API and implementation
|
||||||
*******************************************************************************/
|
*******************************************************************************/
|
||||||
|
|
||||||
package org.eclipse.cdt.internal.core;
|
package org.eclipse.cdt.internal.core;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
@ -41,10 +40,10 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
|
|
||||||
private int fMemoryCounter= 0;
|
private int fMemoryCounter= 0;
|
||||||
private int fInstalled= 0;
|
private int fInstalled= 0;
|
||||||
private HashMap fPositionTrackerMap;
|
private HashMap<IPath, PositionTrackerChain> fPositionTrackerMap;
|
||||||
|
|
||||||
private PositionTrackerManager() {
|
private PositionTrackerManager() {
|
||||||
fPositionTrackerMap= new HashMap();
|
fPositionTrackerMap= new HashMap<IPath, PositionTrackerChain>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public synchronized void install() {
|
public synchronized void install() {
|
||||||
|
@ -112,7 +111,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized PositionTrackerChain getChain(ITextFileBuffer buffer) {
|
private synchronized PositionTrackerChain getChain(ITextFileBuffer buffer) {
|
||||||
return (PositionTrackerChain) fPositionTrackerMap.get(buffer.getLocation());
|
return fPositionTrackerMap.get(buffer.getLocation());
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void resetToLastCheckpoint(ITextFileBuffer buffer) {
|
private synchronized void resetToLastCheckpoint(ITextFileBuffer buffer) {
|
||||||
|
@ -130,22 +129,21 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
|
|
||||||
private synchronized void runCleanup() {
|
private synchronized void runCleanup() {
|
||||||
fMemoryCounter= 0;
|
fMemoryCounter= 0;
|
||||||
for (Iterator iter = fPositionTrackerMap.values().iterator(); iter.hasNext();) {
|
for (PositionTrackerChain chain : fPositionTrackerMap.values()) {
|
||||||
PositionTrackerChain chain= (PositionTrackerChain) iter.next();
|
|
||||||
fMemoryCounter+= HASHMAP_ENTRY_SIZE;
|
fMemoryCounter+= HASHMAP_ENTRY_SIZE;
|
||||||
fMemoryCounter+= chain.getMemorySize();
|
fMemoryCounter+= chain.getMemorySize();
|
||||||
}
|
}
|
||||||
if (fMemoryCounter > MAX_MEMORY_AFTER_CLEANUP) {
|
if (fMemoryCounter > MAX_MEMORY_AFTER_CLEANUP) {
|
||||||
SortedMap map= new TreeMap();
|
SortedMap<Long, List<PositionTrackerChain>> map= new TreeMap<Long, List<PositionTrackerChain>>();
|
||||||
for (Iterator iter = fPositionTrackerMap.values().iterator(); iter.hasNext();) {
|
for (Iterator<PositionTrackerChain> iter = fPositionTrackerMap.values().iterator(); iter.hasNext();) {
|
||||||
PositionTrackerChain chain = (PositionTrackerChain) iter.next();
|
PositionTrackerChain chain = iter.next();
|
||||||
addChain(map, chain);
|
addChain(map, chain);
|
||||||
}
|
}
|
||||||
while (!map.isEmpty()) {
|
while (!map.isEmpty()) {
|
||||||
Long key= (Long) map.firstKey();
|
Long key= map.firstKey();
|
||||||
List list= (List) map.remove(key);
|
List<PositionTrackerChain> list= map.remove(key);
|
||||||
for (Iterator iter = list.iterator(); iter.hasNext();) {
|
for (Iterator<PositionTrackerChain> iter = list.iterator(); iter.hasNext();) {
|
||||||
PositionTrackerChain chain = (PositionTrackerChain) iter.next();
|
PositionTrackerChain chain = iter.next();
|
||||||
fMemoryCounter+= chain.removeOldest();
|
fMemoryCounter+= chain.removeOldest();
|
||||||
addChain(map, chain);
|
addChain(map, chain);
|
||||||
}
|
}
|
||||||
|
@ -156,13 +154,13 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private synchronized void addChain(SortedMap map, PositionTrackerChain chain) {
|
private synchronized void addChain(SortedMap<Long, List<PositionTrackerChain>> map, PositionTrackerChain chain) {
|
||||||
long or= chain.getOldestRetirement();
|
long or= chain.getOldestRetirement();
|
||||||
if (or != Long.MAX_VALUE) {
|
if (or != Long.MAX_VALUE) {
|
||||||
Long lor= new Long(or);
|
Long lor= new Long(or);
|
||||||
List list= (List) map.get(lor);
|
List<PositionTrackerChain> list= map.get(lor);
|
||||||
if (list == null) {
|
if (list == null) {
|
||||||
list= new LinkedList();
|
list= new LinkedList<PositionTrackerChain>();
|
||||||
map.put(lor, list);
|
map.put(lor, list);
|
||||||
}
|
}
|
||||||
list.add(chain);
|
list.add(chain);
|
||||||
|
@ -173,7 +171,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public synchronized IPositionConverter findPositionConverter(IFile file, long timestamp) {
|
public synchronized IPositionConverter findPositionConverter(IFile file, long timestamp) {
|
||||||
PositionTrackerChain chain= (PositionTrackerChain) fPositionTrackerMap.get(file.getFullPath());
|
PositionTrackerChain chain= fPositionTrackerMap.get(file.getFullPath());
|
||||||
if (chain != null) {
|
if (chain != null) {
|
||||||
return chain.findTrackerAt(timestamp);
|
return chain.findTrackerAt(timestamp);
|
||||||
}
|
}
|
||||||
|
@ -184,7 +182,7 @@ public class PositionTrackerManager implements IPositionTrackerManager, IFileBuf
|
||||||
* {@inheritDoc}
|
* {@inheritDoc}
|
||||||
*/
|
*/
|
||||||
public synchronized IPositionConverter findPositionConverter(IPath externalLocation, long timestamp) {
|
public synchronized IPositionConverter findPositionConverter(IPath externalLocation, long timestamp) {
|
||||||
PositionTrackerChain chain= (PositionTrackerChain) fPositionTrackerMap.get(externalLocation);
|
PositionTrackerChain chain= fPositionTrackerMap.get(externalLocation);
|
||||||
if (chain != null) {
|
if (chain != null) {
|
||||||
return chain.findTrackerAt(timestamp);
|
return chain.findTrackerAt(timestamp);
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -17,7 +17,7 @@ import org.eclipse.cdt.utils.cdtvariables.IVariableContextInfo;
|
||||||
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
|
import org.eclipse.cdt.utils.cdtvariables.SupplierBasedCdtVariableSubstitutor;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* This substitutor resolves all macro references
|
* This substituter resolves all macro references
|
||||||
*
|
*
|
||||||
* @see org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor
|
* @see org.eclipse.cdt.utils.cdtvariables.IVariableSubstitutor
|
||||||
* @since 3.0
|
* @since 3.0
|
||||||
|
@ -27,7 +27,7 @@ public class CoreVariableSubstitutor extends SupplierBasedCdtVariableSubstitutor
|
||||||
|
|
||||||
public CoreVariableSubstitutor(IVariableContextInfo contextInfo,
|
public CoreVariableSubstitutor(IVariableContextInfo contextInfo,
|
||||||
String inexistentMacroValue, String listDelimiter,
|
String inexistentMacroValue, String listDelimiter,
|
||||||
Map delimiterMap, String incorrectlyReferencedMacroValue) {
|
Map<?, ?> delimiterMap, String incorrectlyReferencedMacroValue) {
|
||||||
super(contextInfo, inexistentMacroValue, listDelimiter, delimiterMap,
|
super(contextInfo, inexistentMacroValue, listDelimiter, delimiterMap,
|
||||||
incorrectlyReferencedMacroValue);
|
incorrectlyReferencedMacroValue);
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -45,8 +45,8 @@ public class EnvironmentVariableSupplier extends CoreMacroSupplierBase {
|
||||||
if(delimiter != null && !"".equals(delimiter)){ //$NON-NLS-1$
|
if(delimiter != null && !"".equals(delimiter)){ //$NON-NLS-1$
|
||||||
fType = VALUE_TEXT_LIST;
|
fType = VALUE_TEXT_LIST;
|
||||||
if(value != null){
|
if(value != null){
|
||||||
List list = EnvVarOperationProcessor.convertToList(value,delimiter);
|
List<String> list = EnvVarOperationProcessor.convertToList(value,delimiter);
|
||||||
fStringListValue = (String[])list.toArray(new String[list.size()]);
|
fStringListValue = list.toArray(new String[list.size()]);
|
||||||
} else {
|
} else {
|
||||||
fStringListValue = null;
|
fStringListValue = null;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -64,14 +64,14 @@ public class StorableCdtVariable extends CdtVariable {
|
||||||
fStringValue = element.getAttribute(VALUE);
|
fStringValue = element.getAttribute(VALUE);
|
||||||
else {
|
else {
|
||||||
ICStorageElement nodeList[] = element.getChildren();
|
ICStorageElement nodeList[] = element.getChildren();
|
||||||
List values = new ArrayList();
|
List<String> values = new ArrayList<String>();
|
||||||
for (int i = 0; i < nodeList.length; ++i) {
|
for (int i = 0; i < nodeList.length; ++i) {
|
||||||
ICStorageElement node = nodeList[i];
|
ICStorageElement node = nodeList[i];
|
||||||
if (node.getName().equals(VALUE_ELEMENT_NAME)) {
|
if (node.getName().equals(VALUE_ELEMENT_NAME)) {
|
||||||
values.add(node.getAttribute(VALUE_ELEMENT_VALUE));
|
values.add(node.getAttribute(VALUE_ELEMENT_VALUE));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
fStringListValue = (String[])values.toArray(new String[values.size()]);
|
fStringListValue = values.toArray(new String[values.size()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -48,7 +48,7 @@ public class EclipseEnvironmentSupplier implements ICoreEnvironmentVariableSuppl
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
IEnvironmentVariable variables[] = new IEnvironmentVariable[values.size()];
|
IEnvironmentVariable variables[] = new IEnvironmentVariable[values.size()];
|
||||||
Enumeration en = values.propertyNames();
|
Enumeration<?> en = values.propertyNames();
|
||||||
for( int i = 0; i < variables.length ; i++){
|
for( int i = 0; i < variables.length ; i++){
|
||||||
String name = (String)en.nextElement();
|
String name = (String)en.nextElement();
|
||||||
String value = values.getProperty(name);
|
String value = values.getProperty(name);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -29,7 +29,7 @@ import org.eclipse.cdt.utils.envvar.EnvVarOperationProcessor;
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class EnvVarCollector {
|
public class EnvVarCollector {
|
||||||
private Map fMap = null;
|
private Map<String, EnvVarDescriptor> fMap = null;
|
||||||
public EnvVarCollector(){
|
public EnvVarCollector(){
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -57,11 +57,11 @@ public class EnvVarCollector {
|
||||||
|
|
||||||
if(fMap == null){
|
if(fMap == null){
|
||||||
noCheck = true;
|
noCheck = true;
|
||||||
fMap = new HashMap();
|
fMap = new HashMap<String, EnvVarDescriptor>();
|
||||||
}
|
}
|
||||||
|
|
||||||
EnvVarDescriptor des = null;
|
EnvVarDescriptor des = null;
|
||||||
if(noCheck || (des = (EnvVarDescriptor)fMap.get(name)) == null){
|
if(noCheck || (des = fMap.get(name)) == null){
|
||||||
des = new EnvVarDescriptor(var,info,num, supplier);
|
des = new EnvVarDescriptor(var,info,num, supplier);
|
||||||
fMap.put(name,des);
|
fMap.put(name,des);
|
||||||
}
|
}
|
||||||
|
@ -82,16 +82,16 @@ public class EnvVarCollector {
|
||||||
public EnvVarDescriptor[] toArray(boolean includeRemoved){
|
public EnvVarDescriptor[] toArray(boolean includeRemoved){
|
||||||
if(fMap == null)
|
if(fMap == null)
|
||||||
return new EnvVarDescriptor[0];
|
return new EnvVarDescriptor[0];
|
||||||
Collection values = fMap.values();
|
Collection<EnvVarDescriptor> values = fMap.values();
|
||||||
List list = new ArrayList();
|
List<EnvVarDescriptor> list = new ArrayList<EnvVarDescriptor>();
|
||||||
Iterator iter = values.iterator();
|
Iterator<EnvVarDescriptor> iter = values.iterator();
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
EnvVarDescriptor des = (EnvVarDescriptor)iter.next();
|
EnvVarDescriptor des = iter.next();
|
||||||
if(des != null &&
|
if(des != null &&
|
||||||
(includeRemoved || des.getOperation() != IEnvironmentVariable.ENVVAR_REMOVE))
|
(includeRemoved || des.getOperation() != IEnvironmentVariable.ENVVAR_REMOVE))
|
||||||
list.add(des);
|
list.add(des);
|
||||||
}
|
}
|
||||||
return (EnvVarDescriptor[])list.toArray(new EnvVarDescriptor[list.size()]);
|
return list.toArray(new EnvVarDescriptor[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -107,7 +107,7 @@ public class EnvVarCollector {
|
||||||
if(!EnvironmentVariableManager.getDefault().isVariableCaseSensitive())
|
if(!EnvironmentVariableManager.getDefault().isVariableCaseSensitive())
|
||||||
name = name.toUpperCase();
|
name = name.toUpperCase();
|
||||||
|
|
||||||
return (EnvVarDescriptor)fMap.get(name);
|
return fMap.get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2005 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -46,10 +46,10 @@ public class NM {
|
||||||
private static Pattern undef_pattern = null;
|
private static Pattern undef_pattern = null;
|
||||||
private static Pattern normal_pattern = null;
|
private static Pattern normal_pattern = null;
|
||||||
|
|
||||||
private List undef_symbols;
|
private List<String> undef_symbols;
|
||||||
private List text_symbols;
|
private List<AddressNamePair> text_symbols;
|
||||||
private List bss_symbols;
|
private List<AddressNamePair> bss_symbols;
|
||||||
private List data_symbols;
|
private List<AddressNamePair> data_symbols;
|
||||||
|
|
||||||
private void parseOutput(InputStream stream) throws IOException {
|
private void parseOutput(InputStream stream) throws IOException {
|
||||||
|
|
||||||
|
@ -135,29 +135,29 @@ public class NM {
|
||||||
System.arraycopy(params, 0, args, 1, params.length);
|
System.arraycopy(params, 0, args, 1, params.length);
|
||||||
}
|
}
|
||||||
|
|
||||||
undef_symbols = new ArrayList();
|
undef_symbols = new ArrayList<String>();
|
||||||
text_symbols = new ArrayList();
|
text_symbols = new ArrayList<AddressNamePair>();
|
||||||
data_symbols = new ArrayList();
|
data_symbols = new ArrayList<AddressNamePair>();
|
||||||
bss_symbols = new ArrayList();
|
bss_symbols = new ArrayList<AddressNamePair>();
|
||||||
Process process = ProcessFactory.getFactory().exec(args);
|
Process process = ProcessFactory.getFactory().exec(args);
|
||||||
parseOutput(process.getInputStream());
|
parseOutput(process.getInputStream());
|
||||||
process.destroy();
|
process.destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getUndefSymbols() {
|
public String[] getUndefSymbols() {
|
||||||
return (String[]) undef_symbols.toArray(new String[0]);
|
return undef_symbols.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressNamePair[] getTextSymbols() {
|
public AddressNamePair[] getTextSymbols() {
|
||||||
return (AddressNamePair[]) text_symbols.toArray(new AddressNamePair[0]);
|
return text_symbols.toArray(new AddressNamePair[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressNamePair[] getDataSymbols() {
|
public AddressNamePair[] getDataSymbols() {
|
||||||
return (AddressNamePair[]) data_symbols.toArray(new AddressNamePair[0]);
|
return data_symbols.toArray(new AddressNamePair[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public AddressNamePair[] getBSSSymbols() {
|
public AddressNamePair[] getBSSSymbols() {
|
||||||
return (AddressNamePair[]) bss_symbols.toArray(new AddressNamePair[0]);
|
return bss_symbols.toArray(new AddressNamePair[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -31,7 +31,7 @@ public class Objdump {
|
||||||
params = new String[0];
|
params = new String[0];
|
||||||
} else {
|
} else {
|
||||||
// FIXME: This is wrong we have to check for quoted strings.
|
// FIXME: This is wrong we have to check for quoted strings.
|
||||||
List list = new ArrayList();
|
List<String> list = new ArrayList<String>();
|
||||||
StringTokenizer st = new StringTokenizer(param);
|
StringTokenizer st = new StringTokenizer(param);
|
||||||
while (st.hasMoreTokens()) {
|
while (st.hasMoreTokens()) {
|
||||||
list.add(st.nextToken());
|
list.add(st.nextToken());
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -43,7 +43,7 @@ public class SupplierBasedCdtVariableManager {
|
||||||
if(contextInfo == null)
|
if(contextInfo == null)
|
||||||
return new ICdtVariable[0];
|
return new ICdtVariable[0];
|
||||||
|
|
||||||
Map map = new HashMap();
|
Map<String, ICdtVariable> map = new HashMap<String, ICdtVariable>();
|
||||||
IVariableContextInfo infos[] = includeParentContexts ?
|
IVariableContextInfo infos[] = includeParentContexts ?
|
||||||
getAllVariableContextInfos(contextInfo) :
|
getAllVariableContextInfos(contextInfo) :
|
||||||
new IVariableContextInfo[]{contextInfo};
|
new IVariableContextInfo[]{contextInfo};
|
||||||
|
@ -63,8 +63,8 @@ public class SupplierBasedCdtVariableManager {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Collection values = map.values();
|
Collection<ICdtVariable> values = map.values();
|
||||||
return (ICdtVariable[])values.toArray(new ICdtVariable[values.size()]);
|
return values.toArray(new ICdtVariable[values.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -75,14 +75,14 @@ public class SupplierBasedCdtVariableManager {
|
||||||
if(contextInfo == null)
|
if(contextInfo == null)
|
||||||
return null;
|
return null;
|
||||||
|
|
||||||
List list = new ArrayList();
|
List<IVariableContextInfo> list = new ArrayList<IVariableContextInfo>();
|
||||||
|
|
||||||
list.add(contextInfo);
|
list.add(contextInfo);
|
||||||
|
|
||||||
while((contextInfo = contextInfo.getNext()) != null)
|
while((contextInfo = contextInfo.getNext()) != null)
|
||||||
list.add(contextInfo);
|
list.add(contextInfo);
|
||||||
|
|
||||||
return (IVariableContextInfo[])list.toArray(new IVariableContextInfo[list.size()]);
|
return list.toArray(new IVariableContextInfo[list.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2006 Nokia and others.
|
* Copyright (c) 2006, 2008 Nokia and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -19,19 +19,19 @@ import org.eclipse.cdt.core.ISymbolReader;
|
||||||
|
|
||||||
public class CodeViewReader implements ISymbolReader {
|
public class CodeViewReader implements ISymbolReader {
|
||||||
|
|
||||||
RandomAccessFile file;
|
private RandomAccessFile file;
|
||||||
int cvData;
|
private int cvData;
|
||||||
boolean isLe;
|
private boolean isLe;
|
||||||
List fileList;
|
private List<String> fileList;
|
||||||
String[] files = null;
|
private String[] files = null;
|
||||||
boolean parsed = false;
|
private boolean parsed = false;
|
||||||
|
|
||||||
public CodeViewReader(RandomAccessFile accessFile, int dataOffset, boolean littleEndian) {
|
public CodeViewReader(RandomAccessFile accessFile, int dataOffset, boolean littleEndian) {
|
||||||
file = accessFile;
|
file = accessFile;
|
||||||
cvData = dataOffset;
|
cvData = dataOffset;
|
||||||
isLe = littleEndian;
|
isLe = littleEndian;
|
||||||
|
|
||||||
fileList = new ArrayList();
|
fileList = new ArrayList<String>();
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] getSourceFiles() {
|
public String[] getSourceFiles() {
|
||||||
|
@ -45,7 +45,7 @@ public class CodeViewReader implements ISymbolReader {
|
||||||
|
|
||||||
files = new String[fileList.size()];
|
files = new String[fileList.size()];
|
||||||
for (int i = 0; i < fileList.size(); i++) {
|
for (int i = 0; i < fileList.size(); i++) {
|
||||||
files[i] = (String)fileList.get(i);
|
files[i] = fileList.get(i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -565,7 +565,7 @@ public class Coff {
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getStringTable(byte[] bytes) {
|
public static String[] getStringTable(byte[] bytes) {
|
||||||
List aList = new ArrayList();
|
List<String> aList = new ArrayList<String>();
|
||||||
int offset = 0;
|
int offset = 0;
|
||||||
for (int i = 0; i < bytes.length; i++) {
|
for (int i = 0; i < bytes.length; i++) {
|
||||||
if (bytes[i] == 0) {
|
if (bytes[i] == 0) {
|
||||||
|
@ -573,7 +573,7 @@ public class Coff {
|
||||||
offset = i + 1;
|
offset = i + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return (String[])aList.toArray(new String[0]);
|
return aList.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Coff(String filename) throws IOException {
|
public Coff(String filename) throws IOException {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2006 QNX Software Systems and others.
|
* Copyright (c) 2004, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -35,7 +35,7 @@ public class CygwinPEBinaryArchive extends PEBinaryArchive {
|
||||||
* java.util.ArrayList)
|
* java.util.ArrayList)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addArchiveMembers(ARHeader[] headers, ArrayList children2) {
|
protected void addArchiveMembers(ARHeader[] headers, ArrayList<IBinaryObject> children2) {
|
||||||
for (int i = 0; i < headers.length; i++) {
|
for (int i = 0; i < headers.length; i++) {
|
||||||
IBinaryObject bin = new CygwinPEBinaryObject(getBinaryParser(), getPath(), headers[i]);
|
IBinaryObject bin = new CygwinPEBinaryObject(getBinaryParser(), getPath(), headers[i]);
|
||||||
children.add(bin);
|
children.add(bin);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -28,10 +28,10 @@ import org.eclipse.cdt.utils.CygPath;
|
||||||
import org.eclipse.cdt.utils.ICygwinToolsFactroy;
|
import org.eclipse.cdt.utils.ICygwinToolsFactroy;
|
||||||
import org.eclipse.cdt.utils.NM;
|
import org.eclipse.cdt.utils.NM;
|
||||||
import org.eclipse.cdt.utils.Objdump;
|
import org.eclipse.cdt.utils.Objdump;
|
||||||
|
import org.eclipse.cdt.utils.Symbol;
|
||||||
import org.eclipse.cdt.utils.AR.ARHeader;
|
import org.eclipse.cdt.utils.AR.ARHeader;
|
||||||
import org.eclipse.cdt.utils.coff.Coff;
|
import org.eclipse.cdt.utils.coff.Coff;
|
||||||
import org.eclipse.cdt.utils.coff.PE;
|
import org.eclipse.cdt.utils.coff.PE;
|
||||||
import org.eclipse.cdt.utils.coff.Coff.Symbol;
|
|
||||||
import org.eclipse.core.runtime.IPath;
|
import org.eclipse.core.runtime.IPath;
|
||||||
import org.eclipse.core.runtime.Path;
|
import org.eclipse.core.runtime.Path;
|
||||||
|
|
||||||
|
@ -179,7 +179,7 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
|
||||||
symbolLoadingCygPath = getCygPath();
|
symbolLoadingCygPath = getCygPath();
|
||||||
|
|
||||||
|
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<Symbol> list = new ArrayList<Symbol>();
|
||||||
super.loadSymbols(pe, list);
|
super.loadSymbols(pe, list);
|
||||||
|
|
||||||
// Add any global symbols
|
// Add any global symbols
|
||||||
|
@ -198,7 +198,7 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
|
||||||
// for (int i = 0; i < pairs.length; ++i) {
|
// for (int i = 0; i < pairs.length; ++i) {
|
||||||
// addSymbol(pairs[i], list, ISymbol.FUNCTION);
|
// addSymbol(pairs[i], list, ISymbol.FUNCTION);
|
||||||
// }
|
// }
|
||||||
symbols = (ISymbol[]) list.toArray(NO_SYMBOLS);
|
symbols = list.toArray(NO_SYMBOLS);
|
||||||
Arrays.sort(symbols);
|
Arrays.sort(symbols);
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|
||||||
|
@ -216,7 +216,7 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addSymbol(NM.AddressNamePair p, List list, int type) {
|
private void addSymbol(NM.AddressNamePair p, List<Symbol> list, int type) {
|
||||||
String name = p.name;
|
String name = p.name;
|
||||||
if (name != null && name.length() > 0 && CConventions.isValidIdentifier(name)) {
|
if (name != null && name.length() > 0 && CConventions.isValidIdentifier(name)) {
|
||||||
IAddress addr = new Addr32(p.address);
|
IAddress addr = new Addr32(p.address);
|
||||||
|
@ -266,8 +266,8 @@ public class CygwinPEBinaryObject extends PEBinaryObject {
|
||||||
* byte[], java.util.List)
|
* byte[], java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List list) {
|
protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List<Symbol> list) {
|
||||||
for (Symbol peSym : peSyms) {
|
for (Coff.Symbol peSym : peSyms) {
|
||||||
if (peSym.isFunction() || peSym.isPointer() || peSym.isArray()) {
|
if (peSym.isFunction() || peSym.isPointer() || peSym.isArray()) {
|
||||||
String name = peSym.getName(table);
|
String name = peSym.getName(table);
|
||||||
if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) {
|
if (name == null || name.trim().length() == 0 || !Character.isJavaIdentifierStart(name.charAt(0))) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -26,12 +26,12 @@ import org.eclipse.core.runtime.IPath;
|
||||||
*/
|
*/
|
||||||
public class PEBinaryArchive extends BinaryFile implements IBinaryArchive {
|
public class PEBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
|
|
||||||
ArrayList children;
|
ArrayList<IBinaryObject> children;
|
||||||
|
|
||||||
public PEBinaryArchive(PEParser parser, IPath path) throws IOException {
|
public PEBinaryArchive(PEParser parser, IPath path) throws IOException {
|
||||||
super(parser, path, IBinaryFile.ARCHIVE);
|
super(parser, path, IBinaryFile.ARCHIVE);
|
||||||
new AR(path.toOSString()).dispose(); // check file type
|
new AR(path.toOSString()).dispose(); // check file type
|
||||||
children = new ArrayList(5);
|
children = new ArrayList<IBinaryObject>(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -53,14 +53,14 @@ public class PEBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
}
|
}
|
||||||
children.trimToSize();
|
children.trimToSize();
|
||||||
}
|
}
|
||||||
return (IBinaryObject[]) children.toArray(new IBinaryObject[0]);
|
return children.toArray(new IBinaryObject[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param headers
|
* @param headers
|
||||||
* @param children2
|
* @param children2
|
||||||
*/
|
*/
|
||||||
protected void addArchiveMembers(ARHeader[] headers, ArrayList children2) {
|
protected void addArchiveMembers(ARHeader[] headers, ArrayList<IBinaryObject> children2) {
|
||||||
for (int i = 0; i < headers.length; i++) {
|
for (int i = 0; i < headers.length; i++) {
|
||||||
IBinaryObject bin = new PEBinaryObject(getBinaryParser(), getPath(), headers[i]);
|
IBinaryObject bin = new PEBinaryObject(getBinaryParser(), getPath(), headers[i]);
|
||||||
children.add(bin);
|
children.add(bin);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -102,6 +102,7 @@ public class PEBinaryObject extends BinaryObjectAdapter {
|
||||||
return info;
|
return info;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
if (adapter.equals(PE.class)) {
|
if (adapter.equals(PE.class)) {
|
||||||
|
@ -163,19 +164,19 @@ public class PEBinaryObject extends BinaryObjectAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadSymbols(PE pe) throws IOException {
|
protected void loadSymbols(PE pe) throws IOException {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<Symbol> list = new ArrayList<Symbol>();
|
||||||
loadSymbols(pe, list);
|
loadSymbols(pe, list);
|
||||||
symbols = (ISymbol[]) list.toArray(NO_SYMBOLS);
|
symbols = list.toArray(NO_SYMBOLS);
|
||||||
Arrays.sort(symbols);
|
Arrays.sort(symbols);
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
protected void loadSymbols(PE pe, List list) throws IOException {
|
protected void loadSymbols(PE pe, List<Symbol> list) throws IOException {
|
||||||
Coff.Symbol[] peSyms = pe.getSymbols();
|
Coff.Symbol[] peSyms = pe.getSymbols();
|
||||||
byte[] table = pe.getStringTable();
|
byte[] table = pe.getStringTable();
|
||||||
addSymbols(peSyms, table, list);
|
addSymbols(peSyms, table, list);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List list) {
|
protected void addSymbols(Coff.Symbol[] peSyms, byte[] table, List<Symbol> list) {
|
||||||
for (int i = 0; i < peSyms.length; i++) {
|
for (int i = 0; i < peSyms.length; i++) {
|
||||||
if (peSyms[i].isFunction() || peSyms[i].isPointer() || peSyms[i].isArray()) {
|
if (peSyms[i].isFunction() || peSyms[i].isPointer() || peSyms[i].isArray()) {
|
||||||
String name = peSyms[i].getName(table);
|
String name = peSyms[i].getName(table);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Nokia and others.
|
* Copyright (c) 2007, 2008 Nokia and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -18,7 +18,6 @@ import java.util.ArrayList;
|
||||||
import java.util.Collection;
|
import java.util.Collection;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
|
||||||
import org.eclipse.cdt.core.ISymbolReader;
|
import org.eclipse.cdt.core.ISymbolReader;
|
||||||
import org.eclipse.cdt.utils.debug.IDebugEntryRequestor;
|
import org.eclipse.cdt.utils.debug.IDebugEntryRequestor;
|
||||||
import org.eclipse.cdt.utils.elf.Elf;
|
import org.eclipse.cdt.utils.elf.Elf;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -15,8 +15,6 @@ import java.io.BufferedWriter;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.OutputStream;
|
import java.io.OutputStream;
|
||||||
import java.io.OutputStreamWriter;
|
import java.io.OutputStreamWriter;
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import org.eclipse.cdt.core.CCorePlugin;
|
import org.eclipse.cdt.core.CCorePlugin;
|
||||||
import org.eclipse.cdt.utils.debug.DebugBaseType;
|
import org.eclipse.cdt.utils.debug.DebugBaseType;
|
||||||
|
@ -34,7 +32,6 @@ import org.eclipse.cdt.utils.elf.Elf;
|
||||||
*/
|
*/
|
||||||
public class DebugDump implements IDebugEntryRequestor {
|
public class DebugDump implements IDebugEntryRequestor {
|
||||||
|
|
||||||
List list = new ArrayList();
|
|
||||||
BufferedWriter bwriter;
|
BufferedWriter bwriter;
|
||||||
int bracket;
|
int bracket;
|
||||||
int paramCount = -1;
|
int paramCount = -1;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -12,7 +12,7 @@
|
||||||
package org.eclipse.cdt.utils.debug.tools;
|
package org.eclipse.cdt.utils.debug.tools;
|
||||||
|
|
||||||
|
|
||||||
public class DebugSym implements Comparable {
|
public class DebugSym implements Comparable<Object> {
|
||||||
|
|
||||||
public long addr;
|
public long addr;
|
||||||
public long size;
|
public long size;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -30,7 +30,7 @@ public class DebugSymsRequestor implements IDebugEntryRequestor {
|
||||||
DebugSym currentCU;
|
DebugSym currentCU;
|
||||||
DebugSym currentFunction;
|
DebugSym currentFunction;
|
||||||
|
|
||||||
List list = new ArrayList();
|
List<DebugSym> list = new ArrayList<DebugSym>();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -394,7 +394,7 @@ public class Elf {
|
||||||
return str.toString();
|
return str.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Symbol implements Comparable {
|
public class Symbol implements Comparable<Object> {
|
||||||
|
|
||||||
/* Symbol bindings */
|
/* Symbol bindings */
|
||||||
public final static int STB_LOCAL = 0;
|
public final static int STB_LOCAL = 0;
|
||||||
|
@ -477,7 +477,7 @@ public class Elf {
|
||||||
* Long it is ok, but not if we do Long vs Symbol.
|
* Long it is ok, but not if we do Long vs Symbol.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
class SymbolComparator implements Comparator {
|
class SymbolComparator implements Comparator<Object> {
|
||||||
|
|
||||||
IAddress val1, val2;
|
IAddress val1, val2;
|
||||||
public int compare(Object o1, Object o2) {
|
public int compare(Object o1, Object o2) {
|
||||||
|
@ -630,7 +630,7 @@ public class Elf {
|
||||||
if (section.sh_type != Section.SHT_DYNAMIC) {
|
if (section.sh_type != Section.SHT_DYNAMIC) {
|
||||||
return new Dynamic[0];
|
return new Dynamic[0];
|
||||||
}
|
}
|
||||||
ArrayList dynList = new ArrayList();
|
ArrayList<Dynamic> dynList = new ArrayList<Dynamic>();
|
||||||
efile.seek(section.sh_offset);
|
efile.seek(section.sh_offset);
|
||||||
int off = 0;
|
int off = 0;
|
||||||
// We must assume the section is a table ignoring the sh_entsize as it
|
// We must assume the section is a table ignoring the sh_entsize as it
|
||||||
|
@ -659,7 +659,7 @@ public class Elf {
|
||||||
if (dynEnt.d_tag != Dynamic.DT_NULL)
|
if (dynEnt.d_tag != Dynamic.DT_NULL)
|
||||||
dynList.add(dynEnt);
|
dynList.add(dynEnt);
|
||||||
}
|
}
|
||||||
return (Dynamic[])dynList.toArray(new Dynamic[0]);
|
return dynList.toArray(new Dynamic[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void commonSetup(String file, long offset) throws IOException {
|
private void commonSetup(String file, long offset) throws IOException {
|
||||||
|
@ -974,12 +974,12 @@ public class Elf {
|
||||||
public Section[] getSections(int type) throws IOException {
|
public Section[] getSections(int type) throws IOException {
|
||||||
if (sections == null)
|
if (sections == null)
|
||||||
getSections();
|
getSections();
|
||||||
ArrayList slist = new ArrayList();
|
ArrayList<Section> slist = new ArrayList<Section>();
|
||||||
for (int i = 0; i < sections.length; i++) {
|
for (int i = 0; i < sections.length; i++) {
|
||||||
if (sections[i].sh_type == type)
|
if (sections[i].sh_type == type)
|
||||||
slist.add(sections[i]);
|
slist.add(sections[i]);
|
||||||
}
|
}
|
||||||
return (Section[])slist.toArray(new Section[0]);
|
return slist.toArray(new Section[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Section[] getSections() throws IOException {
|
public Section[] getSections() throws IOException {
|
||||||
|
@ -1050,7 +1050,7 @@ public class Elf {
|
||||||
if (section.sh_entsize != 0) {
|
if (section.sh_entsize != 0) {
|
||||||
numSyms = (int)section.sh_size / (int)section.sh_entsize;
|
numSyms = (int)section.sh_size / (int)section.sh_entsize;
|
||||||
}
|
}
|
||||||
ArrayList symList = new ArrayList(numSyms);
|
ArrayList<Symbol> symList = new ArrayList<Symbol>(numSyms);
|
||||||
long offset = section.sh_offset;
|
long offset = section.sh_offset;
|
||||||
for (int c = 0; c < numSyms; offset += section.sh_entsize, c++) {
|
for (int c = 0; c < numSyms; offset += section.sh_entsize, c++) {
|
||||||
efile.seek(offset);
|
efile.seek(offset);
|
||||||
|
@ -1088,7 +1088,7 @@ public class Elf {
|
||||||
continue;
|
continue;
|
||||||
symList.add(symbol);
|
symList.add(symbol);
|
||||||
}
|
}
|
||||||
Symbol[] results = (Symbol[])symList.toArray(new Symbol[0]);
|
Symbol[] results = symList.toArray(new Symbol[0]);
|
||||||
Arrays.sort(results);
|
Arrays.sort(results);
|
||||||
return results;
|
return results;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -14,6 +14,9 @@ import java.io.File;
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.util.Vector;
|
import java.util.Vector;
|
||||||
|
|
||||||
|
import org.eclipse.cdt.utils.elf.Elf.Dynamic;
|
||||||
|
import org.eclipse.cdt.utils.elf.Elf.Symbol;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <code>ElfHelper</code> is a wrapper class for the <code>Elf</code> class
|
* <code>ElfHelper</code> is a wrapper class for the <code>Elf</code> class
|
||||||
* to provide higher level API for sorting/searching the ELF data.
|
* to provide higher level API for sorting/searching the ELF data.
|
||||||
|
@ -124,7 +127,7 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getExternalFunctions() throws IOException {
|
public Elf.Symbol[] getExternalFunctions() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
loadSections();
|
loadSections();
|
||||||
|
@ -142,12 +145,12 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getExternalObjects() throws IOException {
|
public Elf.Symbol[] getExternalObjects() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
loadSections();
|
loadSections();
|
||||||
|
@ -165,12 +168,12 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getUndefined() throws IOException {
|
public Elf.Symbol[] getUndefined() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
|
|
||||||
|
@ -179,12 +182,12 @@ public class ElfHelper {
|
||||||
v.add(dynsyms[i]);
|
v.add(dynsyms[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getLocalFunctions() throws IOException {
|
public Elf.Symbol[] getLocalFunctions() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
loadSections();
|
loadSections();
|
||||||
|
@ -202,12 +205,12 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getLocalObjects() throws IOException {
|
public Elf.Symbol[] getLocalObjects() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
loadSections();
|
loadSections();
|
||||||
|
@ -225,12 +228,12 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Symbol[] getCommonObjects() throws IOException {
|
public Elf.Symbol[] getCommonObjects() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Symbol> v = new Vector<Symbol>();
|
||||||
|
|
||||||
loadSymbols();
|
loadSymbols();
|
||||||
loadSections();
|
loadSections();
|
||||||
|
@ -244,12 +247,12 @@ public class ElfHelper {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Elf.Symbol[] ret = (Elf.Symbol[])v.toArray(new Elf.Symbol[v.size()]);
|
Elf.Symbol[] ret = v.toArray(new Elf.Symbol[v.size()]);
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Elf.Dynamic[] getNeeded() throws IOException {
|
public Elf.Dynamic[] getNeeded() throws IOException {
|
||||||
Vector v = new Vector();
|
Vector<Dynamic> v = new Vector<Dynamic>();
|
||||||
|
|
||||||
loadDynamics();
|
loadDynamics();
|
||||||
|
|
||||||
|
@ -257,7 +260,7 @@ public class ElfHelper {
|
||||||
if (dynamics[i].d_tag == Elf.Dynamic.DT_NEEDED)
|
if (dynamics[i].d_tag == Elf.Dynamic.DT_NEEDED)
|
||||||
v.add(dynamics[i]);
|
v.add(dynamics[i]);
|
||||||
}
|
}
|
||||||
return (Elf.Dynamic[])v.toArray(new Elf.Dynamic[v.size()]);
|
return v.toArray(new Elf.Dynamic[v.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSoname() throws IOException {
|
public String getSoname() throws IOException {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -16,6 +16,7 @@ import java.util.Comparator;
|
||||||
/**
|
/**
|
||||||
* @deprecated This class is slated for removal, it is not used by the CDT classes
|
* @deprecated This class is slated for removal, it is not used by the CDT classes
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
public class SymbolSortCompare implements Comparator {
|
public class SymbolSortCompare implements Comparator {
|
||||||
public int compare( Object o1, Object o2 ) {
|
public int compare( Object o1, Object o2 ) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -27,12 +27,12 @@ import org.eclipse.core.runtime.IPath;
|
||||||
*/
|
*/
|
||||||
public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive {
|
public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
|
|
||||||
private ArrayList children;
|
private ArrayList<IBinaryObject> children;
|
||||||
|
|
||||||
public ElfBinaryArchive(IBinaryParser parser, IPath p) throws IOException {
|
public ElfBinaryArchive(IBinaryParser parser, IPath p) throws IOException {
|
||||||
super(parser, p, IBinaryFile.ARCHIVE);
|
super(parser, p, IBinaryFile.ARCHIVE);
|
||||||
new AR(p.toOSString()).dispose(); // check file type
|
new AR(p.toOSString()).dispose(); // check file type
|
||||||
children = new ArrayList(5);
|
children = new ArrayList<IBinaryObject>(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,7 +55,7 @@ public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
}
|
}
|
||||||
children.trimToSize();
|
children.trimToSize();
|
||||||
}
|
}
|
||||||
return (IBinaryObject[]) children.toArray(new IBinaryObject[0]);
|
return children.toArray(new IBinaryObject[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected IBinaryObject[] createArchiveMembers(ARHeader[] headers) {
|
protected IBinaryObject[] createArchiveMembers(ARHeader[] headers) {
|
||||||
|
@ -69,6 +69,7 @@ public class ElfBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
/**
|
/**
|
||||||
* @deprecated use {@link ElfBinaryArchive#createArchiveMembers(ARHeader[])}
|
* @deprecated use {@link ElfBinaryArchive#createArchiveMembers(ARHeader[])}
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Deprecated
|
@Deprecated
|
||||||
protected void addArchiveMembers(ARHeader[] headers, ArrayList children) {
|
protected void addArchiveMembers(ARHeader[] headers, ArrayList children) {
|
||||||
IBinaryObject[] bobjs= createArchiveMembers(headers);
|
IBinaryObject[] bobjs= createArchiveMembers(headers);
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -21,6 +21,7 @@ import org.eclipse.cdt.utils.Addr2line;
|
||||||
import org.eclipse.cdt.utils.CPPFilt;
|
import org.eclipse.cdt.utils.CPPFilt;
|
||||||
import org.eclipse.cdt.utils.IGnuToolFactory;
|
import org.eclipse.cdt.utils.IGnuToolFactory;
|
||||||
import org.eclipse.cdt.utils.Objdump;
|
import org.eclipse.cdt.utils.Objdump;
|
||||||
|
import org.eclipse.cdt.utils.Symbol;
|
||||||
import org.eclipse.cdt.utils.AR.ARHeader;
|
import org.eclipse.cdt.utils.AR.ARHeader;
|
||||||
import org.eclipse.cdt.utils.elf.Elf;
|
import org.eclipse.cdt.utils.elf.Elf;
|
||||||
import org.eclipse.cdt.utils.elf.ElfHelper;
|
import org.eclipse.cdt.utils.elf.ElfHelper;
|
||||||
|
@ -167,7 +168,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
|
||||||
* int, java.util.List)
|
* int, java.util.List)
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
protected void addSymbols(Elf.Symbol[] array, int type, List list) {
|
protected void addSymbols(Elf.Symbol[] array, int type, List<Symbol> list) {
|
||||||
for (int i = 0; i < array.length; i++) {
|
for (int i = 0; i < array.length; i++) {
|
||||||
String name = array[i].toString();
|
String name = array[i].toString();
|
||||||
if (symbolLoadingCPPFilt != null) {
|
if (symbolLoadingCPPFilt != null) {
|
||||||
|
@ -206,6 +207,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
|
||||||
*
|
*
|
||||||
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
|
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
if (adapter == Addr2line.class) {
|
if (adapter == Addr2line.class) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2006 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -78,6 +78,7 @@ public class GNUElfParser extends ElfParser {
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
|
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
if (adapter.equals(IGnuToolFactory.class)) {
|
if (adapter.equals(IGnuToolFactory.class)) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2007 Intel Corporation and others.
|
* Copyright (c) 2007, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -16,7 +16,7 @@ import java.util.Map;
|
||||||
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
|
import org.eclipse.cdt.core.envvar.IEnvironmentVariable;
|
||||||
|
|
||||||
public class EnvironmentCollector {
|
public class EnvironmentCollector {
|
||||||
private Map fEnfironmentMap = new HashMap();
|
private Map<String, IEnvironmentVariable> fEnfironmentMap = new HashMap<String, IEnvironmentVariable>();
|
||||||
|
|
||||||
public IEnvironmentVariable addVariable(IEnvironmentVariable var){
|
public IEnvironmentVariable addVariable(IEnvironmentVariable var){
|
||||||
if(var == null)
|
if(var == null)
|
||||||
|
@ -27,7 +27,7 @@ public class EnvironmentCollector {
|
||||||
name = EnvVarOperationProcessor.normalizeName(name);
|
name = EnvVarOperationProcessor.normalizeName(name);
|
||||||
|
|
||||||
if(name != null){
|
if(name != null){
|
||||||
IEnvironmentVariable old = (IEnvironmentVariable)fEnfironmentMap.get(name);
|
IEnvironmentVariable old = fEnfironmentMap.get(name);
|
||||||
if(old != null){
|
if(old != null){
|
||||||
var = EnvVarOperationProcessor.performOperation(old, var);
|
var = EnvVarOperationProcessor.performOperation(old, var);
|
||||||
}
|
}
|
||||||
|
@ -48,11 +48,11 @@ public class EnvironmentCollector {
|
||||||
public IEnvironmentVariable getVariable(String name){
|
public IEnvironmentVariable getVariable(String name){
|
||||||
name = EnvVarOperationProcessor.normalizeName(name);
|
name = EnvVarOperationProcessor.normalizeName(name);
|
||||||
if(name != null)
|
if(name != null)
|
||||||
return (IEnvironmentVariable)fEnfironmentMap.get(name);
|
return fEnfironmentMap.get(name);
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnvironmentVariable[] getVariables(){
|
public IEnvironmentVariable[] getVariables(){
|
||||||
return (IEnvironmentVariable[])fEnfironmentMap.values().toArray(new IEnvironmentVariable[fEnfironmentMap.size()]);
|
return fEnfironmentMap.values().toArray(new IEnvironmentVariable[fEnfironmentMap.size()]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2005, 2007 Intel Corporation and others.
|
* Copyright (c) 2005, 2008 Intel Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -33,16 +33,16 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
private static final String ATTRIBUTE_APPEND = "append"; //$NON-NLS-1$
|
private static final String ATTRIBUTE_APPEND = "append"; //$NON-NLS-1$
|
||||||
private static final String ATTRIBUTE_APPEND_CONTRIBUTED = "appendContributed"; //$NON-NLS-1$
|
private static final String ATTRIBUTE_APPEND_CONTRIBUTED = "appendContributed"; //$NON-NLS-1$
|
||||||
private static final boolean DEFAULT_APPEND = true;
|
private static final boolean DEFAULT_APPEND = true;
|
||||||
private HashMap fVariables;
|
private HashMap<String, IEnvironmentVariable> fVariables;
|
||||||
private boolean fIsDirty = false;
|
private boolean fIsDirty = false;
|
||||||
private boolean fIsChanged = false;
|
private boolean fIsChanged = false;
|
||||||
private boolean fIsReadOnly;
|
private boolean fIsReadOnly;
|
||||||
private boolean fAppend = DEFAULT_APPEND;
|
private boolean fAppend = DEFAULT_APPEND;
|
||||||
private boolean fAppendContributedEnv = DEFAULT_APPEND;
|
private boolean fAppendContributedEnv = DEFAULT_APPEND;
|
||||||
|
|
||||||
private Map getMap(){
|
private Map<String, IEnvironmentVariable> getMap(){
|
||||||
if(fVariables == null)
|
if(fVariables == null)
|
||||||
fVariables = new HashMap();
|
fVariables = new HashMap<String, IEnvironmentVariable>();
|
||||||
return fVariables;
|
return fVariables;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,8 +56,11 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
}
|
}
|
||||||
|
|
||||||
public StorableEnvironment(StorableEnvironment env, boolean isReadOnly) {
|
public StorableEnvironment(StorableEnvironment env, boolean isReadOnly) {
|
||||||
if(env.fVariables != null)
|
if(env.fVariables != null) {
|
||||||
fVariables = (HashMap)env.fVariables.clone();
|
@SuppressWarnings("unchecked")
|
||||||
|
final HashMap<String, IEnvironmentVariable> clone = (HashMap<String, IEnvironmentVariable>)env.fVariables.clone();
|
||||||
|
fVariables = clone;
|
||||||
|
}
|
||||||
fAppend = env.fAppend;
|
fAppend = env.fAppend;
|
||||||
fAppendContributedEnv = env.fAppendContributedEnv;
|
fAppendContributedEnv = env.fAppendContributedEnv;
|
||||||
fIsReadOnly = isReadOnly;
|
fIsReadOnly = isReadOnly;
|
||||||
|
@ -94,7 +97,7 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
element.setAttribute(ATTRIBUTE_APPEND, Boolean.valueOf(fAppend).toString());
|
element.setAttribute(ATTRIBUTE_APPEND, Boolean.valueOf(fAppend).toString());
|
||||||
element.setAttribute(ATTRIBUTE_APPEND_CONTRIBUTED, Boolean.valueOf(fAppendContributedEnv).toString());
|
element.setAttribute(ATTRIBUTE_APPEND_CONTRIBUTED, Boolean.valueOf(fAppendContributedEnv).toString());
|
||||||
if(fVariables != null){
|
if(fVariables != null){
|
||||||
Iterator iter = fVariables.values().iterator();
|
Iterator<IEnvironmentVariable> iter = fVariables.values().iterator();
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
StorableEnvVar var = (StorableEnvVar)iter.next();
|
StorableEnvVar var = (StorableEnvVar)iter.next();
|
||||||
ICStorageElement varEl = element.createChild(StorableEnvVar.VARIABLE_ELEMENT_NAME);
|
ICStorageElement varEl = element.createChild(StorableEnvVar.VARIABLE_ELEMENT_NAME);
|
||||||
|
@ -214,7 +217,7 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
if(!provider.isVariableCaseSensitive())
|
if(!provider.isVariableCaseSensitive())
|
||||||
name = name.toUpperCase();
|
name = name.toUpperCase();
|
||||||
|
|
||||||
return (IEnvironmentVariable)getMap().get(name);
|
return getMap().get(name);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setVariales(IEnvironmentVariable vars[]){
|
public void setVariales(IEnvironmentVariable vars[]){
|
||||||
|
@ -224,9 +227,9 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
deleteAll();
|
deleteAll();
|
||||||
else{
|
else{
|
||||||
if (getMap().size() != 0) {
|
if (getMap().size() != 0) {
|
||||||
Iterator iter = getMap().values().iterator();
|
Iterator<IEnvironmentVariable> iter = getMap().values().iterator();
|
||||||
while(iter.hasNext()){
|
while(iter.hasNext()){
|
||||||
IEnvironmentVariable v = (IEnvironmentVariable)iter.next();
|
IEnvironmentVariable v = iter.next();
|
||||||
int i;
|
int i;
|
||||||
for(i = 0 ; i < vars.length; i++){
|
for(i = 0 ; i < vars.length; i++){
|
||||||
if(v.getName().equals(vars[i].getName()))
|
if(v.getName().equals(vars[i].getName()))
|
||||||
|
@ -251,9 +254,9 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnvironmentVariable[] getVariables(){
|
public IEnvironmentVariable[] getVariables(){
|
||||||
Collection vars = getMap().values();
|
Collection<IEnvironmentVariable> vars = getMap().values();
|
||||||
|
|
||||||
return (IEnvironmentVariable[])vars.toArray(new IEnvironmentVariable[vars.size()]);
|
return vars.toArray(new IEnvironmentVariable[vars.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnvironmentVariable deleteVariable(String name){
|
public IEnvironmentVariable deleteVariable(String name){
|
||||||
|
@ -265,7 +268,7 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
if(!provider.isVariableCaseSensitive())
|
if(!provider.isVariableCaseSensitive())
|
||||||
name = name.toUpperCase();
|
name = name.toUpperCase();
|
||||||
|
|
||||||
IEnvironmentVariable var = (IEnvironmentVariable)getMap().remove(name);
|
IEnvironmentVariable var = getMap().remove(name);
|
||||||
if(var != null){
|
if(var != null){
|
||||||
fIsDirty = true;
|
fIsDirty = true;
|
||||||
fIsChanged = true;
|
fIsChanged = true;
|
||||||
|
@ -277,7 +280,7 @@ public class StorableEnvironment /*implements Cloneable*/{
|
||||||
public boolean deleteAll(){
|
public boolean deleteAll(){
|
||||||
if(fIsReadOnly)
|
if(fIsReadOnly)
|
||||||
throw ExceptionFactory.createIsReadOnlyException();
|
throw ExceptionFactory.createIsReadOnlyException();
|
||||||
Map map = getMap();
|
Map<String, IEnvironmentVariable> map = getMap();
|
||||||
if(map.size() > 0){
|
if(map.size() > 0){
|
||||||
fIsDirty = true;
|
fIsDirty = true;
|
||||||
fIsChanged = true;
|
fIsChanged = true;
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2002, 2006 QNX Software Systems and others.
|
* Copyright (c) 2002, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -25,12 +25,12 @@ import org.eclipse.core.runtime.IPath;
|
||||||
*/
|
*/
|
||||||
public class MachOBinaryArchive extends BinaryFile implements IBinaryArchive {
|
public class MachOBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
|
|
||||||
ArrayList children;
|
ArrayList<IBinaryObject> children;
|
||||||
|
|
||||||
public MachOBinaryArchive(IBinaryParser parser, IPath p) throws IOException {
|
public MachOBinaryArchive(IBinaryParser parser, IPath p) throws IOException {
|
||||||
super(parser, p, IBinaryFile.ARCHIVE);
|
super(parser, p, IBinaryFile.ARCHIVE);
|
||||||
new AR(p.toOSString()).dispose(); // check file type
|
new AR(p.toOSString()).dispose(); // check file type
|
||||||
children = new ArrayList(5);
|
children = new ArrayList<IBinaryObject>(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -55,6 +55,6 @@ public class MachOBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
}
|
}
|
||||||
children.trimToSize();
|
children.trimToSize();
|
||||||
}
|
}
|
||||||
return (IBinaryObject[]) children.toArray(new IBinaryObject[0]);
|
return children.toArray(new IBinaryObject[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -245,7 +245,7 @@ public class AR {
|
||||||
if (memberHeaders != null)
|
if (memberHeaders != null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
Vector v = new Vector();
|
Vector<ARHeader> v = new Vector<ARHeader>();
|
||||||
try {
|
try {
|
||||||
//
|
//
|
||||||
// Check for EOF condition
|
// Check for EOF condition
|
||||||
|
@ -269,7 +269,7 @@ public class AR {
|
||||||
}
|
}
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
}
|
}
|
||||||
memberHeaders = (ARHeader[]) v.toArray(new ARHeader[v.size()]);
|
memberHeaders = v.toArray(new ARHeader[v.size()]);
|
||||||
}
|
}
|
||||||
|
|
||||||
public String[] extractFiles(String outdir) throws IOException {
|
public String[] extractFiles(String outdir) throws IOException {
|
||||||
|
@ -277,7 +277,7 @@ public class AR {
|
||||||
}
|
}
|
||||||
|
|
||||||
private String[] extractFiles(String outdir, String[] names) throws IOException {
|
private String[] extractFiles(String outdir, String[] names) throws IOException {
|
||||||
Vector names_used = new Vector();
|
Vector<String> names_used = new Vector<String>();
|
||||||
String object_name;
|
String object_name;
|
||||||
int count;
|
int count;
|
||||||
|
|
||||||
|
@ -301,7 +301,7 @@ public class AR {
|
||||||
rfile.close();
|
rfile.close();
|
||||||
}
|
}
|
||||||
|
|
||||||
return (String[]) names_used.toArray(new String[0]);
|
return names_used.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
|
|
||||||
private boolean stringInStrings(String str, String[] set) {
|
private boolean stringInStrings(String str, String[] set) {
|
||||||
|
|
|
@ -474,12 +474,12 @@ public class SOM {
|
||||||
getRandomAccessFile();
|
getRandomAccessFile();
|
||||||
rfile.seek(offset);
|
rfile.seek(offset);
|
||||||
int numSymbols = getFileHeader().symbol_total;
|
int numSymbols = getFileHeader().symbol_total;
|
||||||
ArrayList symList = new ArrayList(numSymbols);
|
ArrayList<Symbol> symList = new ArrayList<Symbol>(numSymbols);
|
||||||
for (int i = 0; i < numSymbols; ++i) {
|
for (int i = 0; i < numSymbols; ++i) {
|
||||||
Symbol v = new Symbol(rfile);
|
Symbol v = new Symbol(rfile);
|
||||||
symList.add(v);
|
symList.add(v);
|
||||||
}
|
}
|
||||||
symbols = (Symbol[]) symList.toArray(new Symbol[symList.size()]);
|
symbols = symList.toArray(new Symbol[symList.size()]);
|
||||||
}
|
}
|
||||||
return symbols;
|
return symbols;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2006 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
public class SOMBinaryArchive extends BinaryFile implements IBinaryArchive {
|
public class SOMBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
private ArrayList children;
|
private ArrayList<IBinaryObject> children;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parser
|
* @param parser
|
||||||
|
@ -37,7 +37,7 @@ public class SOMBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
public SOMBinaryArchive(IBinaryParser parser, IPath path) throws IOException {
|
public SOMBinaryArchive(IBinaryParser parser, IPath path) throws IOException {
|
||||||
super(parser, path, IBinaryFile.ARCHIVE);
|
super(parser, path, IBinaryFile.ARCHIVE);
|
||||||
new AR(path.toOSString()).dispose(); // check file type
|
new AR(path.toOSString()).dispose(); // check file type
|
||||||
children = new ArrayList(5);
|
children = new ArrayList<IBinaryObject>(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
@ -62,6 +62,6 @@ public class SOMBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
}
|
}
|
||||||
children.trimToSize();
|
children.trimToSize();
|
||||||
}
|
}
|
||||||
return (IBinaryObject[]) children.toArray(new IBinaryObject[0]);
|
return children.toArray(new IBinaryObject[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -29,6 +29,7 @@ import org.eclipse.cdt.utils.BinaryObjectAdapter;
|
||||||
import org.eclipse.cdt.utils.CPPFilt;
|
import org.eclipse.cdt.utils.CPPFilt;
|
||||||
import org.eclipse.cdt.utils.IGnuToolFactory;
|
import org.eclipse.cdt.utils.IGnuToolFactory;
|
||||||
import org.eclipse.cdt.utils.Objdump;
|
import org.eclipse.cdt.utils.Objdump;
|
||||||
|
import org.eclipse.cdt.utils.Symbol;
|
||||||
import org.eclipse.cdt.utils.som.AR;
|
import org.eclipse.cdt.utils.som.AR;
|
||||||
import org.eclipse.cdt.utils.som.SOM;
|
import org.eclipse.cdt.utils.som.SOM;
|
||||||
import org.eclipse.cdt.utils.som.AR.ARHeader;
|
import org.eclipse.cdt.utils.som.AR.ARHeader;
|
||||||
|
@ -182,18 +183,18 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void loadSymbols(SOM som) throws IOException {
|
protected void loadSymbols(SOM som) throws IOException {
|
||||||
ArrayList list = new ArrayList();
|
ArrayList<Symbol> list = new ArrayList<Symbol>();
|
||||||
|
|
||||||
SOM.Symbol[] peSyms = som.getSymbols();
|
SOM.Symbol[] peSyms = som.getSymbols();
|
||||||
byte[] table = som.getStringTable();
|
byte[] table = som.getStringTable();
|
||||||
addSymbols(peSyms, table, list);
|
addSymbols(peSyms, table, list);
|
||||||
|
|
||||||
symbols = (ISymbol[])list.toArray(NO_SYMBOLS);
|
symbols = list.toArray(NO_SYMBOLS);
|
||||||
Arrays.sort(symbols);
|
Arrays.sort(symbols);
|
||||||
list.clear();
|
list.clear();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected void addSymbols(SOM.Symbol[] peSyms, byte[] table, List list) {
|
protected void addSymbols(SOM.Symbol[] peSyms, byte[] table, List<Symbol> list) {
|
||||||
CPPFilt cppfilt = getCPPFilt();
|
CPPFilt cppfilt = getCPPFilt();
|
||||||
Addr2line addr2line = getAddr2line(false);
|
Addr2line addr2line = getAddr2line(false);
|
||||||
for (int i = 0; i < peSyms.length; i++) {
|
for (int i = 0; i < peSyms.length; i++) {
|
||||||
|
@ -313,6 +314,7 @@ public class SOMBinaryObject extends BinaryObjectAdapter {
|
||||||
*
|
*
|
||||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
if (adapter == Addr2line.class) {
|
if (adapter == Addr2line.class) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2000, 2007 QNX Software Systems and others.
|
* Copyright (c) 2000, 2008 QNX Software Systems and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -21,7 +21,7 @@ import java.util.Vector;
|
||||||
|
|
||||||
public class EnvironmentReader {
|
public class EnvironmentReader {
|
||||||
private static Properties envVars = null;
|
private static Properties envVars = null;
|
||||||
private static Vector rawVars = null;
|
private static Vector<String> rawVars = null;
|
||||||
|
|
||||||
public static Properties getEnvVars() {
|
public static Properties getEnvVars() {
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ public class EnvironmentReader {
|
||||||
String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
|
String OS = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
|
||||||
Process p = null;
|
Process p = null;
|
||||||
envVars = new Properties();
|
envVars = new Properties();
|
||||||
rawVars = new Vector(32);
|
rawVars = new Vector<String>(32);
|
||||||
String command = "env"; //$NON-NLS-1$
|
String command = "env"; //$NON-NLS-1$
|
||||||
InputStream in = null;
|
InputStream in = null;
|
||||||
boolean check_ready = false;
|
boolean check_ready = false;
|
||||||
|
@ -123,6 +123,6 @@ public class EnvironmentReader {
|
||||||
|
|
||||||
public static String[] getRawEnvVars() {
|
public static String[] getRawEnvVars() {
|
||||||
getEnvVars();
|
getEnvVars();
|
||||||
return (String[]) rawVars.toArray(new String[0]);
|
return rawVars.toArray(new String[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -647,13 +647,13 @@ public class XCoff32 {
|
||||||
getRandomAccessFile();
|
getRandomAccessFile();
|
||||||
rfile.seek(offset);
|
rfile.seek(offset);
|
||||||
int numSymbols = getFileHeader().f_nsyms;
|
int numSymbols = getFileHeader().f_nsyms;
|
||||||
ArrayList symList = new ArrayList(numSymbols);
|
ArrayList<Symbol> symList = new ArrayList<Symbol>(numSymbols);
|
||||||
for (int i = 0; i < numSymbols; ++i) {
|
for (int i = 0; i < numSymbols; ++i) {
|
||||||
Symbol v = new Symbol(rfile);
|
Symbol v = new Symbol(rfile);
|
||||||
symList.add(v);
|
symList.add(v);
|
||||||
i += v.n_numaux; // account for auxiliary entries
|
i += v.n_numaux; // account for auxiliary entries
|
||||||
}
|
}
|
||||||
symbols = (Symbol[]) symList.toArray(new Symbol[symList.size()]);
|
symbols = symList.toArray(new Symbol[symList.size()]);
|
||||||
}
|
}
|
||||||
return symbols;
|
return symbols;
|
||||||
}
|
}
|
||||||
|
|
|
@ -173,6 +173,7 @@ public class XCOFF32Parser extends AbstractCExtension implements IBinaryParser {
|
||||||
*
|
*
|
||||||
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
* @see org.eclipse.core.runtime.IAdaptable#getAdapter(java.lang.Class)
|
||||||
*/
|
*/
|
||||||
|
@SuppressWarnings("unchecked")
|
||||||
@Override
|
@Override
|
||||||
public Object getAdapter(Class adapter) {
|
public Object getAdapter(Class adapter) {
|
||||||
if (adapter.equals(IGnuToolFactory.class)) {
|
if (adapter.equals(IGnuToolFactory.class)) {
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
/*******************************************************************************
|
/*******************************************************************************
|
||||||
* Copyright (c) 2004, 2006 IBM Corporation and others.
|
* Copyright (c) 2004, 2008 IBM Corporation and others.
|
||||||
* All rights reserved. This program and the accompanying materials
|
* All rights reserved. This program and the accompanying materials
|
||||||
* are made available under the terms of the Eclipse Public License v1.0
|
* are made available under the terms of the Eclipse Public License v1.0
|
||||||
* which accompanies this distribution, and is available at
|
* which accompanies this distribution, and is available at
|
||||||
|
@ -27,7 +27,7 @@ import org.eclipse.core.runtime.IPath;
|
||||||
* @author vhirsl
|
* @author vhirsl
|
||||||
*/
|
*/
|
||||||
public class XCOFFBinaryArchive extends BinaryFile implements IBinaryArchive {
|
public class XCOFFBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
private ArrayList children;
|
private ArrayList<IBinaryObject> children;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param parser
|
* @param parser
|
||||||
|
@ -37,7 +37,7 @@ public class XCOFFBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
public XCOFFBinaryArchive(IBinaryParser parser, IPath path) throws IOException {
|
public XCOFFBinaryArchive(IBinaryParser parser, IPath path) throws IOException {
|
||||||
super(parser, path, IBinaryFile.ARCHIVE);
|
super(parser, path, IBinaryFile.ARCHIVE);
|
||||||
new AR(path.toOSString()).dispose(); // check file type
|
new AR(path.toOSString()).dispose(); // check file type
|
||||||
children = new ArrayList(5);
|
children = new ArrayList<IBinaryObject>(5);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -63,6 +63,6 @@ public class XCOFFBinaryArchive extends BinaryFile implements IBinaryArchive {
|
||||||
}
|
}
|
||||||
children.trimToSize();
|
children.trimToSize();
|
||||||
}
|
}
|
||||||
return (IBinaryObject[]) children.toArray(new IBinaryObject[0]);
|
return children.toArray(new IBinaryObject[0]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -107,9 +107,9 @@ public class LRCPPTests extends AST2CPPTests {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void testBug99262B() throws Exception { // gcc
|
public void testBug240567() throws Exception { // gcc
|
||||||
try {
|
try {
|
||||||
super.testBug99262B();
|
super.testBug240567();
|
||||||
fail();
|
fail();
|
||||||
} catch(AssertionFailedError _) {
|
} catch(AssertionFailedError _) {
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue