changeset 8677:438da598a947

8055755: Information about loaded dynamic libraries is wrong on MacOSX Summary: The information about loaded dynamic libraries printed in hs_err_pid files or by running the jcmd VM.dynlib is partly incorrect. The address printed in front of the library file name is wrong. Reviewed-by: sla, gziemski, gtriantafill Contributed-by: fredrik.arvidsson@oracle.com
author dbuck
date Tue, 19 Dec 2017 10:22:16 -0500
parents 5801df4acb84
children d10254debf7c
files src/os/bsd/vm/os_bsd.cpp
diffstat 1 files changed, 3 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/src/os/bsd/vm/os_bsd.cpp	Mon Dec 18 18:53:34 2017 -0500
+++ b/src/os/bsd/vm/os_bsd.cpp	Tue Dec 19 10:22:16 2017 -0500
@@ -1681,14 +1681,9 @@
 
   dlclose(handle);
 #elif defined(__APPLE__)
-  uint32_t count;
-  uint32_t i;
-
-  count = _dyld_image_count();
-  for (i = 1; i < count; i++) {
-    const char *name = _dyld_get_image_name(i);
-    intptr_t slide = _dyld_get_image_vmaddr_slide(i);
-    st->print_cr(PTR_FORMAT " \t%s", slide, name);
+  for (uint32_t i = 1; i < _dyld_image_count(); i++) {
+    st->print_cr(PTR_FORMAT " \t%s", _dyld_get_image_header(i),
+        _dyld_get_image_name(i));
   }
 #else
   st->print_cr("Error: Cannot print dynamic libraries.");