summaryrefslogtreecommitdiff
path: root/lldb/source/Target/Target.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lldb/source/Target/Target.cpp')
-rw-r--r--lldb/source/Target/Target.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/lldb/source/Target/Target.cpp b/lldb/source/Target/Target.cpp
index 01e51c0577aa..6d33db6554d2 100644
--- a/lldb/source/Target/Target.cpp
+++ b/lldb/source/Target/Target.cpp
@@ -1829,13 +1829,14 @@ size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
}
size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
- Status &error) {
+ Status &error, bool force_live_memory) {
char buf[256];
out_str.clear();
addr_t curr_addr = addr.GetLoadAddress(this);
Address address(addr);
while (true) {
- size_t length = ReadCStringFromMemory(address, buf, sizeof(buf), error);
+ size_t length = ReadCStringFromMemory(address, buf, sizeof(buf), error,
+ force_live_memory);
if (length == 0)
break;
out_str.append(buf, length);
@@ -1851,7 +1852,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
}
size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
- size_t dst_max_len, Status &result_error) {
+ size_t dst_max_len, Status &result_error,
+ bool force_live_memory) {
size_t total_cstr_len = 0;
if (dst && dst_max_len) {
result_error.Clear();
@@ -1874,8 +1876,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
cache_line_size - (curr_addr % cache_line_size);
addr_t bytes_to_read =
std::min<addr_t>(bytes_left, cache_line_bytes_left);
- size_t bytes_read =
- ReadMemory(address, curr_dst, bytes_to_read, error, true);
+ size_t bytes_read = ReadMemory(address, curr_dst, bytes_to_read, error,
+ force_live_memory);
if (bytes_read == 0) {
result_error = error;