Top Description Inners Fields Constructors Methods
jdk.tools.jlink.internal.plugins

public final Class StripNativeDebugSymbolsPlugin

extends AbstractPlugin
Class Inheritance
Imports
java.io.InputStream, .IOException, java.lang.ProcessBuilder.Redirect, java.nio.file.FileVisitResult, .Files, .InvalidPathException, .Path, .Paths, .SimpleFileVisitor, java.nio.file.attribute.BasicFileAttributes, java.util.ArrayList, .Arrays, .HashMap, .List, .Locale, .Map, .MissingResourceException, .Objects, .Optional, .ResourceBundle, jdk.tools.jlink.plugin.PluginException, .ResourcePool, .ResourcePoolBuilder, .ResourcePoolEntry

Platform specific jlink plugin for stripping debug symbols from native libraries and binaries.

Nested and Inner Type Summary

Modifier and TypeClass and Description
private static class
public static interface
private static class
private static class

Field Summary

Modifier and TypeField and Description
private final StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder
private static final boolean
private String
private static final String
private static final String
private static final String
private boolean
private static final String
public static final String
private static final String
private static final ResourceBundle
private static final String
private static final String
private static final String
private String
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
DESCRIPTIONUSAGE

Constructor Summary

AccessConstructor and Description
public
public

Method Summary

Modifier and TypeMethod and Description
public void
configure(Map<String, String>
The plugin configuration.
config
)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration.

public void
doConfigure(boolean withChecks, Map<String, String> orig)

public Plugin.Category
getType()

Overrides default jdk.tools.jlink.plugin.Plugin.getType.

The type of this plugin.

public boolean
hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments?

private void
logError(ResourcePoolEntry resource, String msgKey)

public ResourcePool
transform(ResourcePool
Read only content.
in
,
ResourcePoolBuilder
The pool to fill with content. This pool must contain the result of the visit.
out
)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.

private void
Inherited from jdk.tools.jlink.internal.plugins.AbstractPlugin:
getArgumentsDescriptiongetDescriptiongetMessagegetNamegetUsagenewClassReadernewClassReader

Field Detail

cmdBuilderback to summary
private final StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder cmdBuilder
DEBUGback to summary
private static final boolean DEBUG
debuginfoExtback to summary
private String debuginfoExt
DEFAULT_DEBUG_EXTback to summary
private static final String DEFAULT_DEBUG_EXT
DEFAULT_STRIP_CMDback to summary
private static final String DEFAULT_STRIP_CMD
EXCLUDE_DEBUG_INFO_ARGback to summary
private static final String EXCLUDE_DEBUG_INFO_ARG
includeDebugSymbolsback to summary
private boolean includeDebugSymbols
KEEP_DEBUG_INFO_ARGback to summary
private static final String KEEP_DEBUG_INFO_ARG
NAMEback to summary
public static final String NAME
ONLY_KEEP_DEBUG_SYMS_OPTback to summary
private static final String ONLY_KEEP_DEBUG_SYMS_OPT
resourceBundleback to summary
private static final ResourceBundle resourceBundle
SHARED_LIBS_EXTback to summary
private static final String SHARED_LIBS_EXT
STRIP_CMD_ARGback to summary
private static final String STRIP_CMD_ARG
STRIP_DEBUG_SYMS_OPTback to summary
private static final String STRIP_DEBUG_SYMS_OPT
stripBinback to summary
private String stripBin

Constructor Detail

StripNativeDebugSymbolsPluginback to summary
public StripNativeDebugSymbolsPlugin()
StripNativeDebugSymbolsPluginback to summary
public StripNativeDebugSymbolsPlugin(StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder cmdBuilder)

Method Detail

configureback to summary
public void configure(Map<String, String> config)

Overrides default jdk.tools.jlink.plugin.Plugin.configure.

Doc from jdk.tools.jlink.plugin.Plugin.configure.

Configure the plugin based on the passed configuration. This method is called prior to invoke the plugin.

Parameters
config:Map<String, String>

The plugin configuration.

Annotations
@Override
doConfigureback to summary
public void doConfigure(boolean withChecks, Map<String, String> orig)
getTypeback to summary
public Plugin.Category getType()

Overrides default jdk.tools.jlink.plugin.Plugin.getType.

Doc from jdk.tools.jlink.plugin.Plugin.getType.

The type of this plugin.

Returns:Plugin.Category

The type of this plugin

Annotations
@Override
hasArgumentsback to summary
public boolean hasArguments()

Overrides default jdk.tools.jlink.plugin.Plugin.hasArguments.

