lib.dwfl
Class DwarfDie

java.lang.Object
  extended by lib.dwfl.DwarfDie
Direct Known Subclasses:
DwflDie

public class DwarfDie
extends Object


Method Summary
 void addOps(int operator, int operand1, int operand2, int offset)
           
 void addScopeVarName(String name)
           
 List getAddr()
           
 boolean getAttrBoolean(DwAt attr)
           
 int getAttrConstant(DwAt attr)
           
 String getAttrString(DwAt attr)
           
 DwarfDie getChild()
           
 long getDataMemberLocation()
           
static DwarfDie getDecl(Dwarf dw, String sym)
          Get die for static symbol sym in dw.
 int getDeclColumn()
           
static DwarfDie getDeclCU(DwarfDie[] scopes, String sym)
          Get die for static symbol sym in CU dw.
 File getDeclFile()
           
 int getDeclLine()
           
 DwarfDie getDefinition()
           
 ArrayList getEntryBreakpoints()
           
 long getEntryPc()
           
 List getFormData(long pc)
           
 List getFrameBase(long pc)
           
 long getHighPC()
           
 ArrayList getInlinedInstances()
           
 long getLowPC()
           
 String getName()
           
 long getOffset()
           
 DwarfDie getOriginalDie()
          If this die has a DW_AT_abstract_origin or DW_AT_specification this function returns the die pointed to by those attributes.
 String getProducer()
           
 long getScope(int index)
           
 long getScopeIndex()
           
 DwarfDie[] getScopes(long addr)
          This function assumes that this die is a one corresponding to a Compilation Unit Die.
 DwarfDie[] getScopesDie()
          Return the scopes containing this die.
 DwarfDie getScopeVar(DwarfDie[] scopes, String variable)
           
 List getScopeVarNames(DwarfDie[] scopes, String variable)
           
 DwarfDie getSibling()
           
 DwTag getTag()
           
 DwarfDie getType()
           
 DwarfDie getUltimateType()
           
 boolean hasAttribute(DwAt attr)
           
 boolean isDeclaration()
           
 boolean isDefinitionOnly()
          returns true of this die represents a definition of an object, and the declaration is somewhere else.
 boolean isInlineDeclaration()
           
 boolean isInlinedFunction()
           
 void setManageDie(boolean value)
           
 void setScopes(DwarfDie[] scopes)
           
 StringBuilder toPrint()
           
 String toString()
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getHighPC

public long getHighPC()

getLowPC

public long getLowPC()

getEntryPc

public long getEntryPc()
Returns:
entry pc or low pc if this die

getName

public String getName()

getProducer

public String getProducer()

getDeclFile

public File getDeclFile()

getDeclLine

public int getDeclLine()

getDeclColumn

public int getDeclColumn()

setScopes

public void setScopes(DwarfDie[] scopes)

setManageDie

public void setManageDie(boolean value)

getScopes

public DwarfDie[] getScopes(long addr)
This function assumes that this die is a one corresponding to a Compilation Unit Die. It will return the scopes containing the give address which fall within this Compilation Unit Die.

Parameters:
addr - PC address.
Returns:
Scope DwarfDies containing addr.
See Also:
getScopesDie

getScopesDie

public DwarfDie[] getScopesDie()
Return the scopes containing this die.

Returns:
Scope DwarfDies containing this die.

getScopeVar

public DwarfDie getScopeVar(DwarfDie[] scopes,
                            String variable)
Parameters:
scopes -
variable -
Returns:
Die of variable in scopes

getScopeVarNames

public List getScopeVarNames(DwarfDie[] scopes,
                             String variable)
Parameters:
scopes -
variable -
Returns:
List of names in scopes matching variable

addScopeVarName

public void addScopeVarName(String name)

addOps

public void addOps(int operator,
                   int operand1,
                   int operand2,
                   int offset)

getScopeIndex

public long getScopeIndex()
Returns:
Scopes index of this die.

getScope

public long getScope(int index)
Parameters:
index - Scopes index.
Returns:
Die of scope.

getAddr

public List getAddr()
Parameters:
Return - address of die. Typically this is a static address or ptr+disp.

getUltimateType

public DwarfDie getUltimateType()
Returns:
The type die for the current die, following all typedefs.

getType

public DwarfDie getType()
Returns:
The type die for the current die.

getAttrBoolean

public boolean getAttrBoolean(DwAt attr)

getAttrString

public String getAttrString(DwAt attr)

getTag

public DwTag getTag()

getAttrConstant

public int getAttrConstant(DwAt attr)
Returns:
The upper bound for this subrange die.

getOffset

public long getOffset()
Returns:
The offset for this die.

getChild

public DwarfDie getChild()
Returns:
The child for the current die.

getSibling

public DwarfDie getSibling()
Returns:
The sibling for the current die.

getFrameBase

public List getFrameBase(long pc)
Parameters:
pc - Program Counter
Returns:
DW_AT_frame_base for current die.

getFormData

public List getFormData(long pc)
Parameters:
pc - - PC
Returns:
DW_FORM_data for current die. Typically this is from a location list.

getDataMemberLocation

public long getDataMemberLocation()

isInlinedFunction

public boolean isInlinedFunction()
Returns:
True if this is an inlined instance of a function, false otherwise

hasAttribute

public boolean hasAttribute(DwAt attr)

toString

public String toString()
Overrides:
toString in class Object

toPrint

public StringBuilder toPrint()

getDecl

public static DwarfDie getDecl(Dwarf dw,
                               String sym)
Get die for static symbol sym in dw.

Parameters:
dw -
sym -
Returns:
die

getDeclCU

public static DwarfDie getDeclCU(DwarfDie[] scopes,
                                 String sym)
Get die for static symbol sym in CU dw.

Parameters:
scopes -
sym -
Returns:
die

getOriginalDie

public DwarfDie getOriginalDie()
If this die has a DW_AT_abstract_origin or DW_AT_specification this function returns the die pointed to by those attributes.


isDefinitionOnly

public boolean isDefinitionOnly()
returns true of this die represents a definition of an object, and the declaration is somewhere else.

Returns:

isDeclaration

public boolean isDeclaration()

getDefinition

public DwarfDie getDefinition()

getEntryBreakpoints

public ArrayList getEntryBreakpoints()

isInlineDeclaration

public boolean isInlineDeclaration()

getInlinedInstances

public ArrayList getInlinedInstances()