libdwarf
Functions
Line Table For a CU

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
void dwarf_srclines_dealloc_b (Dwarf_Line_Context dw_context)
 Dealloc the memory allocated by dwarf_srclines_b. More...
 
int dwarf_srclines_table_offset (Dwarf_Line_Context dw_context, Dwarf_Unsigned *dw_offset, Dwarf_Error *dw_error)
 Return the srclines table offset. More...
 
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. More...
 
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. More...
 
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. More...
 
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(). More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
int dwarf_linebeginstatement (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
 Read Line beginstatement register. More...
 
int dwarf_lineendsequence (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
 Read Line endsequence register flag. More...
 
int dwarf_lineno (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_linenum, Dwarf_Error *dw_error)
 Read Line line register. More...
 
int dwarf_line_srcfileno (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_filenum, Dwarf_Error *dw_error)
 Read Line file register. More...
 
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. More...
 
int dwarf_lineaddr (Dwarf_Line dw_line, Dwarf_Addr *dw_returned_addr, Dwarf_Error *dw_error)
 Return the address of the Dwarf_Line. More...
 
int dwarf_lineoff_b (Dwarf_Line dw_line, Dwarf_Unsigned *dw_returned_lineoffset, Dwarf_Error *dw_error)
 Return a column number through the pointer. More...
 
int dwarf_linesrc (Dwarf_Line dw_line, char **dw_returned_name, Dwarf_Error *dw_error)
 Return the file name applicable to the Dwarf_Line. More...
 
int dwarf_lineblock (Dwarf_Line dw_line, Dwarf_Bool *dw_returned_bool, Dwarf_Error *dw_error)
 Return the basic_block line register. More...
 
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. More...
 
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.
 
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.
 
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.
 
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.
 
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. More...
 
int dwarf_print_lines (Dwarf_Die dw_cu_die, Dwarf_Error *dw_error, int *dw_errorcount_out)
 Print line information in great detail. More...
 
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. More...
 

Detailed Description

Access to all the line table details.

Function Documentation

◆ dwarf_srcfiles()

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

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_dieThe CU DIE in this CU.
dw_srcfilesOn 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_filecountOn success returns the number of entries in the array of pointers to strings. The number returned is non-negative.
dw_errorThe 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()

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 
)

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_cudieThe Compilation Unit (CU) DIE of interest.
dw_version_outThe DWARF Line Table version number (Standard: 2,3,4, or 5) Version 0xf006 is an experimental (two-level) line table.
dw_table_countZero or one means this is a normal DWARF line table. Two means this is an experimental two-level line table.
dw_linecontextOn success sets the pointer to point to an opaque structure usable for further queries.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_from_linecontext()

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

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

Parameters
dw_linecontextThe line context of interest.
dw_linebufOn success returns an array of pointers to Dwarf_Line.
dw_linecountOn 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_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_two_level_from_linecontext()

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 
)

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_dealloc_b()

void dwarf_srclines_dealloc_b ( Dwarf_Line_Context  dw_context)

The way to deallocate (free) a Dwarf_Line_Context

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

◆ dwarf_srclines_table_offset()

int dwarf_srclines_table_offset ( Dwarf_Line_Context  dw_context,
Dwarf_Unsigned dw_offset,
Dwarf_Error dw_error 
)

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_offsetOn success returns the section offset of the dw_context.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_comp_dir()

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

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

Parameters
dw_contextThe Line Context of interest.
dw_compilation_directoryOn success returns a pointer to a string identifying the compilation directory of the CU.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_subprog_count()

int dwarf_srclines_subprog_count ( Dwarf_Line_Context  dw_context,
Dwarf_Signed dw_count,
Dwarf_Error dw_error 
)

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

Parameters
dw_contextThe Dwarf_Line_Context of interest.
dw_countOn success returns the two-level line table subprogram array size in this line context.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_subprog_data()

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 
)

A non-standard table. Not defined here.

Parameters
dw_contextThe Dwarf_Line_Context of interest.
dw_indexThe item to retrieve. Valid indexes are 1 through dw_count.
dw_nameOn success returns a pointer to the subprog name.
dw_decl_fileOn success returns a file number through the pointer.
dw_decl_lineOn success returns a line number through the pointer.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_files_indexes()

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 
)
Parameters
dw_contextThe line context of interest.
dw_baseindexOn success returns the base index of valid file indexes. With DWARF2,3,4 the value is 1. With DWARF5 the value is 0.
dw_countOn success returns the real count of entries.
dw_endindexOn success returns value such that callers should index as dw_baseindex through dw_endindex-1.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.
See also
Using dwarf_srclines_b()

