getMnemonic() moved to BochsController + Typos fixed.
git-svn-id: https://www4.informatik.uni-erlangen.de/i4svn/danceos/trunk/devel/fail@1307 8c4709b5-6ec9-48aa-a5cd-a96041d1645a
This commit is contained in:
@ -269,14 +269,6 @@ class RegisterManager
|
||||
* @return the base pointer
|
||||
*/
|
||||
virtual address_t getBasePointer() = 0;
|
||||
/**
|
||||
* Retrieves the textual description (mnemoric) for the current
|
||||
* instruction.
|
||||
* The format of the returned string is simulator-specific.
|
||||
* @return the mnemoric of the current instruction whose address
|
||||
* is given by \c getInstructionPointer().
|
||||
*/
|
||||
virtual const std::string& getMnemoric() const = 0;
|
||||
};
|
||||
|
||||
} // end-of-namespace: sal
|
||||
|
||||
@ -170,6 +170,30 @@ class BochsController : public SimulatorController
|
||||
*/
|
||||
void dbgEnableInstrPtrOutput(unsigned regularity, std::ostream* dest = &cout);
|
||||
#endif
|
||||
/* ********************************************************************
|
||||
* BochsController-specific (not implemented in SimulatorController!):
|
||||
* ********************************************************************/
|
||||
/**
|
||||
* Retrieves the textual description (mnemonic) for the current
|
||||
* instruction. The format of the returned string is Bochs-specific.
|
||||
* @return the mnemonic of the current instruction whose address
|
||||
* is given by \c Register::getInstructionPointer(). On
|
||||
* errors, the returned string is empty
|
||||
*/
|
||||
const std::string& getMnemonic() const
|
||||
{
|
||||
static std::string str;
|
||||
bxICacheEntry_c* pEntry = BX_CPU(0)->getICacheEntry();
|
||||
assert(pEntry != NULL && "FATAL ERROR: Bochs internal function returned NULL (not expected)!");
|
||||
bxInstruction_c* pInstr = pEntry->i;
|
||||
assert(pInstr != NULL && "FATAL ERROR: Bochs internal member was NULL (not expected)!");
|
||||
const char* pszName = get_bx_opcode_name(pInstr->getIaOpcode());
|
||||
if (pszName != NULL)
|
||||
str = pszName;
|
||||
else
|
||||
str.clear();
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
} // end-of-namespace: sal
|
||||
|
||||
@ -38,7 +38,7 @@ class BochsRegister : public Register
|
||||
* Sets the content of the register.
|
||||
* @param data the new register data to be written
|
||||
*/
|
||||
virtual void setData(regdata_t data) { *m_pData = data; }
|
||||
void setData(regdata_t data) { *m_pData = data; }
|
||||
};
|
||||
|
||||
/**
|
||||
@ -239,27 +239,6 @@ class BochsRegisterManager : public RegisterManager
|
||||
return (static_cast<address_t>(getRegister(RID_EBP)->getData()));
|
||||
#endif
|
||||
}
|
||||
/**
|
||||
* Retrieves the textual description (mnemoric) for the current
|
||||
* instruction. The format of the returned string is Bochs-specific.
|
||||
* @return the mnemoric of the current instruction whose address
|
||||
* is given by \c getInstructionPointer(). On errors, the
|
||||
* returned string is empty
|
||||
*/
|
||||
const std::string& getMnemoric() const
|
||||
{
|
||||
static std::string str;
|
||||
bxICacheEntry_c* pEntry = BX_CPU(0)->getICacheEntry();
|
||||
assert(pEntry != NULL && "FATAL ERROR: Bochs internal function returned NULL (not expected)!");
|
||||
bxInstruction_c* pInstr = pEntry->i;
|
||||
assert(pInstr != NULL && "FATAL ERROR: Bochs internal member was NULL (not expected)!");
|
||||
const char* pszName = get_bx_opcode_name(pInstr->getIaOpcode());
|
||||
if (pszName != NULL)
|
||||
str = pszName;
|
||||
else
|
||||
str.clear();
|
||||
return str;
|
||||
}
|
||||
};
|
||||
|
||||
} // end-of-namespace: sal
|
||||
|
||||
Reference in New Issue
Block a user