-XX:HitachiCallToString (Option to output the local variable information)
Format
-XX:HitachiCallToString=applicable-range
Description
The character string of a String object obtained for the local variable object from the class corresponding to the applicable-range is output as a character string that represents the variable value.
Note that if no objects are stored in the local variable, or if the object is a JavaVM internal object, the local variable information is not output.
- Default value
- -XX:HitachiCallToString=minimal
- Prerequisite options
- -XX:+HitachiLocalsInThrowable
Argument
- applicable-range
- Specify minimal or full.
- minimal
- The following classes in the java.lang package are applicable:
- String
- StringBuffer
- Boolean
- Byte
- Character
- Short
- Integer
- Long
- Float
- Double
- Note that, even when null character ("") is specified, the applicable range will be same as "minimal".
- full
- All the classes and array types are applicable.
Examples of output
The following is an example of output (simple output format) using the Java program example 3:
- For -XX:HitachiCallToString=minimal
at Example3.method(Example3.java:18)
locals:
(Example3) this = <0xaa07db58>
(java.lang.String) l1 = <0xae173a28> "local 1"
(java.lang.StringBuffer) l2 = <0xaa07dca0> "local 1 + local 2"
(java.lang.Boolean) l3 = <0xaa07de18> "false"
(java.lang.Character) l4 = <0xaa07df68> "X"
(java.lang.Long) l5 = <0xaa07e078> "-9223372036854775808"
(java.lang.Object) l6 = <0xaa07e1a8>
(java.lang.Object[]) l7 = <0xaa07e298>
at Example3.main(Example3.java:4)
locals:
... |
- For -XX:HitachiCallToString=full
at Example3.method(Example3.java:18)
locals:
(Example3) this = <0xaa07db58> "I am an Example3 instance."
(java.lang.String) l1 = <0xae173a28> "local 1"
(java.lang.StringBuffer) l2 = <0xaa07dca0> "local 1 + local 2"
(java.lang.Boolean) l3 = <0xaa07de18> "false"
(java.lang.Character) l4 = <0xaa07df68> "X"
(java.lang.Long) l5 = <0xaa07e078> "-9223372036854775808"
(java.lang.Object) l6 = <0xaa07e1a8> "Thread[Thread-0,5,main]"
(java.lang.Object[]) l7 = <0xaa07e298> "[Ljava.lang.Thread;@26e431"
at Example3.main(Example3.java:4)
locals:
... |
Precautions
- To collect complete local variable information, while you are creating the class file in javac, you need to add the -g option or the -g:vars option and fill the local variable information in the class file. For the class file created without adding the -g option or the -g:vars option, the local variable information is output in the collectable range.
- When you specify this option and execute a Java program using AWT or Swing, specify minimal (default) in applicable-range. If you specify full in applicable-range, the program might not operate correctly.