@@ -2234,27 +2234,27 @@ size_t Process::ReadMemoryFromInferior(addr_t addr, void *buf, size_t size,
22342234}
22352235
22362236size_t Process::ReadMemoryInChunks (lldb::addr_t vm_addr, void *buf,
2237- lldb::addr_t chunk_size, size_t size,
2238- ReadMemoryChunkCallback callback) {
2239- // Safety check to prevent an infinite loop.
2240- if (chunk_size == 0 )
2241- return 0 ;
2242-
2243- // Create a data buffer heap of the specified size, initialized to 0.
2244- uint64_t bytes_remaining = size;
2245- uint64_t bytes_read = 0 ;
2246- Status error;
2247- while (bytes_remaining > 0 ) {
2248- // Get the next read chunk size as the minimum of the remaining bytes and
2249- // the write chunk max size.
2250- const size_t bytes_to_read = std::min (bytes_remaining, chunk_size);
2251- const lldb::addr_t current_addr = vm_addr + bytes_read;
2252- const size_t bytes_read_for_chunk =
2253- ReadMemoryFromInferior (current_addr, buf, bytes_to_read, error);
2254-
2255- if (callback (error, buf, current_addr, bytes_to_read,
2256- bytes_read_for_chunk) == IterationAction::Stop)
2257- break ;
2237+ lldb::addr_t chunk_size, size_t size,
2238+ ReadMemoryChunkCallback callback) {
2239+ // Safety check to prevent an infinite loop.
2240+ if (chunk_size == 0 )
2241+ return 0 ;
2242+
2243+ // Create a data buffer heap of the specified size, initialized to 0.
2244+ uint64_t bytes_remaining = size;
2245+ uint64_t bytes_read = 0 ;
2246+ Status error;
2247+ while (bytes_remaining > 0 ) {
2248+ // Get the next read chunk size as the minimum of the remaining bytes and
2249+ // the write chunk max size.
2250+ const size_t bytes_to_read = std::min (bytes_remaining, chunk_size);
2251+ const lldb::addr_t current_addr = vm_addr + bytes_read;
2252+ const size_t bytes_read_for_chunk =
2253+ ReadMemoryFromInferior (current_addr, buf, bytes_to_read, error);
2254+
2255+ if (callback (error, buf, current_addr, bytes_to_read,
2256+ bytes_read_for_chunk) == IterationAction::Stop)
2257+ break ;
22582258
22592259 bytes_read += bytes_read_for_chunk;
22602260 // If the bytes read in this chunk would cause us to overflow, something
0 commit comments