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

Typedefs

typedef struct elf_stab_t elf_stab_t
 
typedef struct linemap_entry_t linemap_entry_t
 

Functions

stabs_tstabs_new (gel_file_t *file)
 
void stabs_delete (stabs_t *stabs)
 
int stabs_count (stabs_t *stabs)
 
stab_tstabs_item (stabs_t *stabs, int i)
 
gel_line_map_tstabs_make_linemap (gel_file_t *file, stabs_t *stabs)
 
gel_line_map_tstabs_new_line_map (gel_file_t *file)
 

Typedef Documentation

◆ elf_stab_t

typedef struct elf_stab_t elf_stab_t

◆ linemap_entry_t

typedef struct linemap_entry_t linemap_entry_t

Function Documentation

◆ stabs_count()

int stabs_count ( stabs_t stabs)

Get the count of items in STABS.

Parameters
stabsSTABS handle.
Returns
Count of items.

◆ stabs_delete()

void stabs_delete ( stabs_t stabs)

Delete a STABS handler.

Parameters
stabsSTABS handler to delete.

◆ stabs_item()

stab_t* stabs_item ( stabs_t stabs,
int  i 
)

Get the item at the given index.

Parameters
stabsSTABS handle.
iIndex of the item.
Returns
Item matching the index.

◆ stabs_make_linemap()

gel_line_map_t* stabs_make_linemap ( gel_file_t file,
stabs_t stabs 
)

Build a line map that allows to map source:lines with addresses.

Parameters
fileFile to get linemap from.
stabsCurrent stabs.
Returns
Created linemap or NULL if there is a problem (error in gel_errno).
Warning
Stabs must not be deleted while the returned line map exists.

◆ stabs_new()

stabs_t* stabs_new ( gel_file_t file)

Open the STABS section of the given file.

Parameters
fileFile to look in.
Returns
STABS handler or null if there is an error.

◆ stabs_new_line_map()

gel_line_map_t* stabs_new_line_map ( gel_file_t file)

Build the line information.

Parameters
fileFile containing the section.
Returns
Read line map or null for an error. gel_errno errors include: