@@ -1873,13 +1873,14 @@ size_t Target::ReadMemory(const Address &addr, void *dst, size_t dst_len,
1873
1873
}
1874
1874
1875
1875
size_t Target::ReadCStringFromMemory (const Address &addr, std::string &out_str,
1876
- Status &error) {
1876
+ Status &error, bool force_live_memory ) {
1877
1877
char buf[256 ];
1878
1878
out_str.clear ();
1879
1879
addr_t curr_addr = addr.GetLoadAddress (this );
1880
1880
Address address (addr);
1881
1881
while (true ) {
1882
- size_t length = ReadCStringFromMemory (address, buf, sizeof (buf), error);
1882
+ size_t length = ReadCStringFromMemory (address, buf, sizeof (buf), error,
1883
+ force_live_memory);
1883
1884
if (length == 0 )
1884
1885
break ;
1885
1886
out_str.append (buf, length);
@@ -1895,7 +1896,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, std::string &out_str,
1895
1896
}
1896
1897
1897
1898
size_t Target::ReadCStringFromMemory (const Address &addr, char *dst,
1898
- size_t dst_max_len, Status &result_error) {
1899
+ size_t dst_max_len, Status &result_error,
1900
+ bool force_live_memory) {
1899
1901
size_t total_cstr_len = 0 ;
1900
1902
if (dst && dst_max_len) {
1901
1903
result_error.Clear ();
@@ -1918,8 +1920,8 @@ size_t Target::ReadCStringFromMemory(const Address &addr, char *dst,
1918
1920
cache_line_size - (curr_addr % cache_line_size);
1919
1921
addr_t bytes_to_read =
1920
1922
std::min<addr_t >(bytes_left, cache_line_bytes_left);
1921
- size_t bytes_read =
1922
- ReadMemory (address, curr_dst, bytes_to_read, error, true );
1923
+ size_t bytes_read = ReadMemory (address, curr_dst, bytes_to_read, error,
1924
+ force_live_memory );
1923
1925
1924
1926
if (bytes_read == 0 ) {
1925
1927
result_error = error;
0 commit comments