GEL  0.99
debug_line.c File Reference
#include <stdio.h>
#include <stdlib.h>
#include <gel/dwarf_line.h>
#include <gel/stabs.h>
#include <gel/gel_elf.h>
#include "debug.h"
#include "gel_mem.h"

Macros

#define DWARF_DEBUG_LINE_NAME   ".debug_line"
 

Typedefs

typedef gel_line_map_t *(* cons_t) (gel_file_t *, gel_sect_t *)
 

Functions

void gel_delete_line_map (gel_line_map_t *map)
 
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_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 *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)
 
vaddr_t gel_address_from_line (gel_line_map_t *map, const char *file, int line)
 
int gel_line_from_address (gel_line_map_t *map, vaddr_t addr, const char **file, int *line)
 
int gel_init_line_map_segs (gel_file_t *file, gel_line_map_t *map, int step)
 
gel_line_map_tgel_new_line_map (gel_file_t *file)
 

Macro Definition Documentation

◆ DWARF_DEBUG_LINE_NAME

#define DWARF_DEBUG_LINE_NAME   ".debug_line"

Typedef Documentation

◆ cons_t

typedef gel_line_map_t*(* cons_t) (gel_file_t *, gel_sect_t *)

Function Documentation

◆ gel_init_line_map_segs()

int gel_init_line_map_segs ( gel_file_t file,
gel_line_map_t map,
int  step 
)

Initialize the segments part of line map.

Parameters
fileGEL file to work with.
mapLine map to initialize.
stepStep in bytes between each line.
Returns
0 for success, -1 else (error in gel_errno).

◆ 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.