aboutsummaryrefslogtreecommitdiff
path: root/lldb/source/Commands/CommandObjectMemory.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-01-17 20:45:01 +0000
commit706b4fc47bbc608932d3b491ae19a3b9cde9497b (patch)
tree4adf86a776049cbf7f69a1929c4babcbbef925eb /lldb/source/Commands/CommandObjectMemory.cpp
parent7cc9cf2bf09f069cb2dd947ead05d0b54301fb71 (diff)
downloadsrc-706b4fc47bbc608932d3b491ae19a3b9cde9497b.tar.gz
src-706b4fc47bbc608932d3b491ae19a3b9cde9497b.zip
Vendor import of llvm-project master e26a78e70, the last commit beforevendor/llvm-project/llvmorg-10-init-17466-ge26a78e7085
the llvmorg-11-init tag, from which release/10.x was branched.
Notes
Notes: svn path=/vendor/llvm-project/master/; revision=356843 svn path=/vendor/llvm-project/llvmorg-10-init-17466-ge26a78e7085/; revision=356844; tag=vendor/llvm-project/llvmorg-10-init-17466-ge26a78e7085
Diffstat (limited to 'lldb/source/Commands/CommandObjectMemory.cpp')
-rw-r--r--lldb/source/Commands/CommandObjectMemory.cpp36
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 {