diff options
author | Greg Clayton <gclayton@apple.com> | 2012-05-10 02:52:23 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2012-05-10 02:52:23 +0000 |
commit | ba812f42842530d6f2123fa34ca30e82ad3515cf (patch) | |
tree | 9940cde31aea9b0312d107d4497e876eac71623f /lldb/source/API/SBInstruction.cpp | |
parent | c67f223c9ee4cbfa478a1d6e9cfe5b03c524b4fa (diff) | |
download | bcm5719-llvm-ba812f42842530d6f2123fa34ca30e82ad3515cf.tar.gz bcm5719-llvm-ba812f42842530d6f2123fa34ca30e82ad3515cf.zip |
<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.
llvm-svn: 156532
Diffstat (limited to 'lldb/source/API/SBInstruction.cpp')
-rw-r--r-- | lldb/source/API/SBInstruction.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp index 0adb83e1fd9..fa9058be7b8 100644 --- a/lldb/source/API/SBInstruction.cpp +++ b/lldb/source/API/SBInstruction.cpp @@ -82,7 +82,7 @@ SBInstruction::GetMnemonic(SBTarget target) 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 @@ SBInstruction::GetOperands(SBTarget target) 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 @@ SBInstruction::GetComment(SBTarget target) 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 @@ SBInstruction::GetData (SBTarget target) 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 @@ SBInstruction::GetDescription (lldb::SBStream &s) { // 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 @@ SBInstruction::Print (FILE *out) 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); } } |