Hitachi

Hitachi Application Server V10 Definition Reference Guide (For UNIX® Systems)


7.10.3 -XX:[+|-]HitachiLocalsInThrowable

-XX:[+|-]HitachiLocalsInThrowable outputs the local variable information of the methods in the stack traces.

Description

-XX:[+|-]HitachiLocalsInThrowable collects the local variable information of the methods in the stack traces when the java.lang.Throwable.fillInStackTrace method is executed.

Format of output
    locals: 
      name:  name
      type:  type
      value:  value
...
  • In the first line, locals: is output as the header.

  • From second line onwards, information about collected local variables is output to one line for each variable.

The following information about local variables is output:

  1. Variable name

  2. Type name (basic type name, class name or array type name)

  3. Character string that indicates a variable value

Note that the content output for each local variable is delimited by blank lines.

Output item

Output content

name

Local variable name.

If this variable is passed to a method, [arg***] (*** indicates the argument number) appears after the variable name.

type

Type of the local variable (basic type, class name, or array type).

value

String that represents the value of the local variable.

  • Basic type

    Character string that is generated by converting the value

  • Class or array type

    When the variable is null:(null)

    Other: address_where_the_object_exists

The maximum number of characters that represent the value is 64. If the maximum number is exceeded, the first 64 characters and the character string "..." are output. For class or array type, you can add more detailed expressions by specifying the following additional options:

  • -XX:+HitachiLocalsSimpleFormat

  • -XX:+HitachiTrueTypeInLocals

  • -XX:HitachiCallToString

Syntax

-XX:[+|-]HitachiLocalsInThrowable

Specifiable values

Type: String

-XX:+HitachiLocalsInThrowable

Outputs the local variable information of the methods in the stack trace.

This option is ignored when java.lang.StackOverflowError occurs.

-XX:-HitachiLocalsInThrowable

Does not output the local variable information of the methods in the stack trace.

Default value

If the definition item is omitted:

-XX:-HitachiLocalsInThrowable

Examples

Examples of output (in the simple output format) when the following Java program example is used are shown below.

Java program example
class Example1 {
    public static void main(String[] args) {
        Example1 e1 = new Example1();
        Object obj = new Object();
        e1.method(1, 'Q', obj);  // 5th line
    }
 
    void method(int l1, char l2, Object l3) {
        float l4 = 4.0f;
        boolean l5 = true;
        double l6 = Double.MAX_VALUE; // Maximum value of the double data type
        Object[] l7 = new Object[10];
 
        try {
          <An exception occurred!>  // 15th line
        } catch (Exception e) {
          e.printStackTrace();
        }
    }
}
Example of output 1

When all local variable information is output:

  at Example1.method(Example1.java:15)
    locals: 
      name:  this
      type:  Example1
      value:  <0x922f42d0>
  
      name:  l1 [arg1]
      type:  int
      value:  1
  
      name:  l2 [arg2]
      type; char
      value:  'Q'
  
      name:  l3 [arg3]
      type:  java.lang.Object
      value:  <0xaf112f08>
  
      name:  l4
      type:  float
      value:  4
  
      name:  l5
      type:  boolean
      value:  true
  
      name:  l6
      type:  double
      value:  1.79769E+308
  
      name:  l7
      type:  java.lang.Object[]
      value:  <0x922f42d8>
  
  at Example1.main(Example1.java:5)
    locals: 
...
Example of output 2

When no local variable information exists:

  • When the class file is generated without specifying the -g option or the -g:vars option.

  • The native method of a class file is generated by specifying the -g option or the -g:vars option.

      at Example1.method(Example1.java:15)
        locals: 
          name:  this
          type:  Example1
          value:  <0x922f42d0>
      
          name:  [arg1]
          type:  int
          value:  1
      
          name:  [arg2]
          type; char
          value:  'Q'
      
          name:  [arg3]
          type:  java.lang.Object
          value:  <0xaf112f08>
      
      at Example1.main(Example1.java:5)
        locals: 
    ...

Notes