-
Notifications
You must be signed in to change notification settings - Fork 6.2k
8374168: Resolve disabled warnings in JDWP agent #28937
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
|
👋 Welcome back amenkov! A progress list of the required criteria for merging this PR into |
|
@alexmenkov This change now passes all automated pre-integration checks. ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details. After integration, the commit message for the final commit will be: You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed. At the time when this comment was updated there had been 84 new commits pushed to the
As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details. ➡️ To integrate this PR with the above commit message to the |
|
@alexmenkov The following labels will be automatically applied to this pull request:
When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command. |
Webrevs
|
sspitsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good. Posted one nit.
| jvmtiCompileTimeMajorVersion = ((int)JVMTI_VERSION & (int)JVMTI_VERSION_MASK_MAJOR) | ||
| >> (int)JVMTI_VERSION_SHIFT_MAJOR; | ||
| jvmtiCompileTimeMinorVersion = ((int)JVMTI_VERSION & (int)JVMTI_VERSION_MASK_MINOR) | ||
| >> (int)JVMTI_VERSION_SHIFT_MINOR; | ||
| jvmtiCompileTimeMicroVersion = ((int)JVMTI_VERSION & (int)JVMTI_VERSION_MASK_MICRO) | ||
| >> (int)JVMTI_VERSION_SHIFT_MICRO; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you explain the need for this. These types are all naturally jints, so I'm not sure why you would need to cast them here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are enums (i.e. ints) , GHA on Windows fail because they are 3 different enum types (warning 5287)
For unknown reason (different MSVC version maybe) my local Windows build and our CI passed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These are enums (i.e. ints) , GHA on Windows fail because they are 3 different enum types (warning 5287)
For unknown reason (different MSVC version maybe) my local Windows build and our CI passed
This code that we have elsewhere in the debug agent seems to compile ok. Perhaps all that is needed is a cast of JVMTI_VERSION to jint:
static jboolean isVersionGte12x() {
jint version;
jvmtiError err =
JVMTI_FUNC_PTR(gdata->jvmti,GetVersionNumber)(gdata->jvmti, &version);
if (err == JVMTI_ERROR_NONE) {
jint major, minor;
major = (version & JVMTI_VERSION_MASK_MAJOR)
>> JVMTI_VERSION_SHIFT_MAJOR;
minor = (version & JVMTI_VERSION_MASK_MINOR)
>> JVMTI_VERSION_SHIFT_MINOR;
return (major > 1 || (major == 1 && minor >= 2)) ? JNI_TRUE : JNI_FALSE;
} else {
return JNI_FALSE;
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similarly, no warnings for JvmtiExport::decode_version_values()
jdk/src/hotspot/share/prims/jvmtiExport.cpp
Lines 643 to 648 in e1d81c0
| JvmtiExport::decode_version_values(jint version, int * major, int * minor, | |
| int * micro) { | |
| *major = (version & JVMTI_VERSION_MASK_MAJOR) >> JVMTI_VERSION_SHIFT_MAJOR; | |
| *minor = (version & JVMTI_VERSION_MASK_MINOR) >> JVMTI_VERSION_SHIFT_MINOR; | |
| *micro = (version & JVMTI_VERSION_MASK_MICRO) >> JVMTI_VERSION_SHIFT_MICRO; | |
| } |
where the version is a
jint.And
jint does seem like the natural type here.
sspitsyn
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for the updates. Looks good.
erikj79
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Build change looks good.
|
With the latest version GHA Windows-x64 build still fails: |
|
Looks like this is a bug in MSVC: https://developercommunity.visualstudio.com/t/warning-C5287:-operands-are-different-e/10877942 |
The fix resolves disabled warnings in debugger agent
Progress
Issue
Reviewers
Reviewers without OpenJDK IDs
Reviewing
Using
gitCheckout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/28937/head:pull/28937$ git checkout pull/28937Update a local copy of the PR:
$ git checkout pull/28937$ git pull https://git.openjdk.org/jdk.git pull/28937/headUsing Skara CLI tools
Checkout this PR locally:
$ git pr checkout 28937View PR using the GUI difftool:
$ git pr show -t 28937Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/28937.diff
Using Webrev
Link to Webrev Comment