[Lldb-commits] [lldb] r133597 - in /lldb/trunk: include/lldb/Core/Disassembler.h source/Commands/CommandObjectDisassemble.cpp source/Core/Disassembler.cpp source/Target/StackFrame.cpp
Greg Clayton
gclayton at apple.com
Tue Jun 21 18:39:49 PDT 2011
Author: gclayton
Date: Tue Jun 21 20:39:49 2011
New Revision: 133597
URL: http://llvm.org/viewvc/llvm-project?rev=133597&view=rev
Log:
Fixed an issue where SBFrame::GetDisassembly() was returning disassembly that
contained the current line marker. This is now an option which is not enabled
for the API disassembly call.
Modified:
lldb/trunk/include/lldb/Core/Disassembler.h
lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
lldb/trunk/source/Core/Disassembler.cpp
lldb/trunk/source/Target/StackFrame.cpp
Modified: lldb/trunk/include/lldb/Core/Disassembler.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Core/Disassembler.h?rev=133597&r1=133596&r2=133597&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Core/Disassembler.h (original)
+++ lldb/trunk/include/lldb/Core/Disassembler.h Tue Jun 21 20:39:49 2011
@@ -184,6 +184,13 @@
{
public:
+ enum
+ {
+ eOptionNone = 0u,
+ eOptionShowBytes = (1u << 0),
+ eOptionRawOuput = (1u << 1),
+ eOptionShowCurrentLine = (1u << 2)
+ };
static Disassembler*
FindPlugin (const ArchSpec &arch, const char *plugin_name);
@@ -202,8 +209,7 @@
const AddressRange &range,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
static bool
@@ -214,8 +220,7 @@
const Address &start,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
static size_t
@@ -226,8 +231,7 @@
SymbolContextList &sc_list,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
static bool
@@ -239,8 +243,7 @@
Module *module,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
static bool
@@ -250,8 +253,7 @@
const ExecutionContext &exe_ctx,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
//------------------------------------------------------------------
@@ -269,8 +271,7 @@
const ExecutionContext &exe_ctx,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm);
size_t
Modified: lldb/trunk/source/Commands/CommandObjectDisassemble.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Commands/CommandObjectDisassemble.cpp?rev=133597&r1=133596&r2=133597&view=diff
==============================================================================
--- lldb/trunk/source/Commands/CommandObjectDisassemble.cpp (original)
+++ lldb/trunk/source/Commands/CommandObjectDisassemble.cpp Tue Jun 21 20:39:49 2011
@@ -258,6 +258,16 @@
m_options.num_lines_context = 1;
ExecutionContext exe_ctx(m_interpreter.GetExecutionContext());
+ uint32_t options = 0;
+
+ if (!m_options.show_mixed)
+ options |= Disassembler::eOptionShowCurrentLine;
+
+ if (m_options.show_bytes)
+ options |= Disassembler::eOptionShowBytes;
+
+ if (m_options.raw)
+ options |= Disassembler::eOptionRawOuput;
if (!m_options.func_name.empty())
{
@@ -271,8 +281,7 @@
NULL, // Module *
m_options.num_instructions,
m_options.show_mixed ? m_options.num_lines_context : 0,
- m_options.show_bytes,
- m_options.raw,
+ options,
result.GetOutputStream()))
{
result.SetStatus (eReturnStatusSuccessFinishResult);
@@ -369,8 +378,7 @@
range.GetBaseAddress(),
m_options.num_instructions,
m_options.show_mixed ? m_options.num_lines_context : 0,
- m_options.show_bytes,
- m_options.raw,
+ options,
result.GetOutputStream()))
{
result.SetStatus (eReturnStatusSuccessFinishResult);
@@ -413,8 +421,7 @@
range,
m_options.num_instructions,
m_options.show_mixed ? m_options.num_lines_context : 0,
- m_options.show_bytes,
- m_options.raw,
+ options,
result.GetOutputStream()))
{
result.SetStatus (eReturnStatusSuccessFinishResult);
Modified: lldb/trunk/source/Core/Disassembler.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Core/Disassembler.cpp?rev=133597&r1=133596&r2=133597&view=diff
==============================================================================
--- lldb/trunk/source/Core/Disassembler.cpp (original)
+++ lldb/trunk/source/Core/Disassembler.cpp Tue Jun 21 20:39:49 2011
@@ -110,8 +110,7 @@
SymbolContextList &sc_list,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -134,8 +133,7 @@
range,
num_instructions,
num_mixed_context_lines,
- show_bytes,
- raw,
+ options,
strm))
{
++success_count;
@@ -157,8 +155,7 @@
Module *module,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -199,8 +196,7 @@
sc_list,
num_instructions,
num_mixed_context_lines,
- show_bytes,
- raw,
+ options,
strm);
}
return false;
@@ -242,8 +238,7 @@
const AddressRange &disasm_range,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -267,8 +262,7 @@
exe_ctx,
num_instructions,
num_mixed_context_lines,
- show_bytes,
- raw,
+ options,
strm);
}
}
@@ -285,8 +279,7 @@
const Address &start_address,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -307,8 +300,7 @@
exe_ctx,
num_instructions,
num_mixed_context_lines,
- show_bytes,
- raw,
+ options,
strm);
}
}
@@ -324,8 +316,7 @@
const ExecutionContext &exe_ctx,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -384,7 +375,7 @@
sc.line_entry.line,
num_mixed_context_lines,
num_mixed_context_lines,
- num_mixed_context_lines ? "->" : "",
+ ((options & eOptionShowCurrentLine) ? "->" : ""),
&strm);
}
}
@@ -421,6 +412,8 @@
else
strm.PutCString(" ");
}
+ const bool show_bytes = (options & eOptionShowBytes) != 0;
+ const bool raw = (options & eOptionRawOuput) != 0;
inst->Dump(&strm, max_opcode_byte_size, true, show_bytes, &exe_ctx, raw);
strm.EOL();
}
@@ -443,8 +436,7 @@
const ExecutionContext &exe_ctx,
uint32_t num_instructions,
uint32_t num_mixed_context_lines,
- bool show_bytes,
- bool raw,
+ uint32_t options,
Stream &strm
)
{
@@ -476,8 +468,7 @@
range,
num_instructions,
num_mixed_context_lines,
- show_bytes,
- raw,
+ options,
strm);
}
Modified: lldb/trunk/source/Target/StackFrame.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Target/StackFrame.cpp?rev=133597&r1=133596&r2=133597&view=diff
==============================================================================
--- lldb/trunk/source/Target/StackFrame.cpp (original)
+++ lldb/trunk/source/Target/StackFrame.cpp Tue Jun 21 20:39:49 2011
@@ -262,8 +262,7 @@
exe_ctx,
0,
0,
- false,
- false,
+ 0,
m_disassembly);
if (m_disassembly.GetSize() == 0)
return NULL;
More information about the lldb-commits
mailing list