Ghidra 11.3.2
Ghidra internal decompiler documentation.
Loading...
Searching...
No Matches
ghidra::SeqNum Class Reference

A class for uniquely labelling and comparing PcodeOps. More...

#include <address.hh>

Collaboration diagram for ghidra::SeqNum:
[legend]

Public Member Functions

 SeqNum (void)
 Create an invalid sequence number.
 
 SeqNum (Address::mach_extreme ex)
 Create an extremal sequence number.
 
 SeqNum (const Address &a, uintm b)
 Create a sequence number with a specific time field.
 
 SeqNum (const SeqNum &op2)
 Copy a sequence number.
 
const AddressgetAddr (void) const
 Get the address portion of a sequence number.
 
uintm getTime (void) const
 Get the time field of a sequence number.
 
uintm getOrder (void) const
 Get the order field of a sequence number.
 
void setOrder (uintm ord)
 Set the order field of a sequence number.
 
bool operator== (const SeqNum &op2) const
 Compare two sequence numbers for equality.
 
bool operator!= (const SeqNum &op2) const
 Compare two sequence numbers for inequality.
 
bool operator< (const SeqNum &op2) const
 Compare two sequence numbers with their natural order.
 
void encode (Encoder &encoder) const
 Encode a SeqNum to a stream.
 

Static Public Member Functions

static SeqNum decode (Decoder &decoder)
 Decode a SeqNum from a stream.
 

Private Attributes

Address pc
 Program counter at start of instruction.
 
uintm uniq
 Number to guarantee uniqueness.
 
uintm order
 Number for order comparisons within a block.
 

Friends

ostream & operator<< (ostream &s, const SeqNum &sq)
 Write out a SeqNum in human readable form to a stream.
 

Detailed Description

A class for uniquely labelling and comparing PcodeOps.

Different PcodeOps generated by a single machine instruction can only be labelled with a single Address. But PcodeOps must be distinguishable and compared for execution order. A SeqNum extends the address for a PcodeOp to include:

  • A fixed time field, which is set at the time the PcodeOp is created. The time field guarantees a unique SeqNum for the life of the PcodeOp.
  • An order field, which is guaranteed to be comparable for the execution order of the PcodeOp within its basic block. The order field also provides uniqueness but may change over time if the syntax tree is manipulated.

The documentation for this class was generated from the following files: