1
0
Fork 0
mirror of https://github.com/eclipse-cdt/cdt synced 2025-04-29 19:45:01 +02:00

Do not load the symbols right away

This commit is contained in:
Alain Magloire 2003-11-19 17:37:32 +00:00
parent f9e69cf8c7
commit 93d0a3cccf
2 changed files with 28 additions and 6 deletions

View file

@ -169,9 +169,18 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
protected PE.Attribute getAttribute() {
if (hasChanged()) {
PE pe = null;
try {
loadInformation();
pe = getPE();
loadAttributes(pe);
} catch (IOException e) {
} finally {
if (pe != null) {
try {
pe.dispose();
} catch (IOException e1) {
}
}
}
}
return attribute;
@ -184,11 +193,11 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
}
private void loadInformation(PE pe) throws IOException {
loadAttribute(pe);
loadAttributes(pe);
loadSymbols(pe);
}
private void loadAttribute(PE pe) throws IOException {
private void loadAttributes(PE pe) throws IOException {
attribute = pe.getAttribute();
}

View file

@ -169,9 +169,15 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
protected Attribute getAttribute() {
if (hasChanged()) {
ElfHelper helper = null;
try {
loadInformation();
helper = getElfHelper();
loadAttributes(helper);
} catch (IOException e) {
} finally {
if (helper != null) {
helper.dispose();
}
}
}
return attribute;
@ -179,9 +185,15 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
protected Sizes getSizes() {
if (hasChanged()) {
ElfHelper helper = null;
try {
loadInformation();
helper = getElfHelper();
loadAttributes(helper);
} catch (IOException e) {
} finally {
if (helper != null) {
helper.dispose();
}
}
}
return sizes;
@ -263,7 +275,8 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
if (addr2line != null) {
try {
String filename = addr2line.getFileName(sym.addr);
sym.filename = (filename != null) ? new Path(filename) : null;
// Addr2line returns the funny "??" when it can not find the file.
sym.filename = (filename != null && !filename.equals("??")) ? new Path(filename) : null;
sym.startLine = addr2line.getLineNumber(sym.addr);
sym.endLine = addr2line.getLineNumber(sym.addr + array[i].st_size - 1);
} catch (IOException e) {