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);
56 cprintf(
"%#x %s\n", symbol.address, symbol.name);
58 string symbol = argv[2];
61 if (symbol[0] ==
'0' && symbol[1] ==
'x') {
64 (it = symtab.
find(address)) != symtab.
end()) {
65 cprintf(
"address = %#x, symbol = %s\n", address, it->name);
67 cprintf(
"address = %#x was not found\n", address);
70 auto it = symtab.
find(symbol);
71 if (it != symtab.
end())
72 cprintf(
"symbol = %s address = %#x\n", symbol, it->address);
74 cprintf(
"symbol = %s was not found\n", symbol);
#define panic(...)
This implements a cprintf based panic() function.
ObjectFile * createObjectFile(const std::string &fname, bool raw)
Overload hash function for BasicBlockRange type.
const_iterator end() 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[])
SymbolVector::const_iterator const_iterator
const_iterator find(Addr address) const
void cprintf(const char *format, const Args &...args)