GEL  0.99
debug_line.h File Reference
#include <stdint.h>
#include <gel/common.h>
#include <gel/util.h>
#include <gel/gel.h>

Go to the source code of this file.

Data Structures

struct  gel_line_iter_t
 
struct  gel_addr_iter_t
 
struct  gel_location_t
 
struct  gel_unit_iter_t
 

Macros

#define GEL_IS_STMT   0x0001
 
#define GEL_BASIC_BLOCK   0x0002
 
#define GEL_PROLOGUE_END   0x0004
 
#define GEL_EPILOGUE_BEGIN   0x0008
 
#define GEL_END_SEQUENCE   0x8000
 
#define gel_isa(l)   (l.isa)
 
#define gel_is_stmt(l)   (l.flags & GEL_IS_STMT)
 
#define gel_basic_block(l)   (l.flags & GEL_BASIC_BLOCK)
 
#define gel_prologue_end(l)   (l.flags & GEL_PROLOGUE_END)
 
#define gel_epilogue_begin(l)   (l.flags & GEL_EPILOGUE_BEGIN)
 

Typedefs

typedef struct gel_line_map_t gel_line_map_t
 
typedef struct unit_t gel_unit_t
 
typedef struct gel_line_iter_t gel_line_iter_t
 
typedef struct gel_addr_iter_t gel_addr_iter_t
 
typedef struct gel_location_t gel_location_t
 
typedef struct gel_unit_iter_t gel_unit_iter_t
 

Functions

gel_line_map_tgel_new_line_map (gel_file_t *file)
 
void gel_delete_line_map (gel_line_map_t *map)
 
int gel_line_from_address (gel_line_map_t *map, vaddr_t addr, const char **file, int *line)
 
vaddr_t gel_address_from_line (gel_line_map_t *map, const char *file, int line)
 
gel_unit_tgel_unit_first (gel_line_map_t *map, gel_unit_iter_t *iter)
 
gel_unit_tgel_unit_next (gel_unit_iter_t *iter)
 
const char * gel_unit_name (gel_unit_t *unit)
 
gel_location_t gel_unit_to_line_iter (gel_unit_iter_t *unit, gel_line_iter_t *line)
 
gel_location_t gel_first_line (gel_line_iter_t *iter, gel_line_map_t *map)
 
gel_location_t gel_next_line (gel_line_iter_t *iter)
 
gel_location_t gel_first_addr (gel_addr_iter_t *iter, gel_line_map_t *map)
 
gel_location_t gel_next_addr (gel_addr_iter_t *iter)
 

Macro Definition Documentation

◆ GEL_BASIC_BLOCK

#define GEL_BASIC_BLOCK   0x0002

◆ gel_basic_block

#define gel_basic_block (   l)    (l.flags & GEL_BASIC_BLOCK)

◆ GEL_END_SEQUENCE

#define GEL_END_SEQUENCE   0x8000

◆ GEL_EPILOGUE_BEGIN

#define GEL_EPILOGUE_BEGIN   0x0008

◆ gel_epilogue_begin

#define gel_epilogue_begin (   l)    (l.flags & GEL_EPILOGUE_BEGIN)

◆ GEL_IS_STMT

#define GEL_IS_STMT   0x0001

◆ gel_is_stmt

#define gel_is_stmt (   l)    (l.flags & GEL_IS_STMT)

◆ gel_isa

#define gel_isa (   l)    (l.isa)

◆ GEL_PROLOGUE_END

#define GEL_PROLOGUE_END   0x0004

◆ gel_prologue_end

#define gel_prologue_end (   l)    (l.flags & GEL_PROLOGUE_END)

Typedef Documentation

◆ gel_addr_iter_t

◆ gel_line_iter_t

◆ gel_line_map_t

◆ gel_unit_iter_t

◆ gel_unit_t

typedef struct unit_t gel_unit_t

Function Documentation

◆ gel_unit_first()

gel_unit_t* gel_unit_first ( gel_line_map_t map,
gel_unit_iter_t iter 
)

Start an iteration on the debug units.

Parameters
mapLine map to debug with.
iterUnit iterator (intialized by this call).
Returns
Found first unit or null (if there is no unit).

◆ gel_unit_name()

const char* gel_unit_name ( gel_unit_t unit)

Get the name of a unit.

Parameters
unitUnit to get name for.
Returns
Unit name.

◆ gel_unit_next()

gel_unit_t* gel_unit_next ( gel_unit_iter_t iter)

Get the next unit of the iterator.

Parameters
iterUnit iterator.
Returns
Next unit or null for end of iteration.

◆ gel_unit_to_line_iter()

gel_location_t gel_unit_to_line_iter ( gel_unit_iter_t unit,
gel_line_iter_t iter 
)

Start an iteration on the lines of the unit.

Parameters
unitUnit iterator.
iterLine iterator.
Returns
First found location.