diff options
author | Mitchell Hayenga <Mitchell.Hayenga@ARM.com> | 2014-04-23 05:18:20 -0400 |
---|---|---|
committer | Mitchell Hayenga <Mitchell.Hayenga@ARM.com> | 2014-04-23 05:18:20 -0400 |
commit | 0fad0c7f7dbb91b693805f94f1cf4040590491a0 (patch) | |
tree | 601b8ebaec27c9ae5f619b54e9d1440485a0b457 /src/arch/arm/isa/formats/unimp.isa | |
parent | 84f8fe637cbf15c403f39aaa10c0ea66ace6083d (diff) | |
download | gem5-0fad0c7f7dbb91b693805f94f1cf4040590491a0.tar.xz |
arm: Don't use a stack allocated mnemonic
FailUnimplemented passed a stack created mnemonic as a const char * which
causes some grief when the stack goes away.
Diffstat (limited to 'src/arch/arm/isa/formats/unimp.isa')
-rw-r--r-- | src/arch/arm/isa/formats/unimp.isa | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/src/arch/arm/isa/formats/unimp.isa b/src/arch/arm/isa/formats/unimp.isa index 8e346112c..393a210cb 100644 --- a/src/arch/arm/isa/formats/unimp.isa +++ b/src/arch/arm/isa/formats/unimp.isa @@ -56,6 +56,10 @@ output header {{ class FailUnimplemented : public ArmStaticInst { public: + /// Full mnemonic for MRC and MCR instructions including the + /// coproc. register name + std::string fullMnemonic; + /// Constructor FailUnimplemented(const char *_mnemonic, ExtMachInst _machInst) : ArmStaticInst(_mnemonic, _machInst, No_OpClass) @@ -65,6 +69,16 @@ output header {{ flags[IsNonSpeculative] = true; } + FailUnimplemented(const char *_mnemonic, ExtMachInst _machInst, + const std::string& _fullMnemonic) + : ArmStaticInst(_mnemonic, _machInst, No_OpClass), + fullMnemonic(_fullMnemonic) + { + // don't call execute() (which panics) if we're on a + // speculative path + flags[IsNonSpeculative] = true; + } + %(BasicExecDeclare)s std::string @@ -137,14 +151,16 @@ output decoder {{ FailUnimplemented::generateDisassembly(Addr pc, const SymbolTable *symtab) const { - return csprintf("%-10s (unimplemented)", mnemonic); + return csprintf("%-10s (unimplemented)", + fullMnemonic.size() ? fullMnemonic.c_str() : mnemonic); } std::string WarnUnimplemented::generateDisassembly(Addr pc, const SymbolTable *symtab) const { - return csprintf("%-10s (unimplemented)", mnemonic); + return csprintf("%-10s (unimplemented)", + fullMnemonic.size() ? fullMnemonic.c_str() : mnemonic); } std::string |