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
--- a/hotspot/src/os/bsd/vm/os_bsd.cpp Wed Aug 27 10:42:28 2014 -0700
+++ b/hotspot/src/os/bsd/vm/os_bsd.cpp Thu Aug 28 10:28:21 2014 +0200
@@ -1678,14 +1678,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.");