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:
Greg Clayton 2011-06-28 19:01:40 +00:00
parent 7297e7e223
commit b10d72f019
3 changed files with 10 additions and 11 deletions

View File

@ -189,7 +189,8 @@ public:
eOptionNone = 0u,
eOptionShowBytes = (1u << 0),
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*

View File

@ -258,10 +258,12 @@ CommandObjectDisassemble::Execute
m_options.num_lines_context = 1;
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)
options |= Disassembler::eOptionShowCurrentLine;
// Mark the source line for the current PC only if we are doing mixed source and assembly
if (m_options.show_mixed)
options |= Disassembler::eOptionMarkPCSourceLine;
if (m_options.show_bytes)
options |= Disassembler::eOptionShowBytes;

View File

@ -337,7 +337,6 @@ Disassembler::PrintInstructions
pc_addr_ptr = &exe_ctx.frame->GetFrameCodeAddress();
const uint32_t scope = eSymbolContextLineEntry | eSymbolContextFunction | eSymbolContextSymbol;
const bool use_inline_block_range = false;
for (size_t i=0; i<num_instructions_found; ++i)
{
Instruction *inst = disasm_ptr->GetInstructionList().GetInstructionAtIndex (i).get();
@ -375,7 +374,7 @@ Disassembler::PrintInstructions
sc.line_entry.line,
num_mixed_context_lines,
num_mixed_context_lines,
((options & eOptionShowCurrentLine) ? "->" : ""),
((inst_is_at_pc && (options & eOptionMarkPCSourceLine)) ? "->" : ""),
&strm);
}
}
@ -405,12 +404,9 @@ Disassembler::PrintInstructions
}
}
if (pc_addr_ptr)
if ((options & eOptionMarkPCAddress) && pc_addr_ptr)
{
if (inst_is_at_pc)
strm.PutCString("-> ");
else
strm.PutCString(" ");
strm.PutCString(inst_is_at_pc ? "-> " : " ");
}
const bool show_bytes = (options & eOptionShowBytes) != 0;
const bool raw = (options & eOptionRawOuput) != 0;