@@ -1829,13 +1829,14 @@ size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
1829
1829
}
1830
1830
1831
1831
size_t Target::ReadCStringFromMemory (const Address &addr, std::string &out_str,
1832
- Status &error) {
1832
+ Status &error, bool force_live_memory ) {
1833
1833
char buf[256 ];
1834
1834
out_str.clear ();
1835
1835
addr_t curr_addr = addr.GetLoadAddress (this );
1836
1836
Address address (addr);
1837
1837
while (true ) {
1838
- size_t length = ReadCStringFromMemory (address, buf, sizeof (buf), error);
1838
+ size_t length = ReadCStringFromMemory (address, buf, sizeof (buf), error,
1839
+ force_live_memory);
1839
1840
if (length == 0 )
1840
1841
break ;
1841
1842
out_str.append (buf, length);
@@ -1851,7 +1852,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
1851
1852
}
1852
1853
1853
1854
size_t Target::ReadCStringFromMemory (const Address &addr, char *dst,
1854
- size_t dst_max_len, Status &result_error) {
1855
+ size_t dst_max_len, Status &result_error,
1856
+ bool force_live_memory) {
1855
1857
size_t total_cstr_len = 0 ;
1856
1858
if (dst && dst_max_len) {
1857
1859
result_error.Clear ();
@@ -1874,8 +1876,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
1874
1876
cache_line_size - (curr_addr % cache_line_size);
1875
1877
addr_t bytes_to_read =
1876
1878
std::min<addr_t >(bytes_left, cache_line_bytes_left);
1877
- size_t bytes_read =
1878
- ReadMemory (address, curr_dst, bytes_to_read, error, true );
1879
+ size_t bytes_read = ReadMemory (address, curr_dst, bytes_to_read, error,
1880
+ force_live_memory );
1879
1881
1880
1882
if (bytes_read == 0 ) {
1881
1883
result_error = error;
0 commit comments