dwz command examples

dwz command examples

dwz – DWARF optimization and duplicate removal tool

$ dwz -m .dwz/foobar-1.2.debug -rh \
bin/foo.debug bin/foo2.debug foo/lib/libbar.so.debug

will attempt to optimize debugging information in bin/foo.debug, bin/foo2.debug and lib/libbar.so.debug (by modifying the files in place) and when beneficial also will create .dwz/foobar-1.2.debug file. .gnu_debugaltlink section in the first two files will refer to ../.dwz/foobar-1.2.debug and in the last file to ../../.dwz/foobar-1.2.debug.

If e.g. bin/foo.debug and bin/foo2.debug were hardlinked together initially, they will be hardlinked again and for multifile optimizations considered just as a single file rather than two.

$ dwz -o foo.dwz foo

will not modify foo but instead store the ELF object with optimized debugging information if successful into foo.dwz file it creates.

$ dwz *.debug foo/*.debug

will attempt to optimize debugging information in *.debug and foo/*.debug files, optimizing each file individually in place.

$ dwz

is equivalent to dwz a.out command.

 

Leave a Reply

Your email address will not be published. Required fields are marked *