diff options
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r-- | lldb/source/Commands/CommandObjectMemory.cpp | 36 |
1 files changed, 14 insertions, 22 deletions
diff --git a/lldb/source/Commands/CommandObjectMemory.cpp b/lldb/source/Commands/CommandObjectMemory.cpp index 38bd3d179096..e497b5246b8d 100644 --- a/lldb/source/Commands/CommandObjectMemory.cpp +++ b/lldb/source/Commands/CommandObjectMemory.cpp @@ -7,15 +7,11 @@ //===----------------------------------------------------------------------===// #include "CommandObjectMemory.h" -#include "lldb/Core/Debugger.h" #include "lldb/Core/DumpDataExtractor.h" -#include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Core/ValueObjectMemory.h" -#include "lldb/DataFormatters/ValueObjectPrinter.h" #include "lldb/Expression/ExpressionVariable.h" #include "lldb/Host/OptionParser.h" -#include "lldb/Interpreter/CommandInterpreter.h" #include "lldb/Interpreter/CommandReturnObject.h" #include "lldb/Interpreter/OptionArgParser.h" #include "lldb/Interpreter/OptionGroupFormat.h" @@ -38,7 +34,6 @@ #include "lldb/Utility/DataBufferLLVM.h" #include "lldb/Utility/StreamString.h" -#include "lldb/lldb-private.h" #include <cinttypes> #include <memory> @@ -1440,8 +1435,7 @@ protected: case eFormatBytes: case eFormatHex: case eFormatHexUppercase: - case eFormatPointer: - { + case eFormatPointer: { // Decode hex bytes // Be careful, getAsInteger with a radix of 16 rejects "0xab" so we // have to special case that: @@ -1597,13 +1591,14 @@ protected: class CommandObjectMemoryHistory : public CommandObjectParsed { public: CommandObjectMemoryHistory(CommandInterpreter &interpreter) - : CommandObjectParsed( - interpreter, "memory history", "Print recorded stack traces for " - "allocation/deallocation events " - "associated with an address.", - nullptr, - eCommandRequiresTarget | eCommandRequiresProcess | - eCommandProcessMustBePaused | eCommandProcessMustBeLaunched) { + : CommandObjectParsed(interpreter, "memory history", + "Print recorded stack traces for " + "allocation/deallocation events " + "associated with an address.", + nullptr, + eCommandRequiresTarget | eCommandRequiresProcess | + eCommandProcessMustBePaused | + eCommandProcessMustBeLaunched) { CommandArgumentEntry arg1; CommandArgumentData addr_arg; @@ -1730,15 +1725,12 @@ protected: section_name = section_sp->GetName(); } } - result.AppendMessageWithFormat( - "[0x%16.16" PRIx64 "-0x%16.16" PRIx64 ") %c%c%c%s%s%s%s\n", + result.AppendMessageWithFormatv( + "[{0:x16}-{1:x16}) {2:r}{3:w}{4:x}{5}{6}{7}{8}\n", range_info.GetRange().GetRangeBase(), - range_info.GetRange().GetRangeEnd(), - range_info.GetReadable() ? 'r' : '-', - range_info.GetWritable() ? 'w' : '-', - range_info.GetExecutable() ? 'x' : '-', - name ? " " : "", name.AsCString(""), - section_name ? " " : "", section_name.AsCString("")); + range_info.GetRange().GetRangeEnd(), range_info.GetReadable(), + range_info.GetWritable(), range_info.GetExecutable(), + name ? " " : "", name, section_name ? " " : "", section_name); m_prev_end_addr = range_info.GetRange().GetRangeEnd(); result.SetStatus(eReturnStatusSuccessFinishResult); } else { |