libdwarf: Line Table For a CU

libdwarf

Loading...
Searching...
No Matches
Functions
Line Table For a CU

## Functions
DW_API int | dwarf_srcfiles (Dwarf_Die dw_cu_die, char ***dw_srcfiles, Dwarf_Signed *dw_filecount, Dwarf_Error *dw_error)
| The list of source files from the line table header.
DW_API int | dwarf_srclines_b (Dwarf_Die dw_cudie, Dwarf_Unsigned *dw_version_out, Dwarf_Small *dw_table_count, Dwarf_Line_Context *dw_linecontext, Dwarf_Error *dw_error)
| Initialize Dwarf_Line_Context for line table access.
DW_API int | dwarf_srclines_from_linecontext (Dwarf_Line_Context dw_linecontext, Dwarf_Line **dw_linebuf, Dwarf_Signed *dw_linecount, Dwarf_Error *dw_error)
| Access source lines from line context.
DW_API int | dwarf_srclines_two_level_from_linecontext (Dwarf_Line_Context dw_context, Dwarf_Line **dw_linebuf, Dwarf_Signed *dw_linecount, Dwarf_Line **dw_linebuf_actuals, Dwarf_Signed *dw_linecount_actuals, Dwarf_Error *dw_error)
| Returns line table counts and data.
DW_API void | dwarf_srclines_dealloc_b (Dwarf_Line_Context dw_context)
| Dealloc the memory allocated by dwarf_srclines_b.
DW_API int | dwarf_srclines_table_offset (Dwarf_Line_Context dw_context, Dwarf_Unsigned *dw_offset, Dwarf_Error *dw_error)
| Return the srclines table offset.
DW_API int | dwarf_srclines_comp_dir (Dwarf_Line_Context dw_context, const char **dw_compilation_directory, Dwarf_Error *dw_error)
| Compilation Directory name for the CU.
DW_API int | dwarf_srclines_subprog_count (Dwarf_Line_Context dw_context, Dwarf_Signed *dw_count, Dwarf_Error *dw_error)
| Subprog count: Part of the two-level line table extension.
DW_API int | dwarf_srclines_subprog_data (Dwarf_Line_Context dw_context, Dwarf_Signed dw_index, const char **dw_name, Dwarf_Unsigned *dw_decl_file, Dwarf_Unsigned *dw_decl_line, Dwarf_Error *dw_error)
| Retrieve data from the line table subprog array.
DW_API int | dwarf_srclines_files_indexes (Dwarf_Line_Context dw_context, Dwarf_Signed *dw_baseindex, Dwarf_Signed *dw_count, Dwarf_Signed *dw_endindex, Dwarf_Error *dw_error)
| Return values easing indexing line table file numbers. Count is the real count of files array entries. Since DWARF 2,3,4 are zero origin indexes and DWARF5 and later are one origin, this function replaces dwarf_srclines_files_count().
DW_API int | dwarf_srclines_files_data_b (Dwarf_Line_Context dw_context, Dwarf_Signed dw_index_in, const char **dw_name, Dwarf_Unsigned *dw_directory_index, Dwarf_Unsigned *dw_last_mod_time, Dwarf_Unsigned *dw_file_length, Dwarf_Form_Data16 **dw_md5ptr, Dwarf_Error *dw_error)
| Access data for each line table file.
DW_API int | dwarf_srclines_include_dir_count (Dwarf_Line_Context dw_line_context, Dwarf_Signed *dw_count, Dwarf_Error *dw_error)
| Return the number of include directories in the Line Table.
DW_API int | dwarf_srclines_include_dir_data (Dwarf_Line_Context dw_line_context, Dwarf_Signed dw_index, const char **dw_name, Dwarf_Error *dw_error)
| Return the include directories in the Line Table.
DW_API int | dwarf_srclines_version (Dwarf_Line_Context dw_line_context, Dwarf_Unsigned *dw_version, Dwarf_Small *dw_table_count, Dwarf_Error *dw_error)
| The DWARF version number of this compile-unit.
DW_API int | dwarf_linebeginstatement (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
| Read Line beginstatement register.
DW_API int | dwarf_lineendsequence (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
| Read Line endsequence register flag.
DW_API int | dwarf_lineno (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_linenum, Dwarf_Error *dw_error)
| Read Line line register.
DW_API int | dwarf_line_srcfileno (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_filenum, Dwarf_Error *dw_error)
| Read Line file register.
DW_API int | dwarf_line_is_addr_set (Dwarf_Line dw_line, Dwarf_Bool *dw_is_addr_set, Dwarf_Error *dw_error)
| Is the Dwarf_Line address from DW_LNS_set_address? This is not a line register, but it is a flag set by the library in each Dwarf_Line, and it is derived from reading the line table.
DW_API int | dwarf_lineaddr (Dwarf_Line dw_line, Dwarf_Addr *dw_returned_addr, Dwarf_Error *dw_error)
| Return the address of the Dwarf_Line.
DW_API int | dwarf_lineoff_b (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_lineoffset, Dwarf_Error *dw_error)
| Return a column number through the pointer.
DW_API int | dwarf_linesrc (Dwarf_Line dw_line, char **dw_returned_name, Dwarf_Error *dw_error)
| Return the file name applicable to the Dwarf_Line.
DW_API int | dwarf_lineblock (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
| Return the basic_block line register.
DW_API int | dwarf_prologue_end_etc (Dwarf_Line dw_line, Dwarf_Bool *dw_prologue_end, Dwarf_Bool *dw_epilogue_begin, Dwarf_Unsigned *dw_isa, Dwarf_Unsigned *dw_discriminator, Dwarf_Error *dw_error)
| Return various line table registers in one call.
DW_API int | dwarf_linelogical (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_logical, Dwarf_Error *dw_error)
| Experimental Two-level logical Row Number Experimental two level line tables. Not explained here. When reading from an actuals table, dwarf_line_logical() returns the logical row number for the line.
DW_API int | dwarf_linecontext (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_context, Dwarf_Error *dw_error)
| Experimental Two-level line tables call contexts Experimental two level line tables. Not explained here. When reading from a logicals table, dwarf_linecontext() returns the logical row number corresponding the the calling context for an inlined call.
DW_API int | dwarf_line_subprogno (Dwarf_Line, Dwarf_Unsigned *, Dwarf_Error *)
| Two-level line tables get subprogram number Experimental two level line tables. Not explained here. When reading from a logicals table, dwarf_line_subprogno() returns the index in the subprograms table of the inlined subprogram. Currently this always returns zero through the pointer as the relevant field is never updated from the default of zero.
DW_API int | dwarf_line_subprog (Dwarf_Line, char **, char **, Dwarf_Unsigned *, Dwarf_Error *)
| Two-level line tables get subprog, file, line Experimental two level line tables. Not explained here. When reading from a logicals table, dwarf_line_subprog() returns the name of the inlined subprogram, its declaration filename, and its declaration line number, if available.
DW_API int | dwarf_check_lineheader_b (Dwarf_Die dw_cu_die, int *dw_errcount_out, Dwarf_Error *dw_error)
| Access to detailed line table header issues.
DW_API int | dwarf_print_lines (Dwarf_Die dw_cu_die, Dwarf_Error *dw_error, int *dw_errorcount_out)
| Print line information in great detail.
DW_API struct Dwarf_Printf_Callback_Info_s | dwarf_register_printf_callback (Dwarf_Debug dw_dbg, struct Dwarf_Printf_Callback_Info_s *dw_callbackinfo)
| For line details this records callback details.

## Detailed Description

Access to all the line table details.

## Function Documentation

## ◆ dwarf_check_lineheader_b()

DW_API int dwarf_check_lineheader_b | ( | Dwarf_Die | dw_cu_die,
|  | int * | dw_errcount_out,
|  | Dwarf_Error * | dw_error )

Access to detailed line table header issues.

Lets the caller get detailed messages about some compiler errors we detect. Calls back, the caller should do something with the messages (likely just print them). The lines passed back already have newlines.

See also
  dwarf_check_lineheader(b)
  Dwarf_Printf_Callback_Info_s

Parameters

  dw_cu_die | The CU DIE of interest
  dw_error | If DW_DLV_ERROR this shows one error encountered.
  dw_errcount_out | Returns the count of detected errors through the pointer.

Returns
  DW_DLV_OK etc.

## ◆ dwarf_line_is_addr_set()

DW_API int dwarf_line_is_addr_set | ( | Dwarf_Line | dw_line,
|  | Dwarf_Bool * | dw_is_addr_set,
|  | Dwarf_Error * | dw_error )

Is the Dwarf_Line address from DW_LNS_set_address? This is not a line register, but it is a flag set by the library in each Dwarf_Line, and it is derived from reading the line table.

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_is_addr_set | On success it sets the flag to TRUE or FALSE.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_line_srcfileno()

DW_API int dwarf_line_srcfileno | ( | Dwarf_Line | dw_line,
|  | Dwarf_Unsigned * | dw_returned_filenum,
|  | Dwarf_Error * | dw_error )

Read Line file register.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_filenum | On success it sets the value to the file number from the Dwarf_Line file register
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_lineaddr()

DW_API int dwarf_lineaddr | ( | Dwarf_Line | dw_line,
|  | Dwarf_Addr * | dw_returned_addr,
|  | Dwarf_Error * | dw_error )

Return the address of the Dwarf_Line.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_addr | On success it sets the value to the value of the address register in the Dwarf_Line.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_linebeginstatement()

DW_API int dwarf_linebeginstatement | ( | Dwarf_Line | dw_line,
|  | Dwarf_Bool * | dw_returned_bool,
|  | Dwarf_Error * | dw_error )

Read Line beginstatement register.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_bool | On success it sets the value TRUE (if the dw_line has the is_stmt register set) and FALSE if is_stmt is not set.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_lineblock()

DW_API int dwarf_lineblock | ( | Dwarf_Line | dw_line,
|  | Dwarf_Bool * | dw_returned_bool,
|  | Dwarf_Error * | dw_error )

Return the basic_block line register.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_bool | On success it sets the flag to TRUE or FALSE from the basic_block register in the line table.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_lineendsequence()

DW_API int dwarf_lineendsequence | ( | Dwarf_Line | dw_line,
|  | Dwarf_Bool * | dw_returned_bool,
|  | Dwarf_Error * | dw_error )

Read Line endsequence register flag.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_bool | On success it sets the value TRUE (if the dw_line has the end_sequence register set) and FALSE if end_sequence is not set.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_lineno()

DW_API int dwarf_lineno | ( | Dwarf_Line | dw_line,
|  | Dwarf_Unsigned * | dw_returned_linenum,
|  | Dwarf_Error * | dw_error )

Read Line line register.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_linenum | On success it sets the value to the line number from the Dwarf_Line line register
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_lineoff_b()

DW_API int dwarf_lineoff_b | ( | Dwarf_Line | dw_line,
|  | Dwarf_Unsigned * | dw_returned_lineoffset,
|  | Dwarf_Error * | dw_error )

Return a column number through the pointer.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_lineoffset | On success it sets the value to the column register from the Dwarf_Line.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_linesrc()

DW_API int dwarf_linesrc | ( | Dwarf_Line | dw_line,
|  | char ** | dw_returned_name,
|  | Dwarf_Error * | dw_error )

Return the file name applicable to the Dwarf_Line.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_returned_name | On success it reads the file register and finds constructs a file name from a directory and filename there and and returns a pointer to that string through the pointer. It is necessary to deallocthe returned string with dwarf_dealloc(dbg, lsrc_filename, DW_DLA_STRING); ( Older versions of this function incorrectly said not to free() or dwarf_dealloc(). )
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

See also
  Using dwarf_srclines_b() and linecontext

## ◆ dwarf_print_lines()

DW_API int dwarf_print_lines | ( | Dwarf_Die | dw_cu_die,
|  | Dwarf_Error * | dw_error,
|  | int * | dw_errorcount_out )

Print line information in great detail.

dwarf_print_lines lets the caller prints line information for a CU in great detail. Does not use printf. Instead it calls back to the application using a function pointer once per line-to-print. The lines passed back already have any needed newlines.

dwarfdump uses this function for verbose printing of line table data.

Failing to call the dwarf_register_printf_callback() function will prevent the lines from being passed back but such omission is not an error. The same function, but focused on checking for errors is dwarf_check_lineheader_b().

See also
  Dwarf_Printf_Callback_Info_s

Parameters

  dw_cu_die | The CU DIE of interest
  dw_error |
  dw_errorcount_out |

Returns
  DW_DLV_OK etc.

## ◆ dwarf_prologue_end_etc()

DW_API int dwarf_prologue_end_etc | ( | Dwarf_Line | dw_line,
|  | Dwarf_Bool * | dw_prologue_end,
|  | Dwarf_Bool * | dw_epilogue_begin,
|  | Dwarf_Unsigned * | dw_isa,
|  | Dwarf_Unsigned * | dw_discriminator,
|  | Dwarf_Error * | dw_error )

Return various line table registers in one call.

Line Table Registers

Parameters

  dw_line | The Dwarf_Line of interest.
  dw_prologue_end | On success it sets the flag to TRUE or FALSE from the prologue_end register in the line table.
  dw_epilogue_begin | On success it sets the flag to TRUE or FALSE from the epilogue_begin register in the line table.
  dw_isa | On success it sets the value to the value of from the isa register in the line table.
  dw_discriminator | On success it sets the value to the value of from the discriminator register in the line table.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_register_printf_callback()

DW_API struct Dwarf_Printf_Callback_Info_s dwarf_register_printf_callback | ( | Dwarf_Debug | dw_dbg,
|  | struct Dwarf_Printf_Callback_Info_s * | dw_callbackinfo )

For line details this records callback details.

Not usually needed. It is a way to check (while using the library) what callback data is in use or to update that callback data.

See also
  Dwarf_Printf_Callback_Info_s

Parameters

  dw_dbg | The Dwarf_Debug of interest.
  dw_callbackinfo | If non-NULL pass in a pointer to your instance of struct Dwarf_Printf_Callback_Info_s with all the fields filled in.

Returns
  If dw_callbackinfo NULL it returns a copy of the current Dwarf_Printf_Callback_Info_s for dw_dbg. Otherwise it returns the previous contents of the struct.

## ◆ dwarf_srcfiles()

DW_API int dwarf_srcfiles | ( | Dwarf_Die | dw_cu_die,
|  | char *** | dw_srcfiles,
|  | Dwarf_Signed * | dw_filecount,
|  | Dwarf_Error * | dw_error )

The list of source files from the line table header.

The array returned by this function applies to a single compilation unit (CU).

The returned array is indexed from 0 (zero) to dw_filecount-1 when the function returns DW_DLV_OK.

In referencing the array via a file-number from a DW_AT_decl_file or DW_AT_call_file attribute one needs to know if the CU is DWARF5 or not.

Line Table Version numbers match compilation unit version numbers except that an experimental line table with line table version 0xfe06 has sometimes been used with DWARF4.

For DWARF5:

The file-number from a DW_AT_decl_file or DW_AT_call_file is the proper index into the array of string pointers.

For DWARF2,3,4, including experimental line table version 0xfe06 and a file-number from a DW_AT_decl_file or DW_AT_call_file:

1. If the file-number is zero there is no file name to find.
2. Otherwise subtract one(1) from the file-number and use the new value as the index into the array of string pointers.

The name strings returned are each assembled in the following way by dwarf_srcfiles():

1. The file number denotes a name in the line table header.
2. If the name is not a full path (i.e. not starting with / in posix/linux/Macos) then prepend the appropriate directory string from the line table header.
3. If the name is still not a full path then prepend the content of the DW_AT_comp_dir attribute of the CU DIE.

To retrieve the line table version call dwarf_srclines_b() and dwarf_srclines_version().

See also
  Using dwarf_srclines_b()

Parameters

  dw_cu_die | The CU DIE in this CU.
  dw_srcfiles | On success allocates an array of pointers to strings and for each such, computes the fullest path possible given the CU DIE data for each file name listed in the line table header.
  dw_filecount | On success returns the number of entries in the array of pointers to strings. The number returned is non-negative.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds. If there is no .debug_line[.dwo] returns DW_DLV_NO_ENTRY.

See also
  Using dwarf_srcfiles()

## ◆ dwarf_srclines_b()

DW_API int dwarf_srclines_b | ( | Dwarf_Die | dw_cudie,
|  | Dwarf_Unsigned * | dw_version_out,
|  | Dwarf_Small * | dw_table_count,
|  | Dwarf_Line_Context * | dw_linecontext,
|  | Dwarf_Error * | dw_error )

Initialize Dwarf_Line_Context for line table access.

Returns Dwarf_Line_Context pointer, needed for access to line table data. Returns the line table version number (needed to use dwarf_srcfiles() properly).

See also
  Using dwarf_srclines_b()
  Using dwarf_srclines_b() and linecontext

Parameters

  dw_cudie | The Compilation Unit (CU) DIE of interest.
  dw_version_out | The DWARF Line Table version number (Standard: 2,3,4, or 5) Version 0xf006 is an experimental (two-level) line table.
  dw_table_count | Zero or one means this is a normal DWARF line table. Two means this is an experimental two-level line table.
  dw_linecontext | On success sets the pointer to point to an opaque structure usable for further queries.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_comp_dir()

DW_API int dwarf_srclines_comp_dir | ( | Dwarf_Line_Context | dw_context,
|  | const char ** | dw_compilation_directory,
|  | Dwarf_Error * | dw_error )

Compilation Directory name for the CU.

Do not free() or dealloc the string, it is in a dwarf section.

Parameters

  dw_context | The Line Context of interest.
  dw_compilation_directory | On success returns a pointer to a string identifying the compilation directory of the CU.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_dealloc_b()

DW_API void dwarf_srclines_dealloc_b | ( | Dwarf_Line_Context | dw_context | ) |

Dealloc the memory allocated by dwarf_srclines_b.

The way to deallocate (free) a Dwarf_Line_Context

Parameters

  dw_context | The context to be dealloced (freed). On return the pointer passed in is stale and calling applications should zero the pointer.

## ◆ dwarf_srclines_files_data_b()

DW_API int dwarf_srclines_files_data_b | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Signed | dw_index_in,
|  | const char ** | dw_name,
|  | Dwarf_Unsigned * | dw_directory_index,
|  | Dwarf_Unsigned * | dw_last_mod_time,
|  | Dwarf_Unsigned * | dw_file_length,
|  | Dwarf_Form_Data16 ** | dw_md5ptr,
|  | Dwarf_Error * | dw_error )

Access data for each line table file.

Has the md5ptr field so cases where DW_LNCT_MD5 is present can return pointer to the MD5 value. With DWARF 5 index starts with 0. dwarf_srclines_files_indexes() makes indexing through the files easy.

See also
  dwarf_srclines_files_indexes
  Using dwarf_srclines_b()

Parameters

  dw_context | The line context of interest.
  dw_index_in | The entry of interest. Callers should index as dw_baseindex through dw_endindex-1.
  dw_name | If dw_name non-null on success returns The file name in the line table header through the pointer.
  dw_directory_index | If dw_directory_index non-null on success returns the directory number in the line table header through the pointer.
  dw_last_mod_time | If dw_last_mod_time non-null on success returns the directory last modification date/time through the pointer.
  dw_file_length | If dw_file_length non-null on success returns the file length recorded in the line table through the pointer.
  dw_md5ptr | If dw_md5ptr non-null on success returns a pointer to the 16byte MD5 hash of the file through the pointer. If there is no md5 value present it returns 0 through the pointer.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_files_indexes()

DW_API int dwarf_srclines_files_indexes | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Signed * | dw_baseindex,
|  | Dwarf_Signed * | dw_count,
|  | Dwarf_Signed * | dw_endindex,
|  | Dwarf_Error * | dw_error )

Return values easing indexing line table file numbers. Count is the real count of files array entries. Since DWARF 2,3,4 are zero origin indexes and DWARF5 and later are one origin, this function replaces dwarf_srclines_files_count().

Parameters

  dw_context | The line context of interest.
  dw_baseindex | On success returns the base index of valid file indexes. With DWARF2,3,4 the value is 1. With DWARF5 the value is 0.
  dw_count | On success returns the real count of entries.
  dw_endindex | On success returns value such that callers should index as dw_baseindex through dw_endindex-1.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

See also
  Using dwarf_srclines_b()

## ◆ dwarf_srclines_from_linecontext()

DW_API int dwarf_srclines_from_linecontext | ( | Dwarf_Line_Context | dw_linecontext,
|  | Dwarf_Line ** | dw_linebuf,
|  | Dwarf_Signed * | dw_linecount,
|  | Dwarf_Error * | dw_error )

Access source lines from line context.

Provides access to Dwarf_Line data from a Dwarf_Line_Context on a standard line table.

Parameters

  dw_linecontext | The line context of interest.
  dw_linebuf | On success returns an array of pointers to Dwarf_Line.
  dw_linecount | On success returns the count of entries in dw_linebuf. If dw_linecount is returned as zero this is a line table with no lines.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_include_dir_count()

DW_API int dwarf_srclines_include_dir_count | ( | Dwarf_Line_Context | dw_line_context,
|  | Dwarf_Signed * | dw_count,
|  | Dwarf_Error * | dw_error )

Return the number of include directories in the Line Table.

Parameters

  dw_line_context | The line context of interest.
  dw_count | On success returns the count of directories. How to use this depends on the line table version number.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

See also
  dwarf_srclines_include_dir_data

## ◆ dwarf_srclines_include_dir_data()

DW_API int dwarf_srclines_include_dir_data | ( | Dwarf_Line_Context | dw_line_context,
|  | Dwarf_Signed | dw_index,
|  | const char ** | dw_name,
|  | Dwarf_Error * | dw_error )

Return the include directories in the Line Table.

Parameters

  dw_line_context | The line context of interest.
  dw_index | Pass in an index to the line context list of include directories. If the line table is version 2,3, or 4, the valid indexes are 1 through dw_count. If the line table is version 5 the valid indexes are 0 through dw_count-1.
  dw_name | On success it returns a pointer to a directory name. Do not free/deallocate the string.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

See also
  dwarf_srclines_include_dir_count

## ◆ dwarf_srclines_subprog_count()

DW_API int dwarf_srclines_subprog_count | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Signed * | dw_count,
|  | Dwarf_Error * | dw_error )

