summaryrefslogtreecommitdiff
path: root/src/arch/arm/insts/static_inst.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2009-06-27 00:29:30 -0700
committerGabe Black <gblack@eecs.umich.edu>2009-06-27 00:29:30 -0700
commit56f1845471231f6b063a912c79c38e63cfbd7d59 (patch)
tree5648cc08a6751361fd94acfc12126ebc8ba6cee6 /src/arch/arm/insts/static_inst.cc
parenta4ac3fad7a9a6c48fdde3d42e35b113bbd03eacf (diff)
downloadgem5-56f1845471231f6b063a912c79c38e63cfbd7d59.tar.xz
ARM: Show branch targets relative to the nearest symbol.
Diffstat (limited to 'src/arch/arm/insts/static_inst.cc')
-rw-r--r--src/arch/arm/insts/static_inst.cc18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/arch/arm/insts/static_inst.cc b/src/arch/arm/insts/static_inst.cc
index 6b641d8bb..a76dbd69c 100644
--- a/src/arch/arm/insts/static_inst.cc
+++ b/src/arch/arm/insts/static_inst.cc
@@ -29,6 +29,7 @@
#include "arch/arm/insts/static_inst.hh"
#include "base/condcodes.hh"
+#include "base/loader/symtab.hh"
namespace ArmISA
{
@@ -309,6 +310,23 @@ ArmStaticInst::printMnemonic(std::ostream &os,
}
}
+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