From 25d61ac2ed3f3bfad00d43b1ca94b1a32649cf0a Mon Sep 17 00:00:00 2001 From: Caroline Tice Date: Fri, 8 Apr 2011 23:33:06 +0000 Subject: 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 --- lldb/source/API/SBInstruction.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'lldb/source/API/SBInstruction.cpp') diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index e46e8696ed0..a4ab1558fd0 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -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; } -- cgit v1.2.3