Interface TraceStack
- All Superinterfaces:
TraceObjectInterface,TraceUniqueObject
- All Known Implementing Classes:
DBTraceStack
Most of the information stored here is ancillary, since with sufficient analysis of associated images, it could be recovered, in the same fashion as the connected debugger did. Nevertheless, during a debug session, this information should be recorded if offered, as it makes it immediately accessible, before sufficient analysis has been performed, and provides some check for that analysis. If this information wasn't recorded during a session, this can store the result of that analysis.
Conventionally, if the debugger can also unwind register values, then each frame should present a register bank. Otherwise, the same object presenting this stack should present the register bank.
-
Field Summary
Fields inherited from interface ghidra.trace.model.target.iface.TraceObjectInterface
KEY_COMMENT, KEY_DISPLAY, KEY_KIND, KEY_MODIFIED, KEY_ORDER, KEY_SHORT_DISPLAY, KEY_TYPE, KEY_VALUE -
Method Summary
Modifier and TypeMethodDescriptionvoiddelete()Delete this stack and its framesintgetDepth(long snap) Get the depth (as recorded) of this stackgetFrame(long snap, int level, boolean ensureDepth) Get the frame at the given levelgetFrames(long snap) Get all (known) frames in this stackGet the thread whose stack this isbooleanCheck if this stack'sframes are fixed for its lifetimebooleanisValid(long snap) Check if this stack is valid at the given snapvoidremove(long snap) Remove this stack and its frame rom the given snapshot onvoidsetDepth(long snap, int depth, boolean atInner) Set the depth of the stack by adding or deleting frames to or from the specified endMethods inherited from interface ghidra.trace.model.target.iface.TraceObjectInterface
getObjectMethods inherited from interface ghidra.trace.model.TraceUniqueObject
getObjectKey, isDeleted
-
Method Details
-
getThread
TraceThread getThread()Get the thread whose stack this is- Returns:
- the thread
-
getDepth
int getDepth(long snap) Get the depth (as recorded) of this stack- Parameters:
snap- the snap- Returns:
- the depth
-
setDepth
void setDepth(long snap, int depth, boolean atInner) Set the depth of the stack by adding or deleting frames to or from the specified endNote that pushing new frames onto a stack does not adjust the frame level of any frame-associated managers or spaces, e.g., that returned by
TraceMemoryManager.getMemoryRegisterSpace(TraceThread, int, boolean).If the experimental object mode is successful, this method should be deleted.
- Parameters:
snap- the snapdepth- the desired depthatInner- true if frames should be "pushed"
-
getFrame
Get the frame at the given level- Parameters:
snap- the snaplevel- the level, where 0 indicates the inner-most frame.ensureDepth- true to expand the depth to accomodate the requested frame- Returns:
- the frame, or
nullif level exceeds the depth without ensureDepth set - Throws:
IndexOutOfBoundsException- if the level is negative
-
getFrames
Get all (known) frames in this stack- Parameters:
snap- the snap (only relevant in the experimental objects mode. Ordinarily, the frames are fixed over the stack's lifetime)- Returns:
- the list of frames
-
delete
void delete()Delete this stack and its frames -
remove
void remove(long snap) Remove this stack and its frame rom the given snapshot on- Parameters:
snap- the snapshot key
-
isValid
boolean isValid(long snap) Check if this stack is valid at the given snap- Parameters:
snap- the snap- Returns:
- true if valid
-
hasFixedFrames
boolean hasFixedFrames()Check if this stack'sframes are fixed for its lifetimeThis is a transitional method, since the experimental objects mode breaks with the normal stack/frame model. Essentially, this returns true if the normal model is being used, and false if the object-based model is being used.
- Returns:
- true if fixed, false if object-based (dynamic)
-