IDA C++ SDK 9.2
Loading...
Searching...
No Matches
gdl.hpp File Reference

Low level graph drawing operations. More...

Go to the source code of this file.

Classes

class  intmap_t
 Map of integer constants to integer constants. More...
struct  edge_t
 Edge connecting two graph nodes. More...
struct  edgevec_t
class  node_set_t
 Set of graph nodes. More...
class  node_ordering_t
 Node ordering in a graph. More...
class  node_iterator
 Node iterator (used to draw graphs) More...
class  gdl_graph_t
 gdl graph interface - includes only functions required to draw it More...
class  cancellable_graph_t
struct  qbasic_block_t
 Information about a basic block of a qflow_chart_t. More...
class  qflow_chart_t
 A flow chart for a function, or a set of address ranges. More...

Typedefs

typedef qvector< intmap_tarray_of_intmap_t
typedef qvector< node_set_tarray_of_node_set_t

Enumerations

enum  fc_block_type_t {
  fcb_normal , fcb_indjump , fcb_ret , fcb_cndret ,
  fcb_noret , fcb_enoret , fcb_extern , fcb_error
}
 Flow chart block types. More...
enum  edge_type_t {
  EDGE_NONE = 0 , EDGE_TREE = 1 , EDGE_FORWARD = 2 , EDGE_BACK = 3 ,
  EDGE_CROSS = 4 , EDGE_SUBGRAPH = 5
}

Functions

 DECLARE_TYPE_AS_MOVABLE (edge_t)
idaman void ida_export gen_gdl (const gdl_graph_t *g, const char *fname)
 Create GDL file for graph.
idaman int ida_export display_gdl (const char *fname)
 Display GDL file by calling wingraph32.
idaman bool ida_export gen_flow_graph (const char *filename, const char *title, func_t *pfn, ea_t ea1, ea_t ea2, int gflags)
 Build and display a flow graph.
idaman bool ida_export gen_simple_call_chart (const char *filename, const char *wait, const char *title, int gflags)
 Build and display a simple function call graph.
idaman bool ida_export gen_complex_call_chart (const char *filename, const char *wait, const char *title, ea_t ea1, ea_t ea2, int flags, int32 recursion_depth=-1)
 Build and display a complex xref graph.
idaman void ida_export setup_graph_subsystem (const char *_grapher, bgcolor_t(idaapi *get_graph_color)(int color))
 Setup the user-defined graph colors and graph viewer program.
THREAD_SAFE bool is_noret_block (fc_block_type_t btype)
 Does this block never return?
THREAD_SAFE bool is_ret_block (fc_block_type_t btype)
 Does this block return?

Variables

DECLARE_HELPER(idaman) class intset_t typedef qvector< intvec_tarray_of_intvec_t
 Set of integer constants.

Detailed Description

Low level graph drawing operations.

Typedef Documentation

◆ array_of_intmap_t

◆ array_of_node_set_t

Enumeration Type Documentation

◆ fc_block_type_t

Flow chart block types.

Enumerator
fcb_normal 

normal block

fcb_indjump 

block ends with indirect jump

fcb_ret 

return block

fcb_cndret 

conditional return block

fcb_noret 

noreturn block

fcb_enoret 

external noreturn block (does not belong to the function)

fcb_extern 

external normal block

fcb_error 

block passes execution past the function end

◆ edge_type_t

Enumerator
EDGE_NONE 
EDGE_TREE 
EDGE_FORWARD 
EDGE_BACK 
EDGE_CROSS 
EDGE_SUBGRAPH 

Function Documentation

◆ DECLARE_TYPE_AS_MOVABLE()

DECLARE_TYPE_AS_MOVABLE ( edge_t )

◆ gen_gdl()

idaman void ida_export gen_gdl ( const gdl_graph_t * g,
const char * fname )

Create GDL file for graph.

◆ display_gdl()

idaman int ida_export display_gdl ( const char * fname)

Display GDL file by calling wingraph32.

The exact name of the grapher is taken from the configuration file and set up by setup_graph_subsystem(). The path should point to a temporary file: when wingraph32 succeeds showing the graph, the input file will be deleted.

Returns
error code from os, 0 if ok

◆ gen_flow_graph()

idaman bool ida_export gen_flow_graph ( const char * filename,
const char * title,
func_t * pfn,
ea_t ea1,
ea_t ea2,
int gflags )

Build and display a flow graph.

Parameters
filenameoutput file name. the file extension is not used. maybe nullptr.
titlegraph title
pfnfunction to graph
ea1,ea2if pfn == nullptr, then the address range
gflagscombination of Flow graph building flags. if none of #CHART_GEN_DOT, #CHART_GEN_GDL, #CHART_WINGRAPH is specified, the function will return false
Returns
success. if fails, a warning message is displayed on the screen

◆ gen_simple_call_chart()

idaman bool ida_export gen_simple_call_chart ( const char * filename,
const char * wait,
const char * title,
int gflags )

Build and display a simple function call graph.

Parameters
filenameoutput file name. the file extension is not used. maybe nullptr.
waitmessage to display during graph building
titlegraph title
gflagscombination of #CHART_NOLIBFUNCS and Flow graph building flags. if none of #CHART_GEN_DOT, #CHART_GEN_GDL, #CHART_WINGRAPH is specified, the function will return false.
Returns
success. if fails, a warning message is displayed on the screen

◆ gen_complex_call_chart()

idaman bool ida_export gen_complex_call_chart ( const char * filename,
const char * wait,
const char * title,
ea_t ea1,
ea_t ea2,
int flags,
int32 recursion_depth = -1 )

Build and display a complex xref graph.

Parameters
filenameoutput file name. the file extension is not used. maybe nullptr.
waitmessage to display during graph building
titlegraph title
ea1,ea2address range
flagscombination of Call chart building flags and Flow graph building flags. if none of #CHART_GEN_DOT, #CHART_GEN_GDL, #CHART_WINGRAPH is specified, the function will return false.
recursion_depthoptional limit of recursion
Returns
success. if fails, a warning message is displayed on the screen

◆ setup_graph_subsystem()

idaman void ida_export setup_graph_subsystem ( const char * _grapher,
bgcolor_t(idaapi *get_graph_color)(int color)  )

Setup the user-defined graph colors and graph viewer program.

This function is called by the GUI at the beginning, so no need to call it again.

◆ is_noret_block()

THREAD_SAFE bool is_noret_block ( fc_block_type_t btype)
inline

Does this block never return?

◆ is_ret_block()

THREAD_SAFE bool is_ret_block ( fc_block_type_t btype)
inline

Does this block return?

Variable Documentation

◆ array_of_intvec_t

DECLARE_HELPER (idaman) class intset_t typedef qvector<intvec_t> array_of_intvec_t

Set of integer constants.