DWARFGEN(1) dwarfdump and libdwarf DWARFGEN(1)
NAME
dwarfgen — generate example DWARF data.
SYNOPSIS
dwarfgen [−t type] [−o outpath] [−c −cunum] pathname
DESCRIPTION
The dwarfgen creates DWARF sections as requested by specific options.
Using some information source, create a tree of dwarf information (speaking of a DIE tree). Turn the die tree into dwarfdata using libdwarf producer and write the resulting data in an object file. It is a bit inconsistent in error handling just to demonstrate the various possibilities using the producer library.
Main options:
−t type
what sort of input to read. May be one of:
def
means predefined (no input is read, the output is based on some canned setups built into dwarfgen). path is ignored in this case. This is the default, and does not work.
obj
means path is the object file to read (The dwarf sections are duplicated in the output file.) Requires path.
txt
path contains plain text (in a form rather like output by dwarfdump) that defines the dwarf that is to be output. Requires path.
−o outpath
specifies the pathname of the output object. If not supplied, testout.o is used as the default output path.
−c cunum
supplies a CU number of the ‘obj’ type input to read . because the dwarf producer wants just one CU. Default is -1 which won’t match anything.
Other options:
−h
transform high PC to const.
−s
output as text.
−r
show relocation details.
−v version
DWARF version 2, 3, 4, or 5.
−p size
pointer size, 4 or 8.
−f offset
offset size, 4 or 8. GNU $Mdocdate$ DWARFGEN(1)