Code for searching for the _end symbol to facilitate stack monitoring ui

This commit is contained in:
Adam Dunkels 2013-01-07 14:38:05 +01:00
parent 5df8763ecf
commit 25855fe2fe
1 changed files with 10 additions and 0 deletions

View File

@ -383,6 +383,7 @@ public class ELF {
public MapTable getMap() {
MapTable map = new MapTable();
int sAddrHighest = -1;
ELFSection name = sections[symTable.link];
int len = symTable.size;
@ -426,6 +427,10 @@ public class ELF {
if (sAddr > 0 && sAddr < 0x100000) {
String symbolName = sn;
if (sAddr < 0x5c00 && sAddr > sAddrHighest) {
sAddrHighest = sAddr;
}
// if (bind == ELFSection.SYMBIND_LOCAL) {
// symbolName += " (" + currentFile + ')';
// }
@ -460,6 +465,11 @@ public class ELF {
addr += symTable.getEntrySize();
}
if (sAddrHighest > 0) {
System.out.printf("Warning: Unable to parse _end symbol. I'm guessing that heap starts at 0x%05x\n", sAddrHighest);
map.setHeapStart(sAddrHighest);
}
return map;
}