com.cmpware.elf
Class Tag

java.lang.Object
  extended by com.cmpware.elf.Tag

public class Tag
extends java.lang.Object

This class describes the DWARF2 "tag" data structure.

Copyright (c) 2005 Cmpware, Inc. All Rights Reserved.

Author:
SAG

Field Summary
 int abbrevCode
          The abbrev code (for abbrev table)
 java.util.Hashtable attributes
          Tha attribute table (attribute name / value pairs)
 int compileUnitOffset
          The Compile Unit offset in bytes
 byte hasChildren
          The has children flag
 java.util.Hashtable lineNumber
          The line number table (line number / address pairs)
 Tag next
          The next tag in the list
 int offset
          The Tag offset in bytes
 int tagCode
          The tag code
 Tag typeTag
          The type tag
 
Constructor Summary
Tag()
           
 
Method Summary
static java.lang.Object getAttr(Tag tag, int attrCode)
          This method returns a tag's attribute given the tag code.
static int getIntAttr(Tag tag, int attrCode)
          This method returns a tag's attribute given the tag code.
static boolean hasAttr(Tag tag, int attrCode)
          This method returns true if a given attribute exists in the tag and false otherwise.
 boolean isNull()
          The method returns true if the tag is null and false otherwise.
 java.lang.String toString()
          This method returns a string representation of the DWARF tag data.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

compileUnitOffset

public int compileUnitOffset
The Compile Unit offset in bytes


offset

public int offset
The Tag offset in bytes


tagCode

public int tagCode
The tag code


hasChildren

public byte hasChildren
The has children flag


abbrevCode

public int abbrevCode
The abbrev code (for abbrev table)


next

public Tag next
The next tag in the list


typeTag

public Tag typeTag
The type tag


attributes

public java.util.Hashtable attributes
Tha attribute table (attribute name / value pairs)


lineNumber

public java.util.Hashtable lineNumber
The line number table (line number / address pairs)

Constructor Detail

Tag

public Tag()
Method Detail

hasAttr

public static boolean hasAttr(Tag tag,
                              int attrCode)
This method returns true if a given attribute exists in the tag and false otherwise.

Parameters:
tag - The tag.
attrCode - The attribute code.
Returns:
This method returns true if a given attribute exists in the tag and false otherwise.

getAttr

public static java.lang.Object getAttr(Tag tag,
                                       int attrCode)
This method returns a tag's attribute given the tag code. The attribute is returned as an Object and should be converted to the proper type (typically String or byte[]).

Parameters:
tag - The tag.
attrCode - The attribute code.
Returns:
This method returns a tag's attribute value given the attribute code.

getIntAttr

public static int getIntAttr(Tag tag,
                             int attrCode)
This method returns a tag's attribute given the tag code. If the attribute is not an integer or if the attribute does not exist for this tag, a zero is returned.

Parameters:
tag - The tag.
attrCode - The attribute code.
Returns:
This method returns a tag's attribute value given the attribute code.

toString

public java.lang.String toString()
This method returns a string representation of the DWARF tag data.

Overrides:
toString in class java.lang.Object
Returns:
This method returns a string representation of the DWARF tag data.

isNull

public boolean isNull()
The method returns true if the tag is null and false otherwise.

Returns:
The method returns true if the tag is null and false otherwise.