RFR: 8287812: Cleanup JDWP agent GetEnv initialization
Chris Plummer
cjplummer at openjdk.org
Fri Dec 9 01:27:42 UTC 2022
On Fri, 9 Dec 2022 00:27:47 GMT, David Holmes <dholmes at openjdk.org> wrote:
> > (2) JVMTI_VERSION_1 suggests that the JDWP agent is looking for a JVMTI v1 environment when it really wants the latest.
>
> Does it? I guess it is a somewhat moot point inside the same VM but don't you only need to ask for the version of the environment that supports the API you are going to use?
Yes, but why would we need to allow the debug agent to bind to a version of JVMTI other than the one it was built with? I think there might be some historical context here that I'm missing. I know in the past there has been some conditional code in the debug agent based on what features JVMTI supports. For example, SuspendThreadList. I removed the code that was needed if SuspendThreadList was not supported, and we now assume that it is supported. Maybe the debug agent built by Oracle (probably actually Sun at the time) was also used by other JVMs, and was expected to work with older versions of JVMTI. I doubt that is the case anymore.
-------------
PR: https://git.openjdk.org/jdk/pull/11602
More information about the serviceability-dev
mailing list