On Thu, 22 Oct 2026 22:04:50 GMT, Chris Plummer <[email protected]> wrote:

> I noticed under src/jdk.hotspot.agent/macosx/native/libsaproc/ we still have 
> a bunch of FreeBSD native code. You'll find it within #ifdef's like the 
> following:
> 
> #ifdef __APPLE__
> // macosx code
> #else
> // FreeBSD code
> #endif
> 
> The #else part is only needed for the FreeBSD port, which is now located 
> under src/jdk.hotspot.agent/bsd/native/libsaproc/ (in the jdk freebsd repo). 
> All of it can be deleted, and I got approval from the bsd team to do this. It 
> is a fairly large chunk of code, and removing it will make browsing the 
> macosx code simpler. No more false grep hits.
> 
> ---------
> - [x] I confirm that I make this contribution in accordance with the [OpenJDK 
> Interim AI Policy](https://openjdk.org/legal/ai).

src/jdk.hotspot.agent/share/native/libsaproc/ps_core_common.c line 43:

> 41: #include "sun_jvm_hotspot_debugger_amd64_AMD64ThreadContext.h"
> 42: #endif
> 43: 

This change needs a little explaining. It turns out this include is only needed 
to trigger including <jni.h>. This include file is generated for all builds, so 
it was being included on macosx for both amd64 and aarch64 builds. I removed 
this include and instead include <jni.h> from 
`src/jdk.hotspot.agent/macosx/native/libsaproc/libsaproc.h`, which is where the 
linux port includes <jni.h> from (although the file is called libproc.h for 
linux).

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/33524#discussion_r4354050998

Reply via email to