43 main(
int argc,
char *argv[])
45 if (argc != 2 && argc != 3)
46 panic(
"usage: %s <filename> <symbol>\n", argv[0]);
50 panic(
"file not found\n");
57 SymbolTable::ATable::const_iterator
i = symtab.
getAddrTable().begin();
58 SymbolTable::ATable::const_iterator end = symtab.
getAddrTable().end();
60 cprintf(
"%#x %s\n", i->first, i->second);
64 string symbol = argv[2];
67 if (symbol[0] ==
'0' && symbol[1] ==
'x') {
70 cprintf(
"address = %#x, symbol = %s\n", address, symbol);
72 cprintf(
"address = %#x was not found\n", address);
75 cprintf(
"symbol = %s address = %#x\n", symbol, address);
77 cprintf(
"symbol = %s was not found\n", symbol);
virtual bool loadGlobalSymbols(SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)=0
bool findAddress(const std::string &symbol, Addr &address) const
virtual bool loadLocalSymbols(SymbolTable *symtab, Addr base=0, Addr offset=0, Addr mask=maxAddr)=0
const ATable & getAddrTable() const
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int main(int argc, char *argv[])
ObjectFile * createObjectFile(const string &fname, bool raw)
bool findSymbol(Addr address, std::string &symbol) const
bool to_number(const std::string &value, Pixel &retval)
void cprintf(const char *format, const Args &...args)