This revision was automatically updated to reflect the committed changes.
Closed by commit rL357134: [ObjectFileMachO] Disable memory caching for 
savecore. (authored by davide, committed by ).
Herald added a project: LLVM.

Changed prior to commit:
  https://reviews.llvm.org/D59896?vs=192496&id=192547#toc

Repository:
  rL LLVM

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D59896/new/

https://reviews.llvm.org/D59896

Files:
  lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp


Index: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6128,18 +6128,6 @@
             if (range_info.GetExecutable() == MemoryRegionInfo::eYes)
               prot |= VM_PROT_EXECUTE;
 
-            //                        printf ("[%3u] [0x%16.16" PRIx64 " -
-            //                        0x%16.16" PRIx64 ") %c%c%c\n",
-            //                                range_info_idx,
-            //                                addr,
-            //                                size,
-            //                                (prot & VM_PROT_READ   ) ? 'r' :
-            //                                '-',
-            //                                (prot & VM_PROT_WRITE  ) ? 'w' :
-            //                                '-',
-            //                                (prot & VM_PROT_EXECUTE) ? 'x' :
-            //                                '-');
-
             if (prot != 0) {
               uint32_t cmd_type = LC_SEGMENT_64;
               uint32_t segment_size = sizeof(segment_command_64);
@@ -6346,8 +6334,13 @@
                 while (bytes_left > 0 && error.Success()) {
                   const size_t bytes_to_read =
                       bytes_left > sizeof(bytes) ? sizeof(bytes) : bytes_left;
-                  const size_t bytes_read = process_sp->ReadMemory(
+
+                  // In a savecore setting, we don't really care about caching,
+                  // as the data is dumped and very likely never read again,
+                  // so we call ReadMemoryFromInferior to bypass it.
+                  const size_t bytes_read = process_sp->ReadMemoryFromInferior(
                       addr, bytes, bytes_to_read, memory_read_error);
+
                   if (bytes_read == bytes_to_read) {
                     size_t bytes_written = bytes_read;
                     error = core_file.Write(bytes, bytes_written);


Index: lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
===================================================================
--- lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
+++ lldb/trunk/source/Plugins/ObjectFile/Mach-O/ObjectFileMachO.cpp
@@ -6128,18 +6128,6 @@
             if (range_info.GetExecutable() == MemoryRegionInfo::eYes)
               prot |= VM_PROT_EXECUTE;
 
-            //                        printf ("[%3u] [0x%16.16" PRIx64 " -
-            //                        0x%16.16" PRIx64 ") %c%c%c\n",
-            //                                range_info_idx,
-            //                                addr,
-            //                                size,
-            //                                (prot & VM_PROT_READ   ) ? 'r' :
-            //                                '-',
-            //                                (prot & VM_PROT_WRITE  ) ? 'w' :
-            //                                '-',
-            //                                (prot & VM_PROT_EXECUTE) ? 'x' :
-            //                                '-');
-
             if (prot != 0) {
               uint32_t cmd_type = LC_SEGMENT_64;
               uint32_t segment_size = sizeof(segment_command_64);
@@ -6346,8 +6334,13 @@
                 while (bytes_left > 0 && error.Success()) {
                   const size_t bytes_to_read =
                       bytes_left > sizeof(bytes) ? sizeof(bytes) : bytes_left;
-                  const size_t bytes_read = process_sp->ReadMemory(
+
+                  // In a savecore setting, we don't really care about caching,
+                  // as the data is dumped and very likely never read again,
+                  // so we call ReadMemoryFromInferior to bypass it.
+                  const size_t bytes_read = process_sp->ReadMemoryFromInferior(
                       addr, bytes, bytes_to_read, memory_read_error);
+
                   if (bytes_read == bytes_to_read) {
                     size_t bytes_written = bytes_read;
                     error = core_file.Write(bytes, bytes_written);
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to