|
| #define | dwarf_address_from_line(map, file, line) gel_address_from_line(map, file, line) |
| |
| #define | dwarf_line_from_address(map, addr, file, line) gel_line_from_address(map, addr, file, line) |
| |
| #define | dwarf_delete_line_map(map) gel_delete_line_map(map) |
| |
| #define | dwarf_first_line(iter, map) gel_first_line(iter, map) |
| |
| #define | dwarf_next_line(iter) gel_next_line(iter) |
| |
| #define | dwarf_first_addr(iter, map) gel_first_addr(iter, map) |
| |
| #define | dwarf_next_addr(iter) gel_next_addr(iter) |
| |
This module provide access to the DWARF debugging information. Currently, only access to the map between the binary and the sources is provided.
To get such an information, you have first to get the line map :
...
dwarf_delete_line_map(map);
dwarf_line_map_t * dwarf_new_line_map(gel_file_t *file, gel_sect_t *section)
Definition: dwarf_line.c:1108
If no containing section is given, the default section called ".debug_line" is used. dwarf_delete_line_map is used to release memory occupied by the line map.
If you have an address or a source file / line pair, you may get the corresponding information using the following functions :
const char **file, int *line);
#define dwarf_line_from_address(map, addr, file, line)
#define dwarf_address_from_line(map, file, line)
uint32_t vaddr_t
Definition: types.h:36
The first one gives the start address of the code matching the given file name and line. The second one is used to get the line and the source file matching the given address.
You may also traverse all available lines :
...
struct gel_line_iter_t dwarf_line_iter_t
Definition: dwarf_line.h:41
struct gel_location_t dwarf_location_t
Definition: dwarf_line.h:43
#define dwarf_next_line(iter)
#define dwarf_first_line(iter, map)
Or all available code blocks :
...
struct gel_addr_iter_t dwarf_addr_iter_t
Definition: dwarf_line.h:42
#define dwarf_next_addr(iter)
#define dwarf_first_addr(iter, map)
The dwarf_location_t type provides usual information :
- file – source file,
- line – line,
- low_addr – low address of the block,
- high_addr – high address of the block.
◆ dwarf_address_from_line
Get the actual address of a source line.
- Parameters
-
| map | Line map to use. |
| file | File name. |
| line | Line number. |
- Returns
- Matching address or null if no address is found.
- Deprecated:
- Use gel_address_from_line().
◆ dwarf_delete_line_map
◆ dwarf_first_addr
Initialize the given iterator on the first address.
- Parameters
-
| iter | Iterator to initialize. |
| map | Line map to use. |
- Returns
- Return the first location or an empty file location if there is no address.
- Deprecated:
- Use gel_first_addr().
◆ dwarf_first_line
Initialize the iterator on the lines.
- Parameters
-
| iter | Iterator to use. |
| map | Map to iterate on. |
- Returns
- First location or an empty file location if there is no line.
- Deprecated:
- Use gel_first_line().
◆ dwarf_line_from_address
Get the file and line matching an actual binary address.
- Parameters
-
| map | Used map. |
| addr | Looked address. |
| file | Returned file. |
| line | Returned line. |
- Returns
- 0 for success, -1 if not found.
- Deprecated:
- Use gel_line_from_address().
◆ dwarf_next_addr
Get the next location.
- Parameters
-
| iter | Current address iterator. |
- Returns
- Next address or empty file location.
- Deprecated:
- Use gel_next_addr().
◆ dwarf_next_line
Go to the next line.
- Parameters
-
- Returns
- Next location or an empty file location if there is no more line.
- Deprecated:
- Use gel_next_line().
◆ dwarf_line_map_t
Type representing a code / line map.
◆ dwarf_new_line_map()
Build the line information.
- Parameters
-
| file | File containing the section. |
| section | Section containing the information (null for default .debug_line). |
- Returns
- Read line map or null for an error. gel_errno errors include: