We need an option to print out shared archive information. Say, -XX:+PrintSharedArchiveAndExit to just print out the contents in the archive.
It should do the following internally:
1) Enable -Xshare:on and -XX:+TraceClassPaths
2) Attempt to load and validate the archive
3) When a mismatch is encountered (e.g., a JAR file's modification date has been changed), print out the error information but continue
a) However, since -cp is not specified (it's default to be ""), it will always mismatch. So do not print this out to avoid confusion
b) If user specifies -cp. print "-cp should not be specified when using -XX:+PrintSharedArchiveAndExit" and exit
c) Similarly, bootclasspath and java_ext_dir may mismatch. Do not print these are errors (maybe just as warnings).
4) Also, as an extra, print out the entire content of the shared dictionary, so that we know what classes are stored in this archive
5) Also, print out the size statics of the symbol table
6) Do not attempt to map the archive. Exit the JVM.