Class DebugFrameSection
- java.lang.Object
-
- ghidra.app.plugin.exceptionhandlers.gcc.sections.DebugFrameSection
-
- All Implemented Interfaces:
CieSource
public class DebugFrameSection extends java.lang.Object
Parses the exception handling structures within a '.debug_frame' memory section, which contains call frame debugging information.
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.String
DEBUG_FRAME_BLOCK_NAME
protected TaskMonitor
monitor
protected Program
program
-
Constructor Summary
Constructors Constructor Description DebugFrameSection(TaskMonitor monitor, Program program)
Constructor for a debug frame section.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.util.List<RegionDescriptor>
analyze()
Analyzes and annotates the debug frame section.protected void
createAugmentationData(java.util.List<RegionDescriptor> regions, Cie cie)
Creates data structures for the specified Common Information Entry (CIE) and its Frame Description Entries (FDEs) as indicated by the regions.protected Cie
createCie(Address curAddress, boolean isInDebugFrame)
Creates the data for a common information entry (CIE) at the address and puts a label and comment on it.protected void
createCieComment(Address curAddress)
Creates a comment indicating there is an CIE at the address.protected void
createCieLabel(Address curAddress)
Creates a label indicating there is an CIE at the address.protected void
createFdeComment(Address curAddress)
Creates a comment indicating there is an FDE at the address.Cie
getCie(Address currAddress)
For the provided address, return a Common Information Entry (CIE)protected Cie
getCieOrCreateIfMissing(Address currAddress, boolean isInDebugFrame)
This class maintains a lookup of common information entry (CIE) objects; this retrieves an existing object (by address), and creates a new CIE if not found.
-
-
-
Field Detail
-
DEBUG_FRAME_BLOCK_NAME
public static final java.lang.String DEBUG_FRAME_BLOCK_NAME
- See Also:
- Constant Field Values
-
monitor
protected TaskMonitor monitor
-
program
protected Program program
-
-
Constructor Detail
-
DebugFrameSection
public DebugFrameSection(TaskMonitor monitor, Program program)
Constructor for a debug frame section.- Parameters:
monitor
- a status monitor for indicating progress or allowing a task to be cancelled.program
- the program containing this debug frame section.
-
-
Method Detail
-
getCie
public Cie getCie(Address currAddress) throws MemoryAccessException, ExceptionHandlerFrameException
Description copied from interface:CieSource
For the provided address, return a Common Information Entry (CIE)- Parameters:
currAddress
- the address with the CIE- Returns:
- the Cie at
currAddress
- Throws:
MemoryAccessException
- if memory for the CIE couldn't be readExceptionHandlerFrameException
- if a problem was encountered
-
analyze
public java.util.List<RegionDescriptor> analyze() throws MemoryAccessException, AddressOutOfBoundsException, ExceptionHandlerFrameException, CancelledException
Analyzes and annotates the debug frame section.- Returns:
- the region descriptors that compose the debug frame section.
- Throws:
MemoryAccessException
- if memory couldn't be read/written while processing the section.AddressOutOfBoundsException
- if one or more expected addresses weren't in the program.ExceptionHandlerFrameException
- if the FDE table can't be decoded.CancelledException
-
createAugmentationData
protected void createAugmentationData(java.util.List<RegionDescriptor> regions, Cie cie)
Creates data structures for the specified Common Information Entry (CIE) and its Frame Description Entries (FDEs) as indicated by the regions.- Parameters:
regions
- the region descriptors for the FDEs.cie
- the CIE for the FDEs.
-
createCie
protected Cie createCie(Address curAddress, boolean isInDebugFrame) throws MemoryAccessException, ExceptionHandlerFrameException
Creates the data for a common information entry (CIE) at the address and puts a label and comment on it.- Parameters:
curAddress
- the address with the CIEisInDebugFrame
- true indicates the frame containing this CIE is a debug frame.- Returns:
- the
Cie
that was created - Throws:
MemoryAccessException
- if memory for the CIE couldn't be readExceptionHandlerFrameException
- if a problem was encountered
-
getCieOrCreateIfMissing
protected Cie getCieOrCreateIfMissing(Address currAddress, boolean isInDebugFrame) throws MemoryAccessException, ExceptionHandlerFrameException
This class maintains a lookup of common information entry (CIE) objects; this retrieves an existing object (by address), and creates a new CIE if not found.- Parameters:
curAddress
- the address with the CIEisInDebugFrame
- true indicates the frame containing this CIE is a debug frame.- Returns:
- the
Cie
that was either previously created, or a newly minted object. - Throws:
MemoryAccessException
- if memory for the CIE couldn't be readExceptionHandlerFrameException
- if a problem was encountered
-
createCieLabel
protected void createCieLabel(Address curAddress)
Creates a label indicating there is an CIE at the address.- Parameters:
curAddress
- the address with the CIE
-
createCieComment
protected void createCieComment(Address curAddress)
Creates a comment indicating there is an CIE at the address.- Parameters:
curAddress
- the address with the CIE
-
createFdeComment
protected void createFdeComment(Address curAddress)
Creates a comment indicating there is an FDE at the address.- Parameters:
curAddress
- the address with the FDE
-
-