std::stringstream ss;
printMnemonic(ss);
+ ss << "\t";
Addr target = pc + 8 + disp;
-
- std::string str;
- if (symtab && symtab->findSymbol(target, str))
- ss << str;
- else
- ccprintf(ss, "0x%x", target);
+ ccprintf(ss, "%#x", target);
+ printMemSymbol(ss, symtab, " <", target, ">");
return ss.str();
}
#include "arch/arm/insts/static_inst.hh"
#include "base/condcodes.hh"
+#include "base/loader/symtab.hh"
namespace ArmISA
{
}
}
+void
+ArmStaticInst::printMemSymbol(std::ostream &os,
+ const SymbolTable *symtab,
+ const std::string &prefix,
+ const Addr addr,
+ const std::string &suffix) const
+{
+ Addr symbolAddr;
+ std::string symbol;
+ if (symtab && symtab->findNearestSymbol(addr, symbol, symbolAddr)) {
+ ccprintf(os, "%s%s", prefix, symbol);
+ if (symbolAddr != addr)
+ ccprintf(os, "+%d", addr - symbolAddr);
+ ccprintf(os, suffix);
+ }
+}
+
std::string
ArmStaticInst::generateDisassembly(Addr pc,
const SymbolTable *symtab) const
void printMnemonic(std::ostream &os,
const std::string &suffix = "",
bool withPred = true) const;
+ void printMemSymbol(std::ostream &os, const SymbolTable *symtab,
+ const std::string &prefix, const Addr addr,
+ const std::string &suffix) const;
+
std::string generateDisassembly(Addr pc, const SymbolTable *symtab) const;
};