summaryrefslogtreecommitdiffstats
path: root/lldb/source/Utility
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Utility')
-rw-r--r--lldb/source/Utility/Stream.cpp24
-rw-r--r--lldb/source/Utility/VMRange.cpp4
2 files changed, 14 insertions, 14 deletions
diff --git a/lldb/source/Utility/Stream.cpp b/lldb/source/Utility/Stream.cpp
index 2ef4cd78ab0..b336cb6b518 100644
--- a/lldb/source/Utility/Stream.cpp
+++ b/lldb/source/Utility/Stream.cpp
@@ -11,6 +11,7 @@
#include "lldb/Utility/Endian.h"
#include "lldb/Utility/VASPrintf.h"
#include "llvm/ADT/SmallString.h"
+#include "llvm/Support/Format.h"
#include "llvm/Support/LEB128.h"
#include <string>
@@ -76,28 +77,27 @@ void Stream::QuotedCString(const char *cstr, const char *format) {
// Put an address "addr" out to the stream with optional prefix and suffix
// strings.
-void Stream::Address(uint64_t addr, uint32_t addr_size, const char *prefix,
- const char *suffix) {
+void lldb_private::DumpAddress(llvm::raw_ostream &s, uint64_t addr,
+ uint32_t addr_size, const char *prefix,
+ const char *suffix) {
if (prefix == nullptr)
prefix = "";
if (suffix == nullptr)
suffix = "";
- // int addr_width = m_addr_size << 1;
- // Printf ("%s0x%0*" PRIx64 "%s", prefix, addr_width, addr, suffix);
- Printf("%s0x%0*" PRIx64 "%s", prefix, addr_size * 2, addr, suffix);
+ s << prefix << llvm::format_hex(addr, 2 + 2 * addr_size) << suffix;
}
// Put an address range out to the stream with optional prefix and suffix
// strings.
-void Stream::AddressRange(uint64_t lo_addr, uint64_t hi_addr,
- uint32_t addr_size, const char *prefix,
- const char *suffix) {
+void lldb_private::DumpAddressRange(llvm::raw_ostream &s, uint64_t lo_addr,
+ uint64_t hi_addr, uint32_t addr_size,
+ const char *prefix, const char *suffix) {
if (prefix && prefix[0])
- PutCString(prefix);
- Address(lo_addr, addr_size, "[");
- Address(hi_addr, addr_size, "-", ")");
+ s << prefix;
+ DumpAddress(s, lo_addr, addr_size, "[");
+ DumpAddress(s, hi_addr, addr_size, "-", ")");
if (suffix && suffix[0])
- PutCString(suffix);
+ s << suffix;
}
size_t Stream::PutChar(char ch) { return Write(&ch, 1); }
diff --git a/lldb/source/Utility/VMRange.cpp b/lldb/source/Utility/VMRange.cpp
index f3f4ae7efc3..e7c6b0bcccb 100644
--- a/lldb/source/Utility/VMRange.cpp
+++ b/lldb/source/Utility/VMRange.cpp
@@ -36,8 +36,8 @@ bool VMRange::ContainsRange(const VMRange::collection &coll,
}
void VMRange::Dump(Stream *s, lldb::addr_t offset, uint32_t addr_width) const {
- s->AddressRange(offset + GetBaseAddress(), offset + GetEndAddress(),
- addr_width);
+ DumpAddressRange(s->AsRawOstream(), offset + GetBaseAddress(),
+ offset + GetEndAddress(), addr_width);
}
bool lldb_private::operator==(const VMRange &lhs, const VMRange &rhs) {
OpenPOWER on IntegriCloud