Subprog count: Part of the two-level line table extension.

A non-standard table. The actual meaning of subprog count left undefined here.

Parameters

  dw_context | The Dwarf_Line_Context of interest.
  dw_count | On success returns the two-level line table subprogram array size in this line context.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_subprog_data()

DW_API int dwarf_srclines_subprog_data | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Signed | dw_index,
|  | const char ** | dw_name,
|  | Dwarf_Unsigned * | dw_decl_file,
|  | Dwarf_Unsigned * | dw_decl_line,
|  | Dwarf_Error * | dw_error )

Retrieve data from the line table subprog array.

A non-standard table. Not defined here.

Parameters

  dw_context | The Dwarf_Line_Context of interest.
  dw_index | The item to retrieve. Valid indexes are 1 through dw_count.
  dw_name | On success returns a pointer to the subprog name.
  dw_decl_file | On success returns a file number through the pointer.
  dw_decl_line | On success returns a line number through the pointer.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_table_offset()

DW_API int dwarf_srclines_table_offset | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Unsigned * | dw_offset,
|  | Dwarf_Error * | dw_error )

Return the srclines table offset.

The offset is in the relevant .debug_line or .debug_line.dwo section (and in a split dwarf package file includes the base line table offset).

Parameters

  dw_context |
  dw_offset | On success returns the section offset of the dw_context.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.

