mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-29 19:45:01 +02:00
Implement ISymbol.getSize().
This commit is contained in:
parent
7e143fdba9
commit
7a06b48359
3 changed files with 22 additions and 2 deletions
|
@ -1,3 +1,10 @@
|
|||
2004-01-09 Alain Magloire
|
||||
|
||||
* utils/org/eclipse/cdt/utils/coff/parser/BinaryObject.java
|
||||
Fix bug in finding the symbols.
|
||||
* utils/org/eclipse/cdt/utils/coff/parser/Symbol.java
|
||||
Implement ISymbol.java
|
||||
|
||||
2004-01-09 Alain Magloire
|
||||
|
||||
* src/org/eclipse/cdt/core/IBinaryParser.java
|
||||
|
|
|
@ -59,14 +59,19 @@ public class BinaryObject extends BinaryFile implements IBinaryObject {
|
|||
public ISymbol getSymbol(long addr) {
|
||||
ISymbol[] syms = getSymbols();
|
||||
int insertion = Arrays.binarySearch(syms, new Long(addr));
|
||||
if (insertion > 0) {
|
||||
if (insertion >= 0) {
|
||||
return syms[insertion];
|
||||
}
|
||||
if (insertion == -1) {
|
||||
return null;
|
||||
}
|
||||
insertion = -insertion - 1;
|
||||
return syms[insertion - 1];
|
||||
ISymbol symbol = syms[insertion - 1];
|
||||
if (addr < (symbol.getAddress() + symbol.getSize())) {
|
||||
return syms[insertion - 1];
|
||||
}
|
||||
return null;
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -26,6 +26,7 @@ public class Symbol implements ISymbol {
|
|||
public int startLine;
|
||||
public int endLine;
|
||||
public long addr;
|
||||
public long size;
|
||||
public String name;
|
||||
public int type;
|
||||
|
||||
|
@ -108,6 +109,13 @@ public class Symbol implements ISymbol {
|
|||
return (thisVal < anotherVal ? -1 : (thisVal == anotherVal ? 0 : 1));
|
||||
}
|
||||
|
||||
/* (non-Javadoc)
|
||||
* @see org.eclipse.cdt.core.IBinaryParser.ISymbol#getSize()
|
||||
*/
|
||||
public long getSize() {
|
||||
return size;
|
||||
}
|
||||
|
||||
synchronized Addr2line startAddr2Line () {
|
||||
if (addr2line == null) {
|
||||
addr2line = binary.getAddr2Line();
|
||||
|
|
Loading…
Add table
Reference in a new issue