DCFG
Dynamic Control Flow Graph
 All Classes Functions
Public Member Functions | List of all members
dcfg_api::DCFG_PROCESS Class Referenceabstract

Interface to information about an O/S process. More...

#include <dcfg_api.H>

Inheritance diagram for dcfg_api::DCFG_PROCESS:
dcfg_api::DCFG_IMAGE_CONTAINER dcfg_api::DCFG_ROUTINE_CONTAINER dcfg_api::DCFG_LOOP_CONTAINER dcfg_api::DCFG_GRAPH_BASE

Public Member Functions

virtual DCFG_ID get_process_id () const =0
 Get the process ID.
 
virtual UINT32 get_highest_thread_id () const =0
 Get the highest thread ID.
 
virtual UINT32 get_basic_block_ids_by_addr (UINT64 addr, DCFG_ID_CONTAINER &node_ids) const =0
 Get basic block ID(s) containing given address in this process.
 
virtual UINT32 get_start_node_id () const =0
 Get ID of start node.
 
virtual UINT32 get_end_node_id () const =0
 Get ID of end node.
 
virtual UINT32 get_unknown_node_id () const =0
 Get ID of unknown node.
 
virtual DCFG_ID get_edge_id (DCFG_ID source_node_id, DCFG_ID target_node_id) const =0
 Get the ID of an edge given its source and target nodes.
 
virtual UINT32 get_successor_node_ids (DCFG_ID source_node_id, DCFG_ID_CONTAINER &node_ids) const =0
 Get the set of target nodes that have an edge from the given source.
 
virtual UINT32 get_predecessor_node_ids (DCFG_ID target_node_id, DCFG_ID_CONTAINER &node_ids) const =0
 Get the set of source nodes that have an edge to the given target.
 
virtual DCFG_EDGE_CPTR get_edge_info (DCFG_ID edge_id) const =0
 Get access to data for an edge.
 
virtual DCFG_BASIC_BLOCK_CPTR get_basic_block_info (DCFG_ID node_id) const =0
 Get access to data for a basic block.
 
virtual bool is_special_node (DCFG_ID node_id) const =0
 Determine whether a node ID refers to any "special" (non-basic-block) node.
 
virtual bool is_start_node (DCFG_ID node_id) const =0
 Determine whether a node ID refers to the special non-basic-block start node.
 
virtual bool is_end_node (DCFG_ID node_id) const =0
 Determine whether a node ID refers to the special non-basic-block end node.
 
virtual bool is_unknown_node (DCFG_ID node_id) const =0
 Determine whether a node ID refers to the special non-basic-block "unknown" node.
 
- Public Member Functions inherited from dcfg_api::DCFG_IMAGE_CONTAINER
virtual UINT32 get_image_ids (DCFG_ID_CONTAINER &image_ids) const =0
 Get the set of image IDs.
 
virtual DCFG_IMAGE_CPTR get_image_info (DCFG_ID image_id) const =0
 Get access to data for an image.
 
- Public Member Functions inherited from dcfg_api::DCFG_ROUTINE_CONTAINER
virtual UINT32 get_routine_ids (DCFG_ID_CONTAINER &node_ids) const =0
 Get the set of routine IDs.
 
virtual DCFG_ROUTINE_CPTR get_routine_info (DCFG_ID routine_id) const =0
 Get access to data for a routine.
 
- Public Member Functions inherited from dcfg_api::DCFG_LOOP_CONTAINER
virtual UINT32 get_loop_ids (DCFG_ID_CONTAINER &node_ids) const =0
 Get the set of loop IDs.
 
virtual DCFG_LOOP_CPTR get_loop_info (DCFG_ID loop_id) const =0
 Get access to data for a loop.
 
- Public Member Functions inherited from dcfg_api::DCFG_GRAPH_BASE
virtual UINT32 get_basic_block_ids (DCFG_ID_CONTAINER &node_ids) const =0
 Get IDs of all basic blocks in the structure.
 
virtual UINT32 get_internal_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of internal edge IDs.
 
virtual UINT32 get_inbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of in-bound edge IDs.
 
virtual UINT32 get_outbound_edge_ids (DCFG_ID_CONTAINER &edge_ids) const =0
 Get list of out-bound edge IDs.
 
virtual UINT64 get_instr_count () const =0
 Get the total dynamic instruction count.
 
virtual UINT64 get_instr_count_for_thread (UINT32 thread_id) const =0
 Get per-thread dynamic instruction count.
 

Detailed Description

Interface to information about an O/S process.

Member Function Documentation

virtual UINT32 dcfg_api::DCFG_PROCESS::get_basic_block_ids_by_addr ( UINT64  addr,
DCFG_ID_CONTAINER node_ids 
) const
pure virtual

Get basic block ID(s) containing given address in this process.

