|
GEL
0.99
|
Typedefs | |
| typedef struct gel_location_t | gel_location_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_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) |
| gel_line_map_t * | gel_new_line_map (gel_file_t *file) |
This module provide access to the debugging information of an executable. It replaces and complement the old DWARF module allowing transparent access to any supported debugging format. For now, it only provides DWARF access but will soon support STABS debugging information.
To use debugging line information one has first to build a linemap once the executable has been opened:
This function will automatically look for the available debugging information and invoke the matching manager. If no debugging information is found or for any error, it returns NULL (and error in gel_errno).
Then, you can retrieve the address matching a source / line pair with:
Or do the inverse, getting source and line from an address (if any).
You can also traverse the list of sorted by source / line information:
Notice that, in this case, if the debugging information contains aliases (same file name for different instructions blocks), ony one will be visible.
Or the list of available sorted by memory addresses:
Finally, the linemap may be fried with:
This structure is used to return a debugging line information made of a source file, a line, a starting and an ending address.
| vaddr_t gel_address_from_line | ( | gel_line_map_t * | map, |
| const char * | file, | ||
| int | line | ||
| ) |
Get the actual address of a source line.
| map | Line map to use. |
| file | File name. |
| line | Line number. |
| void gel_delete_line_map | ( | gel_line_map_t * | map | ) |
Delete a line map.
| map | Line map to delete. |
| gel_location_t gel_first_addr | ( | gel_addr_iter_t * | iter, |
| gel_line_map_t * | map | ||
| ) |
Initialize the given iterator on the first address.
| iter | Iterator to initialize. |
| map | Line map to use. |
| gel_location_t gel_first_line | ( | gel_line_iter_t * | iter, |
| gel_line_map_t * | map | ||
| ) |
Initialize the iterator on the lines.
| iter | Iterator to use. |
| map | Map to iterate on. |
| int gel_line_from_address | ( | gel_line_map_t * | map, |
| vaddr_t | addr, | ||
| const char ** | file, | ||
| int * | line | ||
| ) |
Get the file and line matching an actual binary address.
| map | Used map. |
| addr | Looked address. |
| file | Returned file. |
| line | Returned line. |
| gel_line_map_t* gel_new_line_map | ( | gel_file_t * | file | ) |
Open the debug source line information.
| file | File to work on. |
| gel_location_t gel_next_addr | ( | gel_addr_iter_t * | iter | ) |
Get the next location.
| iter | Current address iterator. |
| gel_location_t gel_next_line | ( | gel_line_iter_t * | iter | ) |
Go to the next line.
| iter | Used iterator. |