diff options
author | Greg Clayton <gclayton@apple.com> | 2011-06-28 19:01:40 +0000 |
---|---|---|
committer | Greg Clayton <gclayton@apple.com> | 2011-06-28 19:01:40 +0000 |
commit | b10d72f019736a9944c851f11f8995485c5ccc86 (patch) | |
tree | fd9bf2934da279caa015c494a06d33d4545c2d2a | |
parent | 7297e7e223b931e351d6f4e551504f94ff141102 (diff) | |
download | bcm5719-llvm-b10d72f019736a9944c851f11f8995485c5ccc86.tar.gz bcm5719-llvm-b10d72f019736a9944c851f11f8995485c5ccc86.zip |
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
-rw-r--r-- | lldb/include/lldb/Core/Disassembler.h | 3 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectDisassemble.cpp | 8 | ||||
-rw-r--r-- | lldb/source/Core/Disassembler.cpp | 10 |
3 files changed, 10 insertions, 11 deletions
diff --git a/lldb/include/lldb/Core/Disassembler.h b/lldb/include/lldb/Core/Disassembler.h index 9a256e79dbd..f77f73f717d 100644 --- a/lldb/include/lldb/Core/Disassembler.h +++ b/lldb/include/lldb/Core/Disassembler.h @@ -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* diff --git a/lldb/source/Commands/CommandObjectDisassemble.cpp b/lldb/source/Commands/CommandObjectDisassemble.cpp index 980c83c11c4..90554eac66f 100644 --- a/lldb/source/Commands/CommandObjectDisassemble.cpp +++ b/lldb/source/Commands/CommandObjectDisassemble.cpp @@ -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; diff --git a/lldb/source/Core/Disassembler.cpp b/lldb/source/Core/Disassembler.cpp index a1208e43e04..6d16e35918a 100644 --- a/lldb/source/Core/Disassembler.cpp +++ b/lldb/source/Core/Disassembler.cpp @@ -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; |