It is possible to get zero or more IDs returned: zero if the address appears in no basic blocks, one if it appears in exactly one block in one image, and more than one if it is not unique. Basic blocks may not be unique if a dynamically-linked process unloads one image and loads another image in an overlapping address region.

Returns
Number of IDs that were added to node_ids.
Parameters
[in]addrVirtual address that can appear anywhere within a basic block.
[out]node_idsContainer to which basic-block IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual DCFG_BASIC_BLOCK_CPTR dcfg_api::DCFG_PROCESS::get_basic_block_info ( DCFG_ID  node_id) const
pure virtual

Get access to data for a basic block.

Returns
Pointer to interface object for specified basic block or NULL if node_id refers to a "special" node or is invalid.
Parameters
[in]node_idID of desired basic block.
virtual DCFG_ID dcfg_api::DCFG_PROCESS::get_edge_id ( DCFG_ID  source_node_id,
DCFG_ID  target_node_id 
) const
pure virtual

Get the ID of an edge given its source and target nodes.

Returns
ID number of edge or zero (0) if there is no edge between the two nodes.
Parameters
[in]source_node_idID number of node the edge is coming from.
[in]target_node_idID number of node the edge is going to.
virtual DCFG_EDGE_CPTR dcfg_api::DCFG_PROCESS::get_edge_info ( DCFG_ID  edge_id) const
pure virtual

Get access to data for an edge.

Returns
Pointer to interface object for specified edge or NULL if edge_id is invalid.
Parameters
[in]edge_idID of desired edge.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_end_node_id ( ) const
pure virtual

Get ID of end node.

This is a "special" node that is not a basic block. It is the target node of the edge from the last basic block executed in each thread.

Returns
ID number of end node.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_highest_thread_id ( ) const
pure virtual

Get the highest thread ID.

The lowest thread ID is zero (0). Typically, threads are consecutively numbered from zero to DCFG_PROCESS::get_highest_thread_id().

Returns
Highest thread ID recorded when the DCFG was created.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_predecessor_node_ids ( DCFG_ID  target_node_id,
DCFG_ID_CONTAINER node_ids 
) const
pure virtual

Get the set of source nodes that have an edge to the given target.

Predecessor node sets are used in various graph algorithms.

Returns
Number of IDs that were added to node_ids.
Parameters
[in]target_node_idID number of target node.
[out]node_idsContainer to which source node IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual DCFG_ID dcfg_api::DCFG_PROCESS::get_process_id ( ) const
pure virtual

Get the process ID.

Returns
Process ID captured when the DCFG was created.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_start_node_id ( ) const
pure virtual

Get ID of start node.

This is a "special" node that is not a basic block. It is the source node of the edge to the first basic block executed in each thread.

Returns
ID number of start node.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_successor_node_ids ( DCFG_ID  source_node_id,
DCFG_ID_CONTAINER node_ids 
) const
pure virtual

Get the set of target nodes that have an edge from the given source.

Successor node sets are used in various graph algorithms.

Returns
Number of IDs that were added to node_ids.
Parameters
[in]source_node_idID number of source node.
[out]node_idsContainer to which target node IDs are added. Previous contents of the container are not emptied by this call, so it should be emptied by the programmer before the call if desired. The programmer can use any implementation of DCFG_ID_CONTAINER: DCFG_ID_VECTOR, DCFG_ID_SET, etc.
virtual UINT32 dcfg_api::DCFG_PROCESS::get_unknown_node_id ( ) const
pure virtual

Get ID of unknown node.

This is a "special" node that is not a basic block. It is a placeholder for any section of executable code for which basic-block data cannot be obtained. An unknown node should not appear in a well-formed graph.

Returns
ID number of the unknown node.
virtual bool dcfg_api::DCFG_PROCESS::is_end_node ( DCFG_ID  node_id) const
pure virtual

Determine whether a node ID refers to the special non-basic-block end node.

Returns
true if end node, false otherwise.
Parameters
[in]node_idID of node in question.
virtual bool dcfg_api::DCFG_PROCESS::is_special_node ( DCFG_ID  node_id) const
pure virtual

Determine whether a node ID refers to any "special" (non-basic-block) node.

This could be a start, end, or unknown node. If this returns false it does not necessarily mean that the node is a basic-block; it could be that the ID is invalid.

Returns
true if node is special, false otherwise.
Parameters
[in]node_idID of node in question.
virtual bool dcfg_api::DCFG_PROCESS::is_start_node ( DCFG_ID  node_id) const
pure virtual

Determine whether a node ID refers to the special non-basic-block start node.

Returns
true if start node, false otherwise.
Parameters
[in]node_idID of node in question.
virtual bool dcfg_api::DCFG_PROCESS::is_unknown_node ( DCFG_ID  node_id) const
pure virtual

Determine whether a node ID refers to the special non-basic-block "unknown" node.

A well-formed DCFG should not have any unknown nodes.

Returns
true if unknown node, false otherwise.
Parameters
[in]node_idID of node in question.

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