DWARFGEN(1)

✨ NAME ✨

okay so bestie, welcome to dwarfgen β€” it generates example DWARF data. that's it, that's the job, she's a little generator girlie and she's serving πŸ’… (this is from the dwarfdump and libdwarf manual set, in case you were wondering which family she runs with 🫢)


🌸 SYNOPSIS 🌸

dwarfgen [-t type] [-o outpath] [-c -cunum] pathname

πŸ¦‹ DESCRIPTION πŸ¦‹

so the way dwarfgen works is she creates DWARF sections as requested by specific options. lowkey iconic behaviour.

using some information source, she creates a tree of dwarf information (we're talking about a DIE tree, iykyk 🌳). then she turns that die tree into dwarfdata using the libdwarf producer, and writes the resulting data into an object file. and ngl, she's a bit inconsistent in error handling β€” but that's on purpose, bestie, it's literally just to demonstrate the various possibilities you get from the producer library. it's giving "demo, not production," fr fr.

πŸŽ€ Main options πŸŽ€

  • -t type β€” tells her what sort of input to read. may be one of:
    • def β€” means predefined. no input is read at all; the output is based on some canned setups built right into dwarfgen. path is ignored in this case. this is the default, and it does not work. πŸ’€ yeah. we know. she said what she said.
    • 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 you don't supply it, testout.o is used as the default output path. simple as that πŸ“
  • -c cunum β€” supplies a CU number of the obj type input to read. because the dwarf producer wants just one CU, okay?? she's monogamous like that. the 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.

ngl bestie, this is the part where I remind you: the def type is the default and it does not work. she's not being shady, she's being honest. ✨

okay and for the little sign-off moment: this one's a Debian page, stamped with $Mdocdate$, and she lives under the manual name DWARFGEN(1) β€” which we already shouted out at the top because that's just how we do it around here. mwah. πŸ«ΆπŸ‘‘

πŸ“¦ where this page comes from