41 main(
int argc,
char *argv[])
43 if (argc != 2 && argc != 3)
44 panic(
"usage: %s <filename> <symbol>\n", argv[0]);
48 panic(
"file not found\n");
51 obj->loadGlobalSymbols(&symtab);
52 obj->loadLocalSymbols(&symtab);
55 Loader::SymbolTable::ATable::const_iterator
i =
57 Loader::SymbolTable::ATable::const_iterator 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);
bool findAddress(const std::string &symbol, Addr &address) const
#define panic(...)
This implements a cprintf based panic() function.
ObjectFile * createObjectFile(const std::string &fname, bool raw)
bool findSymbol(Addr address, std::string &symbol) const
Overload hash function for BasicBlockRange type.
const ATable & getAddrTable() const
bool to_number(const std::string &value, VecPredRegContainer< NumBits, Packed > &p)
Helper functions used for serialization/de-serialization.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
int main(int argc, char *argv[])
void cprintf(const char *format, const Args &...args)