com.cmpware.elf.dwarf2
Class LocationList

java.lang.Object
  extended by com.cmpware.elf.dwarf2.RangeLookupList
      extended by com.cmpware.elf.dwarf2.LocationList

public class LocationList
extends RangeLookupList

This class is used to manage the DWARF2 Location lists.

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

Author:
SAG

Nested Class Summary
 
Nested classes/interfaces inherited from class com.cmpware.elf.dwarf2.RangeLookupList
RangeLookupList.RangeEntry
 
Field Summary
static java.lang.String copyright
          Copyright string
 
Fields inherited from class com.cmpware.elf.dwarf2.RangeLookupList
l, rangeStartComparator
 
Constructor Summary
LocationList()
          The default location list constructor.
LocationList(byte[] locPgm, int addrBytes, boolean swapBytes)
          This constructor builds a one-element location list containing a location program.
 
Method Summary
 long getAddr(Processor p, long frameBaseAddr)
          This method returns an address from the location list.
static LocationList read(ElfInputStream lis, int addrBytes, boolean swapBytes)
          This factory method creates a Location List from an ELF input stream built from the .debug_loc section.
 
Methods inherited from class com.cmpware.elf.dwarf2.RangeLookupList
get, lookup, put, size, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

copyright

public static final java.lang.String copyright
Copyright string

See Also:
Constant Field Values
Constructor Detail

LocationList

public LocationList()
The default location list constructor.


LocationList

public LocationList(byte[] locPgm,
                    int addrBytes,
                    boolean swapBytes)
This constructor builds a one-element location list containing a location program.

Parameters:
locPgm - The location program.
addrBytes - the number of bytes in an address.
swapBytes - the swap bytes flag.
Method Detail

getAddr

public long getAddr(Processor p,
                    long frameBaseAddr)
             throws java.io.IOException,
                    MemoryAccessException
This method returns an address from the location list.

Parameters:
p - the current processor.
frameBaseAddr - the current frame base address.
Returns:
This method returns an address from the location list.
Throws:
java.io.IOException
MemoryAccessException

read

public static LocationList read(ElfInputStream lis,
                                int addrBytes,
                                boolean swapBytes)
                         throws java.io.IOException
This factory method creates a Location List from an ELF input stream built from the .debug_loc section. If no data is available an empty location list is returned.

Parameters:
lis - The ELF input stream.
addrBytes - The number of bytes in an address.
swapBytes - the byte swap flag.
Returns:
a location list filled in with values from the ELF input stream.
Throws:
IOExeption - if an IO error occurs.
java.io.IOException