1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-06-30 21:55:31 +02:00

minor tweaks bin obj

Change-Id: Ib2a5463bc71f05358a137c1c2bb547fd5577e8e9
This commit is contained in:
Alena Laskavaia 2015-11-05 09:18:58 -05:00 committed by Gerrit Code Review @ Eclipse.org
parent 67f78c8094
commit 75aa6665a0
3 changed files with 35 additions and 15 deletions

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<component id="org.eclipse.cdt.core" version="2">
<resource path="utils/org/eclipse/cdt/utils/BinaryObjectAdapter.java" type="org.eclipse.cdt.utils.BinaryObjectAdapter">
<filter comment="NO_SYMBOLS array should be final" id="388100214">
<message_arguments>
<message_argument value="org.eclipse.cdt.utils.BinaryObjectAdapter"/>
<message_argument value="NO_SYMBOLS"/>
</message_arguments>
</filter>
<filter comment="NO_SYMBOLS array should be static" id="388108357">
<message_arguments>
<message_argument value="org.eclipse.cdt.utils.BinaryObjectAdapter"/>
<message_argument value="NO_SYMBOLS"/>
</message_arguments>
</filter>
</resource>
</component>

View file

@ -23,7 +23,7 @@ import org.eclipse.core.runtime.IPath;
*/
public abstract class BinaryObjectAdapter extends BinaryFile implements IBinaryObject {
protected ISymbol[] NO_SYMBOLS = new ISymbol[0];
protected static final ISymbol[] NO_SYMBOLS = new ISymbol[0];
public class BinaryObjectInfo {
public long bss;

View file

@ -37,7 +37,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
private Addr2line symbolLoadingAddr2line;
private CPPFilt symbolLoadingCPPFilt;
long starttime;
/**
* @param parser
* @param path
@ -103,7 +103,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
}
return null;
}
protected CPPFilt getCPPFilt() {
IGnuToolFactory factory = getBinaryParser().getAdapter(IGnuToolFactory.class);
if (factory != null) {
@ -143,7 +143,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
return stream;
}
/* (non-Javadoc)
* @see org.eclipse.cdt.utils.elf.parser.ElfBinaryObject#loadSymbols(org.eclipse.cdt.utils.elf.ElfHelper)
*/
@ -151,20 +151,23 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
protected void loadSymbols(ElfHelper helper) throws IOException {
symbolLoadingAddr2line = getAddr2line(false);
symbolLoadingCPPFilt = getCPPFilt();
super.loadSymbols(helper);
if (symbolLoadingAddr2line != null) {
symbolLoadingAddr2line.dispose();
symbolLoadingAddr2line = null;
}
if (symbolLoadingCPPFilt != null) {
symbolLoadingCPPFilt.dispose();
symbolLoadingCPPFilt = null;
try {
super.loadSymbols(helper);
} finally {
if (symbolLoadingAddr2line != null) {
symbolLoadingAddr2line.dispose();
symbolLoadingAddr2line = null;
}
if (symbolLoadingCPPFilt != null) {
symbolLoadingCPPFilt.dispose();
symbolLoadingCPPFilt = null;
}
}
}
/*
* (non-Javadoc)
*
*
* @see org.eclipse.cdt.utils.elf.parser.ElfBinaryObject#addSymbols(org.eclipse.cdt.utils.elf.Elf.Symbol[],
* int, java.util.List)
*/
@ -205,7 +208,7 @@ public class GNUElfBinaryObject extends ElfBinaryObject {
/*
* (non-Javadoc)
*
*
* @see org.eclipse.core.runtime.PlatformObject#getAdapter(java.lang.Class)
*/
@SuppressWarnings("rawtypes")