-
Notifications
You must be signed in to change notification settings - Fork 6.3k
8347007: --strip-debug removes parameter names included with -parameters #27566
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
/csr |
👋 Welcome back henryjen! A progress list of the required criteria for merging this PR into |
❗ This change is not yet ready to be integrated. |
@slowhog has indicated that a compatibility and specification (CSR) request is needed for this pull request. @slowhog please create a CSR request for issue JDK-8347007 with the correct fix version. This pull request cannot be integrated until the CSR request is approved. |
Webrevs
|
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.
Is there a documentation change needed on the tool's doc page?
src/jdk.jlink/share/classes/jdk/tools/jlink/internal/TaskHelper.java
Outdated
Show resolved
Hide resolved
this.stripNativePluginFactory = nativeStripPluginFact; | ||
} | ||
|
||
public void enableJavaStripPlugin(boolean enableJavaStripPlugin) { |
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.
This method name specifically implies enabling. Maybe "setEnabled..."?
...jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java
Outdated
Show resolved
Hide resolved
...jdk.jlink/share/classes/jdk/tools/jlink/internal/plugins/StripJavaDebugAttributesPlugin.java
Outdated
Show resolved
Hide resolved
|
||
MethodTransform mt; | ||
if (isDroppingMethodNames) { | ||
mt = MethodTransform.dropping(me -> me instanceof MethodParametersAttribute) |
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.
I know this is already existing behavior, but removing the attribute doesn't just remove the parameter names but also the parameter flags. This results in the same bug that was fixed by https://bugs.openjdk.org/browse/JDK-8292275 (or for a more compact description, see the CSR https://bugs.openjdk.org/browse/JDK-8292467).
But that should be addressed separately.
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 bring in this up. Do not support removal of MethodParameters attribute for now. If there is a need to support that, we can add a separate plugin to address optional attributes for JVM.
/csr remove |
/csr unneeded |
Since parameters is an opt-in choice, it's more reasonable to consider that's desired information and make strip parameter names an opt-in choice as well.
This PR changes the default behavior of --strip-debug to keep parameter names when it's available. Add opt-in mechanism,
via the strip-java-debug-attributes plugin by using argument
--strip-java-debug-attributes=+parameter-names
.The --strip-debug option is a little bit odd, as it's a main option as well as a plugin option to enable the DefaultStripDebugPlugin, which strip native debug information on platform support the feature, and strip java debug information. In this PR, we chose to support only one mechanism to enable strip parameter names, so we would disable the embed StripJavaDebugAttributesPlugin when StripJavaDebugAttributesPlugin is enabled.
The StripParameterNamesTest illustrate and verify parameter names use cases, mainly focus on argument processing and the parameter names. We didn't verify the regular debug info as that's covered by existing test.
-- Update
The latest change removed the support of strip parameter names, as the MethodParameters attribute is considered necessary attribute to fulfill Java Language Spec even though this attribute is considered optional by JVM spec.
Progress
Issue
Reviewing
Using
git
Checkout this PR locally:
$ git fetch https://git.openjdk.org/jdk.git pull/27566/head:pull/27566
$ git checkout pull/27566
Update a local copy of the PR:
$ git checkout pull/27566
$ git pull https://git.openjdk.org/jdk.git pull/27566/head
Using Skara CLI tools
Checkout this PR locally:
$ git pr checkout 27566
View PR using the GUI difftool:
$ git pr show -t 27566
Using diff file
Download this PR as a diff file:
https://git.openjdk.org/jdk/pull/27566.diff
Using Webrev
Link to Webrev Comment