39 char *copy =
avr_new(
char, s.length() + 1);
40 unsigned int retval = 0;
41 unsigned int convlen = 0;
43 strcpy(copy, s.c_str());
44 retval = strtoul(copy, &dummy, 16);
45 convlen = (
unsigned int)(dummy - copy);
48 if((retval != 0) && ((
unsigned int)s.length() == convlen)) {
54 multimap<unsigned int, string>::iterator ii;
56 for(ii = sym.begin(); ii != sym.end(); ii++) {
62 avr_error(
"symbol '%s' not found!", s.c_str());
69 unsigned int lastAddr = 0;
70 multimap<unsigned int, string>::iterator ii;
71 multimap<unsigned int, string>::iterator last_ii;
78 if(lastAddr != ii->first) {
80 lastName = ii->second;
87 if((ii != sym.end()) && (ii->first > add))
89 }
while(ii != sym.end());
95 while((++ii) != sym.end()) {
96 if(lastAddr != ii->first)
98 os <<
"," << ii->second;
101 unsigned int offset = add - lastAddr;
103 os <<
"+0x" << hex << offset;
std::string GetSymbolAtAddress(unsigned int add)
void avr_free(void *ptr)
Free malloc'd memory.
#define avr_new(type, count)
Macro for allocating memory.
unsigned int GetAddressAtSymbol(const std::string &s)