◆ dwarf_srclines_files_data_b()

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 
)

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_contextThe line context of interest.
dw_index_inThe entry of interest. Callers should index as dw_baseindex through dw_endindex-1.
dw_nameIf dw_name non-null on success returns The file name in the line table header through the pointer.
dw_directory_indexIf dw_directory_index non-null on success returns the directory number in the line table header through the pointer.
dw_last_mod_timeIf dw_last_mod_time non-null on success returns the directory last modification date/time through the pointer.
dw_file_lengthIf dw_file_length non-null on success returns the file length recorded in the line table through the pointer.
dw_md5ptrIf 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_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_srclines_include_dir_count()

int dwarf_srclines_include_dir_count ( Dwarf_Line_Context  dw_line_context,
Dwarf_Signed dw_count,
Dwarf_Error dw_error 
)
Parameters
dw_line_contextThe line context of interest.
dw_countOn success returns the count of directories. How to use this depends on the line table version number.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.
See also
dwarf_srclines_include_dir_data

◆ dwarf_srclines_include_dir_data()

int dwarf_srclines_include_dir_data ( Dwarf_Line_Context  dw_line_context,
Dwarf_Signed  dw_index,
const char **  dw_name,
Dwarf_Error dw_error 
)
Parameters
dw_line_contextThe line context of interest.
dw_indexPass 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_nameOn success it returns a pointer to a directory name. Do not free/deallocate the string.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.
See also
dwarf_srclines_include_dir_count

◆ dwarf_srclines_version()

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

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_contextThe Line Context of interest.
dw_versionOn success, returns the line table version through the pointer.
dw_table_countOn 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_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_linebeginstatement()

int dwarf_linebeginstatement ( Dwarf_Line  dw_line,
Dwarf_Bool dw_returned_bool,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_boolOn 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_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_lineendsequence()

int dwarf_lineendsequence ( Dwarf_Line  dw_line,
Dwarf_Bool dw_returned_bool,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_boolOn 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_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_lineno()

int dwarf_lineno ( Dwarf_Line  dw_line,
Dwarf_Unsigned dw_returned_linenum,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_linenumOn success it sets the value to the line number from the Dwarf_Line line register
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_line_srcfileno()

int dwarf_line_srcfileno ( Dwarf_Line  dw_line,
Dwarf_Unsigned dw_returned_filenum,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_filenumOn success it sets the value to the file number from the Dwarf_Line file register
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_line_is_addr_set()

int dwarf_line_is_addr_set ( Dwarf_Line  dw_line,
Dwarf_Bool dw_is_addr_set,
Dwarf_Error dw_error 
)
Parameters
dw_lineThe Dwarf_Line of interest.
dw_is_addr_setOn success it sets the flag to TRUE or FALSE.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_lineaddr()

int dwarf_lineaddr ( Dwarf_Line  dw_line,
Dwarf_Addr dw_returned_addr,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_addrOn success it sets the value to the value of the address register in the Dwarf_Line.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_lineoff_b()

int dwarf_lineoff_b ( Dwarf_Line  dw_line,
Dwarf_Unsigned dw_returned_lineoffset,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_lineoffsetOn success it sets the value to the column register from the Dwarf_Line.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_linesrc()

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

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_nameOn success it reads the file register and finds the source file name from the line table header and returns a pointer to that file name string through the pointer.
dw_errorThe usual error pointer. Do not dealloc or free the string.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_lineblock()

int dwarf_lineblock ( Dwarf_Line  dw_line,
Dwarf_Bool dw_returned_bool,
Dwarf_Error dw_error 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_returned_boolOn success it sets the flag to TRUE or FALSE from the basic_block register in the line table.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_prologue_end_etc()

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 
)

Line Table Registers

Parameters
dw_lineThe Dwarf_Line of interest.
dw_prologue_endOn success it sets the flag to TRUE or FALSE from the prologue_end register in the line table.
dw_epilogue_beginOn success it sets the flag to TRUE or FALSE from the epilogue_begin register in the line table.
dw_isaOn success it sets the value to the value of from the isa register in the line table.
dw_discriminatorOn success it sets the value to the value of from the discriminator register in the line table.
dw_errorThe usual error pointer.
Returns
DW_DLV_OK if it succeeds.

◆ dwarf_check_lineheader_b()

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

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_dieThe CU DIE of interest
dw_errorIf DW_DLV_ERROR this shows one error encountered.
dw_errcount_outReturns the count of detected errors through the pointer.
Returns
DW_DLV_OK etc.

◆ dwarf_print_lines()

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

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_dieThe CU DIE of interest
dw_error
dw_errorcount_out
Returns
DW_DLV_OK etc.

◆ dwarf_register_printf_callback()

struct Dwarf_Printf_Callback_Info_s dwarf_register_printf_callback ( Dwarf_Debug  dw_dbg,
struct Dwarf_Printf_Callback_Info_s dw_callbackinfo 
)

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_dbgThe Dwarf_Debug of interest.
dw_callbackinfoIf 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.