diff options
| author | Zachary Turner <zturner@google.com> | 2017-03-03 20:57:05 +0000 |
|---|---|---|
| committer | Zachary Turner <zturner@google.com> | 2017-03-03 20:57:05 +0000 |
| commit | 29cb868aa4d0279449b56288fde0358adade1a68 (patch) | |
| tree | 697a72f9a7f9f37b5715cd75eb0b164216fcce6e /lldb/source/Core/Address.cpp | |
| parent | 6f9e690199edd68b20bac92983a216459bc568ed (diff) | |
| download | bcm5719-llvm-29cb868aa4d0279449b56288fde0358adade1a68.tar.gz bcm5719-llvm-29cb868aa4d0279449b56288fde0358adade1a68.zip | |
Isolate Target-specific functionality of DataExtractor.
In an effort to move the various DataBuffer / DataExtractor
classes from Core -> Utility, we have to separate the low-level
functionality from the higher level functionality. Only a
few functions required anything other than reading/writing
raw bytes, so those functions are separated out into a
more appropriate area. Specifically, Dump() and DumpHexBytes()
are moved into free functions in Core/DumpDataExtractor.cpp,
and GetGNUEHPointer is moved into a static function in the
only file that it's referenced from.
Differential Revision: https://reviews.llvm.org/D30560
llvm-svn: 296910
Diffstat (limited to 'lldb/source/Core/Address.cpp')
| -rw-r--r-- | lldb/source/Core/Address.cpp | 37 |
1 files changed, 19 insertions, 18 deletions
diff --git a/lldb/source/Core/Address.cpp b/lldb/source/Core/Address.cpp index e2ccf9d7221..9e6bfd85b3a 100644 --- a/lldb/source/Core/Address.cpp +++ b/lldb/source/Core/Address.cpp @@ -15,6 +15,7 @@ // Other libraries and framework includes // Project includes +#include "lldb/Core/DumpDataExtractor.h" #include "lldb/Core/Module.h" #include "lldb/Core/Section.h" #include "lldb/Symbol/Block.h" @@ -143,15 +144,15 @@ static bool DumpUInt(ExecutionContextScope *exe_scope, const Address &address, if (GetByteOrderAndAddressSize(exe_scope, address, byte_order, addr_size)) { DataExtractor data(&buf.front(), buf.size(), byte_order, addr_size); - data.Dump(strm, - 0, // Start offset in "data" - eFormatHex, // Print as characters - buf.size(), // Size of item - 1, // Items count - UINT32_MAX, // num per line - LLDB_INVALID_ADDRESS, // base address - 0, // bitfield bit size - 0); // bitfield bit offset + DumpDataExtractor(data, strm, + 0, // Start offset in "data" + eFormatHex, // Print as characters + buf.size(), // Size of item + 1, // Items count + UINT32_MAX, // num per line + LLDB_INVALID_ADDRESS, // base address + 0, // bitfield bit size + 0); // bitfield bit offset return true; } @@ -181,16 +182,16 @@ static size_t ReadCStringFromMemory(ExecutionContextScope *exe_scope, if (len > bytes_read) len = bytes_read; - data.Dump(strm, - 0, // Start offset in "data" - eFormatChar, // Print as characters - 1, // Size of item (1 byte for a char!) - len, // How many bytes to print? - UINT32_MAX, // num per line - LLDB_INVALID_ADDRESS, // base address - 0, // bitfield bit size + DumpDataExtractor(data, strm, + 0, // Start offset in "data" + eFormatChar, // Print as characters + 1, // Size of item (1 byte for a char!) + len, // How many bytes to print? + UINT32_MAX, // num per line + LLDB_INVALID_ADDRESS, // base address + 0, // bitfield bit size - 0); // bitfield bit offset + 0); // bitfield bit offset total_len += bytes_read; |

