diff options
Diffstat (limited to 'lldb/source/Commands')
-rw-r--r-- | lldb/source/Commands/CommandObjectExpression.cpp | 4 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectFrame.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 31 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectRegister.cpp | 2 | ||||
-rw-r--r-- | lldb/source/Commands/CommandObjectTarget.cpp | 2 |
5 files changed, 32 insertions, 9 deletions
diff --git a/lldb/source/Commands/CommandObjectExpression.cpp b/lldb/source/Commands/CommandObjectExpression.cpp index 29fea1efceb..3ec585ee33d 100644 --- a/lldb/source/Commands/CommandObjectExpression.cpp +++ b/lldb/source/Commands/CommandObjectExpression.cpp @@ -164,8 +164,8 @@ CommandObjectExpression::CommandObjectExpression (CommandInterpreter &interprete // Push the data for the first argument into the m_arguments vector. m_arguments.push_back (arg); - // Add the "--format" and "--count" options to group 1 and 3 - m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1); + // Add the "--format" and "--gdb-format" + m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1); m_option_group.Append (&m_command_options); m_option_group.Finalize(); } diff --git a/lldb/source/Commands/CommandObjectFrame.cpp b/lldb/source/Commands/CommandObjectFrame.cpp index 36f785a6aea..9a4665c82c9 100644 --- a/lldb/source/Commands/CommandObjectFrame.cpp +++ b/lldb/source/Commands/CommandObjectFrame.cpp @@ -355,7 +355,7 @@ public: m_arguments.push_back (arg); m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); - m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1); + m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1); m_option_group.Append (&m_option_watchpoint, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); m_option_group.Finalize(); diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 63aa1108785..7a16a60bc0e 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -136,7 +136,21 @@ public: case eFormatCString: break; - + + case eFormatInstruction: + if (count_option_set) + byte_size_value = target->GetArchitecture().GetMaximumOpcodeByteSize() * format_options.GetCountValue().GetCurrentValue(); + m_num_per_line = 1; + break; + + case eFormatAddressInfo: + if (!byte_size_option_set) + byte_size_value = target->GetArchitecture().GetAddressByteSize(); + m_num_per_line = 1; + if (!count_option_set) + format_options.GetCountValue() = 8; + break; + case eFormatPointer: byte_size_value = target->GetArchitecture().GetAddressByteSize(); if (!num_per_line_option_set) @@ -153,6 +167,7 @@ public: case eFormatUnicode16: case eFormatUnicode32: case eFormatUnsigned: + case eFormatHexFloat: if (!byte_size_option_set) byte_size_value = 4; if (!num_per_line_option_set) @@ -160,7 +175,7 @@ public: if (!count_option_set) format_options.GetCountValue() = 8; break; - + case eFormatBytes: case eFormatBytesWithASCII: if (byte_size_option_set) @@ -309,6 +324,9 @@ public: m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_COUNT, LLDB_OPT_SET_1 | LLDB_OPT_SET_3); + m_option_group.Append (&m_format_options, + OptionGroupFormat::OPTION_GROUP_GDB_FMT, + LLDB_OPT_SET_1 | LLDB_OPT_SET_2 | LLDB_OPT_SET_3); // Add the "--size" option to group 1 and 2 m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_SIZE, @@ -653,6 +671,7 @@ public: } + ExecutionContextScope *exe_scope = exe_ctx.GetBestExecutionContextScope(); if (clang_ast_type.GetOpaqueQualType()) { for (uint32_t i = 0; i<item_count; ++i) @@ -661,7 +680,7 @@ public: Address address (NULL, item_addr); StreamString name_strm; name_strm.Printf ("0x%llx", item_addr); - ValueObjectSP valobj_sp (ValueObjectMemory::Create (exe_ctx.GetBestExecutionContextScope(), + ValueObjectSP valobj_sp (ValueObjectMemory::Create (exe_scope, name_strm.GetString().c_str(), address, clang_ast_type)); @@ -715,7 +734,8 @@ public: num_per_line, addr, 0, - 0); + 0, + exe_scope); output_stream->EOL(); return true; } @@ -1030,6 +1050,9 @@ public: case eFormatVectorOfUInt128: case eFormatOSType: case eFormatComplexInteger: + case eFormatAddressInfo: + case eFormatHexFloat: + case eFormatInstruction: result.AppendError("unsupported format for writing memory"); result.SetStatus(eReturnStatusFailed); return false; diff --git a/lldb/source/Commands/CommandObjectRegister.cpp b/lldb/source/Commands/CommandObjectRegister.cpp index f1ef83754ca..7b0e0c38c99 100644 --- a/lldb/source/Commands/CommandObjectRegister.cpp +++ b/lldb/source/Commands/CommandObjectRegister.cpp @@ -62,7 +62,7 @@ public: m_arguments.push_back (arg); // Add the "--format" - m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_ALL); + m_option_group.Append (&m_format_options, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_ALL); m_option_group.Append (&m_command_options); m_option_group.Finalize(); diff --git a/lldb/source/Commands/CommandObjectTarget.cpp b/lldb/source/Commands/CommandObjectTarget.cpp index 89653b7bf0d..09bb205f962 100644 --- a/lldb/source/Commands/CommandObjectTarget.cpp +++ b/lldb/source/Commands/CommandObjectTarget.cpp @@ -525,7 +525,7 @@ public: m_option_group.Append (&m_varobj_options, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); m_option_group.Append (&m_option_variable, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); - m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT, LLDB_OPT_SET_1); + m_option_group.Append (&m_option_format, OptionGroupFormat::OPTION_GROUP_FORMAT | OptionGroupFormat::OPTION_GROUP_GDB_FMT, LLDB_OPT_SET_1); m_option_group.Append (&m_option_compile_units, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); m_option_group.Append (&m_option_shared_libraries, LLDB_OPT_SET_ALL, LLDB_OPT_SET_1); m_option_group.Finalize(); |