Doc from jdk.tools.jlink.plugin.Plugin.hasArguments.

Has this plugin require one or more arguments? A plugin can have one or more optional arguments.
A plugin option with a single argument is specified as follows:

     --plugin-option=arg_value
 
If there are more than arguments, command line option looks like:
     --plugin-option=arg_value:arg2=value2:arg3=value3...
Returns:boolean

true if arguments are needed.

Annotations
@Override
logErrorback to summary
private void logError(ResourcePoolEntry resource, String msgKey)
transformback to summary
public ResourcePool transform(ResourcePool in, ResourcePoolBuilder out)

Implements jdk.tools.jlink.plugin.Plugin.transform.

Doc from jdk.tools.jlink.plugin.Plugin.transform.

Visit the content of the modules that are composing the image.

Parameters
in:ResourcePool

Read only content.

out:ResourcePoolBuilder

The pool to fill with content. This pool must contain the result of the visit.

Annotations
@Override
validateStripArgback to summary
private void validateStripArg(String stripArg) throws IllegalArgumentException
jdk.tools.jlink.internal.plugins back to summary

private final Class StripNativeDebugSymbolsPlugin.DefaultObjCopyCmdBuilder

extends Object
implements ObjCopyCmdBuilder
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.DefaultObjCopyCmdBuilder
All Implemented Interfaces
jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public List<String>
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

DefaultObjCopyCmdBuilderback to summary
private DefaultObjCopyCmdBuilder()

Method Detail

buildback to summary
public List<String> build(String objCopy, String... options)

Implements jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder.build.

Annotations
@Override
jdk.tools.jlink.internal.plugins back to summary

public Interface StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder

Known Direct Implementers
jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.DefaultObjCopyCmdBuilder

Method Summary

Modifier and TypeMethod and Description
public List<String>
build(String objCopy, String... options)

Method Detail

buildback to summary
public List<String> build(String objCopy, String... options)
jdk.tools.jlink.internal.plugins back to summary

private Class StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinary

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinary

Field Summary

Modifier and TypeField and Description
private final Optional<ResourcePoolEntry>
private final ResourcePoolEntry

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
public Optional<ResourcePoolEntry>
public ResourcePoolEntry
Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

debugSymbolsback to summary
private final Optional<ResourcePoolEntry> debugSymbols
strippedBinaryback to summary
private final ResourcePoolEntry strippedBinary

Constructor Detail

StrippedDebugInfoBinaryback to summary
private StrippedDebugInfoBinary(ResourcePoolEntry strippedBinary, Optional<ResourcePoolEntry> debugSymbols)

Method Detail

debugSymbolsback to summary
public Optional<ResourcePoolEntry> debugSymbols()
strippedBinaryback to summary
public ResourcePoolEntry strippedBinary()
jdk.tools.jlink.internal.plugins back to summary

private Class StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinaryBuilder

extends Object
Class Inheritance
  • java.lang.Object
  • jdk.tools.jlink.internal.plugins.StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinaryBuilder

Field Summary

Modifier and TypeField and Description
private final StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder
private final String
private final boolean
private final String

Constructor Summary

AccessConstructor and Description
private

Method Summary

Modifier and TypeMethod and Description
private Optional<StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinary>
private byte[]
createDebugSymbolsFile(Path binPath, Path debugPath, String dbgFileName)

private ProcessBuilder
private void
private boolean
stripBinary(Path binFile)

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

cmdBuilderback to summary
private final StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder cmdBuilder
debugExtback to summary
private final String debugExt
includeDebugback to summary
private final boolean includeDebug
stripback to summary
private final String strip

Constructor Detail

StrippedDebugInfoBinaryBuilderback to summary
private StrippedDebugInfoBinaryBuilder(boolean includeDebug, String debugExt, StripNativeDebugSymbolsPlugin.ObjCopyCmdBuilder cmdBuilder, String strip)

Method Detail

buildback to summary
private Optional<StripNativeDebugSymbolsPlugin.StrippedDebugInfoBinary> build(ResourcePoolEntry resource)
createDebugSymbolsFileback to summary
private byte[] createDebugSymbolsFile(Path binPath, Path debugPath, String dbgFileName) throws InterruptedException, IOException
createProcessBuilderback to summary
private ProcessBuilder createProcessBuilder(List<String> cmd)
deleteDirRecursivelyIgnoreResultback to summary
private void deleteDirRecursivelyIgnoreResult(Path tempDir)
stripBinaryback to summary
private boolean stripBinary(Path binFile) throws InterruptedException, IOException