Fix various things in the instruction emulation code:

- Add ability to control whether or not the emulator advances the
    PC register (in the emulation state), if the instruction itself
    does not change the pc value..

    - Fix a few typos in asm description strings.

    - Fix bug in the carry flag calculation.

llvm-svn: 129168
This commit is contained in:
Caroline Tice
2011-04-08 23:33:06 +00:00
parent e094ee0a34
commit 25d61ac2ed
7 changed files with 69 additions and 17 deletions

View File

@@ -116,7 +116,7 @@ SBInstruction::Print (FILE *out)
}
bool
SBInstruction::EmulateWithFrame (lldb::SBFrame &frame)
SBInstruction::EmulateWithFrame (lldb::SBFrame &frame, bool auto_advance_pc)
{
if (m_opaque_sp && frame.get())
{
@@ -126,6 +126,7 @@ SBInstruction::EmulateWithFrame (lldb::SBFrame &frame)
lldb_private::ArchSpec arch = target->GetArchitecture();
return m_opaque_sp->Emulate (arch,
auto_advance_pc,
(void *) frame.get(),
&lldb_private::EmulateInstruction::ReadMemoryFrame,
&lldb_private::EmulateInstruction::WriteMemoryFrame,
@@ -142,12 +143,8 @@ SBInstruction::DumpEmulation (const char *triple)
{
lldb_private::ArchSpec arch (triple, NULL);
return m_opaque_sp->Emulate (arch,
NULL,
&lldb_private::EmulateInstruction::ReadMemoryDefault,
&lldb_private::EmulateInstruction::WriteMemoryDefault,
&lldb_private::EmulateInstruction::ReadRegisterDefault,
&lldb_private::EmulateInstruction::WriteRegisterDefault);
return m_opaque_sp->DumpEmulation (arch);
}
return false;
}