Add more logging output for dlopen.

Investigation of build bot failure which I can not reproduce locally.

Bug: 21854739
Change-Id: I4584bb10ad44e4bcf8232c060e40b36ff924ffa2
diff --git a/runtime/gc/heap.cc b/runtime/gc/heap.cc
index 14fa740..0cdd3c3 100644
--- a/runtime/gc/heap.cc
+++ b/runtime/gc/heap.cc
@@ -503,6 +503,7 @@
     bool no_gap = MemMap::CheckNoGaps(GetImageSpace()->GetMemMap(),
                                       non_moving_space_->GetMemMap());
     if (!no_gap) {
+      PrintFileToLog("/proc/self/maps", LogSeverity::ERROR);
       MemMap::DumpMaps(LOG(ERROR), true);
       LOG(FATAL) << "There's a gap between the image space and the non-moving space";
     }
diff --git a/runtime/oat_file.cc b/runtime/oat_file.cc
index 55a2fbb..e426eb3 100644
--- a/runtime/oat_file.cc
+++ b/runtime/oat_file.cc
@@ -286,16 +286,22 @@
           if (info->dlpi_phdr[i].p_type == PT_LOAD) {
             auto vaddr = reinterpret_cast<uint8_t*>(info->dlpi_addr + info->dlpi_phdr[i].p_vaddr);
             MemMap::MapDummy(info->dlpi_name, vaddr, info->dlpi_phdr[i].p_memsz);
+            context->found = true;
           }
         }
       }
       return 0;
     }
     std::string so_name;
-  } context;
-  context.so_name = elf_filename;
+    bool found;
+  } context = { elf_filename, false };
   dl_iterate_phdr(dl_iterate_context::callback, &context);
 
+  if (!context.found) {
+    PrintFileToLog("/proc/self/maps", LogSeverity::WARNING);
+    LOG(ERROR) << "File " << elf_filename << " loaded with dlopen but can not find its mmaps.";
+  }
+
   return Setup(abs_dex_location, error_msg);
 #endif  // __APPLE__
 }