It was thought that PMap did not work at all on OSX, so it was disable on in PMap.java:
if (PlatformInfo.getOS().equals("darwin")) {
out.println("Not available on Mac OS X");
return;
}
However, it does work with core files. The reason is the OSX port does register LoadObjects for core files, but not for processes. JDK-8248875 discusses this a bit. The above code should be modified to allow running on OSX if debugging a core file. Note ClhsdbPmap.java expects it to fail on OSX since it runs on a process. Possibly as part of this fix ClhsdbPmap.java can be updated to also run on a core file and expect it to pass on OSX.
PStack does the exact same check. It too should be enabled for OSX core files.
The code for this is in ps_core.c::read_shared_lib_info(). It's very hard to read unless you have a good understanding of mach core file layouts.
Enabling PMap and PStack for OSX core files requires that firstJDK-8247515 be pushed since it fixes some pc -> symbol lookup issues that PStack needs, and hides the system library lookup issues discussed in JDK-8249779. Note also that due to JDK-8249779 PMap will not show any system libraries and PStack will not do pc -> symbol resolution for pc's in system libraries.
if (PlatformInfo.getOS().equals("darwin")) {
out.println("Not available on Mac OS X");
return;
}
However, it does work with core files. The reason is the OSX port does register LoadObjects for core files, but not for processes. JDK-8248875 discusses this a bit. The above code should be modified to allow running on OSX if debugging a core file. Note ClhsdbPmap.java expects it to fail on OSX since it runs on a process. Possibly as part of this fix ClhsdbPmap.java can be updated to also run on a core file and expect it to pass on OSX.
PStack does the exact same check. It too should be enabled for OSX core files.
The code for this is in ps_core.c::read_shared_lib_info(). It's very hard to read unless you have a good understanding of mach core file layouts.
Enabling PMap and PStack for OSX core files requires that first
- is blocked by
-
JDK-8247515 OSX pc_to_symbol() lookup does not work with core files
- Resolved
- relates to
-
JDK-8249779 SA fails to properly discover system libraries for OSX core files
- Open
-
JDK-8248875 Umbrella bug for missing and broken SA features on OSX
- Open