forked from OSchip/llvm-project
Remove the disassembly option: "eOptionShowCurrentLine" and replaced it with
two: eOptionMarkPCSourceLine = (1u << 2), // Mark the source line that contains the current PC (mixed mode only) eOptionMarkPCAddress = (1u << 3) // Mark the disassembly line the contains the PC This allows mixed mode to show the line that contains the current PC, and it allows us to mark the PC address in the disassembly if desired. Having these be separate gives more control on the disassembly output. SBFrame::Disassemble() doesn't enable any of these options. llvm-svn: 134019
This commit is contained in:
parent
7297e7e223
commit
b10d72f019
|
@ -189,7 +189,8 @@ public:
|
||||||
eOptionNone = 0u,
|
eOptionNone = 0u,
|
||||||
eOptionShowBytes = (1u << 0),
|
eOptionShowBytes = (1u << 0),
|
||||||
eOptionRawOuput = (1u << 1),
|
eOptionRawOuput = (1u << 1),
|
||||||
eOptionShowCurrentLine = (1u << 2)
|
eOptionMarkPCSourceLine = (1u << 2), // Mark the source line that contains the current PC (mixed mode only)
|
||||||
|
eOptionMarkPCAddress = (1u << 3) // Mark the disassembly line the contains the PC
|
||||||
};
|
};
|
||||||
|
|
||||||
static Disassembler*
|
static Disassembler*
|
||||||
|
|
|
@ -258,10 +258,12 @@ CommandObjectDisassemble::Execute
|
||||||
m_options.num_lines_context = 1;
|
m_options.num_lines_context = 1;
|
||||||
|
|
||||||
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
|
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
|
||||||
uint32_t options = 0;
|
// Always show the PC in the disassembly
|
||||||
|
uint32_t options = Disassembler::eOptionMarkPCAddress;
|
||||||
|
|
||||||
if (!m_options.show_mixed)
|
// Mark the source line for the current PC only if we are doing mixed source and assembly
|
||||||
options |= Disassembler::eOptionShowCurrentLine;
|
if (m_options.show_mixed)
|
||||||
|
options |= Disassembler::eOptionMarkPCSourceLine;
|
||||||
|
|
||||||
if (m_options.show_bytes)
|
if (m_options.show_bytes)
|
||||||
options |= Disassembler::eOptionShowBytes;
|
options |= Disassembler::eOptionShowBytes;
|
||||||
|
|
|
@ -337,7 +337,6 @@ Disassembler::PrintInstructions
|
||||||
pc_addr_ptr = &exe_ctx.frame->GetFrameCodeAddress();
|
pc_addr_ptr = &exe_ctx.frame->GetFrameCodeAddress();
|
||||||
const uint32_t scope = eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol;
|
const uint32_t scope = eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol;
|
||||||
const bool use_inline_block_range = false;
|
const bool use_inline_block_range = false;
|
||||||
|
|
||||||
for (size_t i=0; i<num_instructions_found; ++i)
|
for (size_t i=0; i<num_instructions_found; ++i)
|
||||||
{
|
{
|
||||||
Instruction *inst = disasm_ptr->GetInstructionList().GetInstructionAtIndex (i).get();
|
Instruction *inst = disasm_ptr->GetInstructionList().GetInstructionAtIndex (i).get();
|
||||||
|
@ -375,7 +374,7 @@ Disassembler::PrintInstructions
|
||||||
sc.line_entry.line,
|
sc.line_entry.line,
|
||||||
num_mixed_context_lines,
|
num_mixed_context_lines,
|
||||||
num_mixed_context_lines,
|
num_mixed_context_lines,
|
||||||
((options & eOptionShowCurrentLine) ? "->" : ""),
|
((inst_is_at_pc && (options & eOptionMarkPCSourceLine)) ? "->" : ""),
|
||||||
&strm);
|
&strm);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -405,12 +404,9 @@ Disassembler::PrintInstructions
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pc_addr_ptr)
|
if ((options & eOptionMarkPCAddress) && pc_addr_ptr)
|
||||||
{
|
{
|
||||||
if (inst_is_at_pc)
|
strm.PutCString(inst_is_at_pc ? "-> " : " ");
|
||||||
strm.PutCString("-> ");
|
|
||||||
else
|
|
||||||
strm.PutCString(" ");
|
|
||||||
}
|
}
|
||||||
const bool show_bytes = (options & eOptionShowBytes) != 0;
|
const bool show_bytes = (options & eOptionShowBytes) != 0;
|
||||||
const bool raw = (options & eOptionRawOuput) != 0;
|
const bool raw = (options & eOptionRawOuput) != 0;
|
||||||
|
|
Loading…
Reference in New Issue