Cleaned up the Disassembler code a bit more. You can now request a disassembler
plugin by name on the command line for when there is more than one disassembler
plugin.
Taught the Opcode class to dump itself so that "disassembler -b" will dump
the bytes correctly for each opcode type. Modified all places that were passing
the opcode bytes buffer in so that the bytes could be displayed to just pass
in a bool that indicates if we should dump the opcode bytes since the opcode
now lives inside llvm_private::Instruction.
git-svn-id: https://llvm.org/svn/llvm-project/llvdb/trunk@128290 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/source/API/SBFunction.cpp b/source/API/SBFunction.cpp
index c8ce1c3..de9f6ae 100644
--- a/source/API/SBFunction.cpp
+++ b/source/API/SBFunction.cpp
@@ -137,6 +137,7 @@
if (module)
{
sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module->GetArchitecture(),
+ NULL,
exe_ctx,
m_opaque_ptr->GetAddressRange()));
}
diff --git a/source/API/SBInstruction.cpp b/source/API/SBInstruction.cpp
index df3a753..48b2e73 100644
--- a/source/API/SBInstruction.cpp
+++ b/source/API/SBInstruction.cpp
@@ -64,7 +64,7 @@
SBInstruction::GetByteSize ()
{
if (m_opaque_sp)
- return m_opaque_sp->GetByteSize();
+ return m_opaque_sp->GetOpcode().GetByteSize();
return 0;
}
@@ -89,7 +89,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(), true, NULL, 0, NULL, false);
+ m_opaque_sp->Dump (&s.ref(), true, false, NULL, false);
return true;
}
return false;
@@ -104,6 +104,6 @@
if (m_opaque_sp)
{
StreamFile out_stream (out, false);
- m_opaque_sp->Dump (&out_stream, true, NULL, 0, NULL, false);
+ m_opaque_sp->Dump (&out_stream, true, false, NULL, false);
}
}
diff --git a/source/API/SBInstructionList.cpp b/source/API/SBInstructionList.cpp
index ce70d95..37c7f87 100644
--- a/source/API/SBInstructionList.cpp
+++ b/source/API/SBInstructionList.cpp
@@ -98,7 +98,7 @@
Instruction *inst = m_opaque_sp->GetInstructionList().GetInstructionAtIndex (i).get();
if (inst == NULL)
break;
- inst->Dump (&sref, true, NULL, 0, NULL, false);
+ inst->Dump (&sref, true, false, NULL, false);
sref.EOL();
}
return true;
diff --git a/source/API/SBSymbol.cpp b/source/API/SBSymbol.cpp
index 96a5a21..ef8af55 100644
--- a/source/API/SBSymbol.cpp
+++ b/source/API/SBSymbol.cpp
@@ -134,6 +134,7 @@
if (module)
{
sb_instructions.SetDisassembler (Disassembler::DisassembleRange (module->GetArchitecture (),
+ NULL,
exe_ctx,
*symbol_range));
}