On Thu, 16 Oct 2025 22:29:55 GMT, Serguei Spitsyn <[email protected]> wrote:
>> test/hotspot/jtreg/serviceability/EarlyDynamicLoad/libEarlyDynamicLoad.c
>> line 38:
>>
>>> 36: static void JNICALL VMStartJcmd(jvmtiEnv* jvmti, JNIEnv* env) {
>>> 37: char cmd[256];
>>> 38: snprintf(cmd, sizeof(cmd), "%s %d JVMTI.agent_load some.jar",
>>> getenv("JCMD_PATH"), PID());
>>
>> Wouldn't be easier to have single env variable like ATTACH_CMD `.../bin/jcmd
>> 45678 JVMTI.agent_load some.jar` which is completely set by java? So native
>> code is simplified and there are less dependencies.
>
> Also, I'd suggest to convert native part from C to C++. Some examples in the
> test base can be found easily. There is already a number of tests with C
> based native agents. We need to convert them to C++ at some point.
Thanks for the suggestion, I changed the test structure so this is not
applicable anymore.
Also, converted the native part to c++: 1af09f8ba080416b94aeb947da3a6be1acf9167d
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/27766#discussion_r2440490778