All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class harpoon.ClassFile.Raw.Attribute.AttributeLocalVariableTable

java.lang.Object
   |
   +----harpoon.ClassFile.Raw.Attribute.Attribute
           |
           +----harpoon.ClassFile.Raw.Attribute.AttributeLocalVariableTable

public class AttributeLocalVariableTable
extends Attribute
The LocalVariableTable attribute is an optional variable-length attribute of a Code attribute. It may be used by debuggers to determine the value of a given local variable during the execution of a method. If LocalVariableTable attributes are present in the attributes table of a given Code attribute, then they may appear in any order. There may be no more than one LocalVariableTable attribute per local variable in the Code attribute.

This object represents a table mapping local variable indexes to symbolic names. This attribute is optional; typically it is not included unless debugging flags are given to the compiler.

Version:
$Id: AttributeLocalVariableTable.java,v 1.13 1998/10/11 03:01:13 cananian Exp $
Author:
C. Scott Ananian <cananian@alumni.princeton.edu>
See Also:
AttributeCode, Attribute

Variable Index

 o local_variable_table
Each entry in the local_variable_table array indicates a range of code offsets within which a local variable has a value.

Constructor Index

 o AttributeLocalVariableTable(ClassFile, int, LocalVariableTable[])
Constructor.

Method Index

 o attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.
 o local_variable_table_length()
 o localName(int, int)
Get the (debugging) name of a local variable.
 o print(PrintWriter, int)
Pretty-print the contents of this attribute.
 o write(ClassDataOutputStream)
Write to bytecode stream.

Variables

 o local_variable_table
 public LocalVariableTable local_variable_table[]
Each entry in the local_variable_table array indicates a range of code offsets within which a local variable has a value. It also indicates the index into the local variables of the current frame at which that local variable can be found.

Constructors

 o AttributeLocalVariableTable
 public AttributeLocalVariableTable(ClassFile parent,
                                    int attribute_name_index,
                                    LocalVariableTable local_variable_table[])
Constructor.

Methods

 o attribute_length
 public long attribute_length()
The value of the attribute_length item indicates the length of the attribute, excluding the initial six bytes.

Overrides:
attribute_length in class Attribute
 o local_variable_table_length
 public int local_variable_table_length()
 o write
 public void write(ClassDataOutputStream out) throws IOException
Write to bytecode stream.

Overrides:
write in class Attribute
 o localName
 public String localName(int pc,
                         int index)
Get the (debugging) name of a local variable.

Parameters:
pc - the pc at which the inquiry is being made.
index - the index of the local variable to query.
Returns:
the name of the index'th local variable, or null if none can be found.
 o print
 public void print(PrintWriter pw,
                   int indent)
Pretty-print the contents of this attribute.

Parameters:
indent - the indentation level to use.
Overrides:
print in class Attribute

All Packages  Class Hierarchy  This Package  Previous  Next  Index