Fixed the public and internal disassembler API to be named correctly:
const char *
SBInstruction::GetMnemonic()
const char *
SBInstruction::GetOperands()
const char *
SBInstruction::GetComment()
Fixed the symbolicate example script and the internals.
llvm-svn: 140591
diff --git a/lldb/examples/python/symbolicate-crash.py b/lldb/examples/python/symbolicate-crash.py
index 9e614de..6afd9e1 100755
--- a/lldb/examples/python/symbolicate-crash.py
+++ b/lldb/examples/python/symbolicate-crash.py
@@ -236,11 +236,11 @@
inst_pc = inst.GetAddress().GetLoadAddress(target);
if pc == inst_pc:
pc_index = inst_idx
- opcode_name = inst.GetOpcodeName(target)
- mnemonics = inst.GetMnemonics(target)
- comment = inst.GetComment(target)
- #data = inst.GetData(target)
- lines.append ("%#16.16x: %8s %s" % (inst_pc, opcode_name, mnemonics))
+ mnemonic = inst.GetMnemonic (target)
+ operands = inst.GetOperands (target)
+ comment = inst.GetComment (target)
+ #data = inst.GetData (target)
+ lines.append ("%#16.16x: %8s %s" % (inst_pc, mnemonic, operands))
if comment:
line_len = len(lines[-1])
if line_len < comment_column:
diff --git a/lldb/include/lldb/API/SBInstruction.h b/lldb/include/lldb/API/SBInstruction.h
index 2893ea6..420e869 100644
--- a/lldb/include/lldb/API/SBInstruction.h
+++ b/lldb/include/lldb/API/SBInstruction.h
@@ -42,10 +42,10 @@
GetAddress();
const char *
- GetOpcodeName (lldb::SBTarget target);
+ GetMnemonic (lldb::SBTarget target);
const char *
- GetMnemonics (lldb::SBTarget target);
+ GetOperands (lldb::SBTarget target);
const char *
GetComment (lldb::SBTarget target);
diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h
index fb031d0..f84e9b0 100644
--- a/lldb/include/lldb/Core/Disassembler.h
+++ b/lldb/include/lldb/Core/Disassembler.h
@@ -42,17 +42,17 @@
}
const char *
- GetOpcodeName (ExecutionContextScope *exe_scope)
+ GetMnemonic (ExecutionContextScope *exe_scope)
{
if (m_opcode_name.empty())
- CalculateOpcodeName(exe_scope);
+ CalculateMnemonic(exe_scope);
return m_opcode_name.c_str();
}
const char *
- GetMnemonics (ExecutionContextScope *exe_scope)
+ GetOperands (ExecutionContextScope *exe_scope)
{
if (m_mnemocics.empty())
- CalculateMnemonics(exe_scope);
+ CalculateOperands(exe_scope);
return m_mnemocics.c_str();
}
@@ -65,10 +65,10 @@
}
virtual void
- CalculateOpcodeName (ExecutionContextScope *exe_scope) = 0;
+ CalculateMnemonic (ExecutionContextScope *exe_scope) = 0;
virtual void
- CalculateMnemonics (ExecutionContextScope *exe_scope) = 0;
+ CalculateOperands (ExecutionContextScope *exe_scope) = 0;
virtual void
CalculateComment (ExecutionContextScope *exe_scope) = 0;
@@ -199,13 +199,13 @@
DoesBranch () const;
virtual void
- CalculateOpcodeName(ExecutionContextScope *exe_scope)
+ CalculateMnemonic(ExecutionContextScope *exe_scope)
{
// TODO: fill this in and put opcode name into Instruction::m_opcode_name
}
virtual void
- CalculateMnemonics(ExecutionContextScope *exe_scope)
+ CalculateOperands(ExecutionContextScope *exe_scope)
{
// TODO: fill this in and put opcode name into Instruction::m_mnemonics
}
diff --git a/lldb/scripts/Python/interface/SBInstruction.i b/lldb/scripts/Python/interface/SBInstruction.i
index cf82ad9..7be6e91 100644
--- a/lldb/scripts/Python/interface/SBInstruction.i
+++ b/lldb/scripts/Python/interface/SBInstruction.i
@@ -31,10 +31,10 @@
GetAddress();
const char *
- GetOpcodeName (lldb::SBTarget target);
+ GetMnemonic (lldb::SBTarget target);
const char *
- GetMnemonics (lldb::SBTarget target);
+ GetOperands (lldb::SBTarget target);
const char *
GetComment (lldb::SBTarget target);
diff --git a/lldb/source/API/SBInstruction.cpp b/lldb/source/API/SBInstruction.cpp
index d708aa0..26f8d1a 100644
--- a/lldb/source/API/SBInstruction.cpp
+++ b/lldb/source/API/SBInstruction.cpp
@@ -69,7 +69,7 @@
}
const char *
-SBInstruction::GetOpcodeName(SBTarget target)
+SBInstruction::GetMnemonic(SBTarget target)
{
if (m_opaque_sp)
{
@@ -81,13 +81,13 @@
target->CalculateExecutionContext (exe_ctx);
exe_ctx.SetProcessSP(target->GetProcessSP());
}
- return m_opaque_sp->GetOpcodeName(exe_ctx.GetBestExecutionContextScope());
+ return m_opaque_sp->GetMnemonic(exe_ctx.GetBestExecutionContextScope());
}
return NULL;
}
const char *
-SBInstruction::GetMnemonics(SBTarget target)
+SBInstruction::GetOperands(SBTarget target)
{
if (m_opaque_sp)
{
@@ -99,7 +99,7 @@
target->CalculateExecutionContext (exe_ctx);
exe_ctx.SetProcessSP(target->GetProcessSP());
}
- return m_opaque_sp->GetMnemonics(exe_ctx.GetBestExecutionContextScope());
+ return m_opaque_sp->GetOperands(exe_ctx.GetBestExecutionContextScope());
}
return NULL;
}
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
index 610271d..97831ea 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.cpp
@@ -430,7 +430,7 @@
}
void
-InstructionLLVM::CalculateOpcodeName (ExecutionContextScope *exe_scope)
+InstructionLLVM::CalculateMnemonic (ExecutionContextScope *exe_scope)
{
const int num_tokens = EDNumTokens(m_inst);
if (num_tokens > 0)
@@ -554,17 +554,17 @@
}
void
-InstructionLLVM::CalculateMnemonics(ExecutionContextScope *exe_scope)
+InstructionLLVM::CalculateOperands(ExecutionContextScope *exe_scope)
{
- // Do all of the work in CalculateOpcodeName()
- CalculateOpcodeName (exe_scope);
+ // Do all of the work in CalculateMnemonic()
+ CalculateMnemonic (exe_scope);
}
void
InstructionLLVM::CalculateComment(ExecutionContextScope *exe_scope)
{
- // Do all of the work in CalculateOpcodeName()
- CalculateOpcodeName (exe_scope);
+ // Do all of the work in CalculateMnemonic()
+ CalculateMnemonic (exe_scope);
}
bool
diff --git a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
index b9ab490..73a117d 100644
--- a/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
+++ b/lldb/source/Plugins/Disassembler/llvm/DisassemblerLLVM.h
@@ -44,10 +44,10 @@
uint32_t data_offset);
virtual void
- CalculateOpcodeName (lldb_private::ExecutionContextScope *exe_scope);
+ CalculateMnemonic (lldb_private::ExecutionContextScope *exe_scope);
virtual void
- CalculateMnemonics (lldb_private::ExecutionContextScope *exe_scope);
+ CalculateOperands (lldb_private::ExecutionContextScope *exe_scope);
virtual void
CalculateComment (lldb_private::ExecutionContextScope *exe_scope);