summaryrefslogtreecommitdiffstats
path: root/lldb/source/Core/Event.cpp
diff options
context:
space:
mode:
authorPavel Labath <labath@google.com>2018-07-24 10:49:14 +0000
committerPavel Labath <labath@google.com>2018-07-24 10:49:14 +0000
commit082bab1cff57028b51d1cd029efe28a660c259f7 (patch)
treef647d71941c118ffc7d7f1debd7730bd7b5413cd /lldb/source/Core/Event.cpp
parent6698f9b7db5a3fd56be148934bf299590ada0243 (diff)
downloadbcm5719-llvm-082bab1cff57028b51d1cd029efe28a660c259f7.tar.gz
bcm5719-llvm-082bab1cff57028b51d1cd029efe28a660c259f7.zip
Reimplement EventDataBytes::Dump to avoid DumpDataExtractor
This is the only external non-trivial dependency of the Event classes. llvm-svn: 337819
Diffstat (limited to 'lldb/source/Core/Event.cpp')
-rw-r--r--lldb/source/Core/Event.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/lldb/source/Core/Event.cpp b/lldb/source/Core/Event.cpp
index 8d351d8ba1a..3ebad7acdef 100644
--- a/lldb/source/Core/Event.cpp
+++ b/lldb/source/Core/Event.cpp
@@ -10,7 +10,6 @@
#include "lldb/Core/Event.h"
#include "lldb/Core/Broadcaster.h"
-#include "lldb/Core/DumpDataExtractor.h"
#include "lldb/Utility/DataExtractor.h"
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/Stream.h"
@@ -134,14 +133,13 @@ const ConstString &EventDataBytes::GetFlavor() const {
void EventDataBytes::Dump(Stream *s) const {
size_t num_printable_chars =
std::count_if(m_bytes.begin(), m_bytes.end(), isprint);
- if (num_printable_chars == m_bytes.size()) {
- s->Printf("\"%s\"", m_bytes.c_str());
- } else if (!m_bytes.empty()) {
- DataExtractor data;
- data.SetData(m_bytes.data(), m_bytes.size(), endian::InlHostByteOrder());
- DumpDataExtractor(data, s, 0, eFormatBytes, 1, m_bytes.size(), 32,
- LLDB_INVALID_ADDRESS, 0, 0);
- }
+ if (num_printable_chars == m_bytes.size())
+ s->Format("\"{0}\"", m_bytes);
+ else
+ s->Format("{0:$[ ]@[x-2]}", llvm::make_range(
+ reinterpret_cast<const uint8_t *>(m_bytes.data()),
+ reinterpret_cast<const uint8_t *>(m_bytes.data() +
+ m_bytes.size())));
}
const void *EventDataBytes::GetBytes() const {
OpenPOWER on IntegriCloud