mirror of
https://github.com/llvm/llvm-project.git
synced 2025-04-25 20:56:06 +00:00
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
This commit is contained in:
parent
581243919d
commit
fb0655ef59
@ -236,11 +236,11 @@ def disassemble_instructions (target, instructions, pc, insts_before_pc, insts_a
|
||||
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:
|
||||
|
@ -42,10 +42,10 @@ public:
|
||||
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);
|
||||
|
@ -42,17 +42,17 @@ public:
|
||||
}
|
||||
|
||||
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 @@ public:
|
||||
}
|
||||
|
||||
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 @@ public:
|
||||
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
|
||||
}
|
||||
|
@ -31,10 +31,10 @@ public:
|
||||
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);
|
||||
|
@ -69,7 +69,7 @@ SBInstruction::GetAddress()
|
||||
}
|
||||
|
||||
const char *
|
||||
SBInstruction::GetOpcodeName(SBTarget target)
|
||||
SBInstruction::GetMnemonic(SBTarget target)
|
||||
{
|
||||
if (m_opaque_sp)
|
||||
{
|
||||
@ -81,13 +81,13 @@ SBInstruction::GetOpcodeName(SBTarget target)
|
||||
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 @@ SBInstruction::GetMnemonics(SBTarget target)
|
||||
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;
|
||||
}
|
||||
|
@ -430,7 +430,7 @@ InstructionLLVM::Dump
|
||||
}
|
||||
|
||||
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 @@ InstructionLLVM::CalculateOpcodeName (ExecutionContextScope *exe_scope)
|
||||
}
|
||||
|
||||
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
|
||||
|
@ -44,10 +44,10 @@ public:
|
||||
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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user