<rdar://problem/11330621>
Fixed the DisassemblerLLVMC disassembler to parse more efficiently instead of parsing opcodes over and over. The InstructionLLVMC class now only reads the opcode in the InstructionLLVMC::Decode function. This can be done very efficiently for ARM and architectures that have fixed opcode sizes. For x64 it still calls the disassembler to get the byte size.
Moved the lldb_private::Instruction::Dump(...) function up into the lldb_private::Instruction class and it now uses the function that gets the mnemonic, operandes and comments so that all disassembly is using the same code.
Added StreamString::FillLastLineToColumn() to allow filling a line up to a column with a character (which is used by the lldb_private::Instruction::Dump(...) function).
Modified the Opcode::GetData() fucntion to "do the right thing" for thumb instructions.
git-svn-id: https://llvm.org/svn/llvm-project/lldb/trunk@156532 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBInstruction.cpp b/source/API/SBInstruction.cpp
index 0adb83e..fa9058b 100644
--- a/source/API/SBInstruction.cpp
+++ b/source/API/SBInstruction.cpp
@@ -82,7 +82,7 @@
target_sp->CalculateExecutionContext (exe_ctx);
exe_ctx.SetProcessSP(target_sp->GetProcessSP());
}
- return m_opaque_sp->GetMnemonic(exe_ctx.GetBestExecutionContextScope());
+ return m_opaque_sp->GetMnemonic(&exe_ctx);
}
return NULL;
}
@@ -101,7 +101,7 @@
target_sp->CalculateExecutionContext (exe_ctx);
exe_ctx.SetProcessSP(target_sp->GetProcessSP());
}
- return m_opaque_sp->GetOperands(exe_ctx.GetBestExecutionContextScope());
+ return m_opaque_sp->GetOperands(&exe_ctx);
}
return NULL;
}
@@ -120,7 +120,7 @@
target_sp->CalculateExecutionContext (exe_ctx);
exe_ctx.SetProcessSP(target_sp->GetProcessSP());
}
- return m_opaque_sp->GetComment(exe_ctx.GetBestExecutionContextScope());
+ return m_opaque_sp->GetComment(&exe_ctx);
}
return NULL;
}
@@ -140,7 +140,7 @@
if (m_opaque_sp)
{
DataExtractorSP data_extractor_sp (new DataExtractor());
- if (m_opaque_sp->GetOpcode().GetData (*data_extractor_sp))
+ if (m_opaque_sp->GetData (*data_extractor_sp))
{
sb_data.SetOpaque (data_extractor_sp);
}
@@ -171,7 +171,7 @@
{
// Use the "ref()" instead of the "get()" accessor in case the SBStream
// didn't have a stream already created, one will get created...
- m_opaque_sp->Dump (&s.ref(), 0, true, false, NULL, false);
+ m_opaque_sp->Dump (&s.ref(), 0, true, false, NULL);
return true;
}
return false;
@@ -186,7 +186,7 @@
if (m_opaque_sp)
{
StreamFile out_stream (out, false);
- m_opaque_sp->Dump (&out_stream, 0, true, false, NULL, false);
+ m_opaque_sp->Dump (&out_stream, 0, true, false, NULL);
}
}