## ◆ dwarf_srclines_two_level_from_linecontext()

DW_API int dwarf_srclines_two_level_from_linecontext | ( | Dwarf_Line_Context | dw_context,
|  | Dwarf_Line ** | dw_linebuf,
|  | Dwarf_Signed * | dw_linecount,
|  | Dwarf_Line ** | dw_linebuf_actuals,
|  | Dwarf_Signed * | dw_linecount_actuals,
|  | Dwarf_Error * | dw_error )

Returns line table counts and data.

Works for DWARF2,3,4,5 and for experimental two-level line tables. A single level table will have *linebuf_actuals and *linecount_actuals set to 0.

Two-level line tables are non-standard and not documented further. For standard (one-level) tables, it will return the single table through dw_linebuf, and the value returned through dw_linecount_actuals will be 0.

People not using these two-level tables should dwarf_srclines_from_linecontext instead.

## ◆ dwarf_srclines_version()

DW_API int dwarf_srclines_version | ( | Dwarf_Line_Context | dw_line_context,
|  | Dwarf_Unsigned * | dw_version,
|  | Dwarf_Small * | dw_table_count,
|  | Dwarf_Error * | dw_error )

The DWARF version number of this compile-unit.

The .debug_lines[.dwo] table count informs about the line table version and the type of line table involved.

Meaning of the value returned via dw_table_count:

- 0 The table is a header with no lines.
- 1 The table is a standard line table.
- 2 The table is an experimental line table.

Parameters

  dw_line_context | The Line Context of interest.
  dw_version | On success, returns the line table version through the pointer.
  dw_table_count | On success, returns the tablecount through the pointer. If the table count is zero the line table is a header with no lines. If the table count is 1 this is a standard line table. If the table count is this is an experimental two-level line table.
  dw_error | The usual error pointer.

Returns
  DW_DLV_OK if it succeeds.