aboutsummaryrefslogtreecommitdiff
path: root/usr.bin/clang/llvm-dwarfutil
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/clang/llvm-dwarfutil')
-rw-r--r--usr.bin/clang/llvm-dwarfutil/Makefile23
-rw-r--r--usr.bin/clang/llvm-dwarfutil/llvm-dwarfutil.1168
2 files changed, 191 insertions, 0 deletions
diff --git a/usr.bin/clang/llvm-dwarfutil/Makefile b/usr.bin/clang/llvm-dwarfutil/Makefile
new file mode 100644
index 000000000000..884ce922492e
--- /dev/null
+++ b/usr.bin/clang/llvm-dwarfutil/Makefile
@@ -0,0 +1,23 @@
+PROG_CXX= llvm-dwarfutil
+
+SRCDIR= llvm/tools/llvm-dwarfutil
+SRCS+= DebugInfoLinker.cpp
+SRCS+= llvm-dwarfutil.cpp
+
+.include "${SRCTOP}/lib/clang/llvm.pre.mk"
+
+CFLAGS+= -I${.OBJDIR}
+
+INCFILE= Options.inc
+TDFILE= ${LLVM_BASE}/${SRCDIR}/Options.td
+GENOPT= -gen-opt-parser-defs
+${INCFILE}: ${TDFILE}
+ ${LLVM_TBLGEN} ${GENOPT} -I ${LLVM_SRCS}/include -d ${.TARGET:C/$/.d/} \
+ -o ${.TARGET} ${TDFILE}
+TGHDRS+= ${INCFILE}
+
+DEPENDFILES+= ${TGHDRS:C/$/.d/}
+DPSRCS+= ${TGHDRS}
+CLEANFILES+= ${TGHDRS} ${TGHDRS:C/$/.d/}
+
+.include "../llvm.prog.mk"
diff --git a/usr.bin/clang/llvm-dwarfutil/llvm-dwarfutil.1 b/usr.bin/clang/llvm-dwarfutil/llvm-dwarfutil.1
new file mode 100644
index 000000000000..15015e96f5a7
--- /dev/null
+++ b/usr.bin/clang/llvm-dwarfutil/llvm-dwarfutil.1
@@ -0,0 +1,168 @@
+.\" Man page generated from reStructuredText.
+.
+.
+.nr rst2man-indent-level 0
+.
+.de1 rstReportMargin
+\\$1 \\n[an-margin]
+level \\n[rst2man-indent-level]
+level margin: \\n[rst2man-indent\\n[rst2man-indent-level]]
+-
+\\n[rst2man-indent0]
+\\n[rst2man-indent1]
+\\n[rst2man-indent2]
+..
+.de1 INDENT
+.\" .rstReportMargin pre:
+. RS \\$1
+. nr rst2man-indent\\n[rst2man-indent-level] \\n[an-margin]
+. nr rst2man-indent-level +1
+.\" .rstReportMargin post:
+..
+.de UNINDENT
+. RE
+.\" indent \\n[an-margin]
+.\" old: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.nr rst2man-indent-level -1
+.\" new: \\n[rst2man-indent\\n[rst2man-indent-level]]
+.in \\n[rst2man-indent\\n[rst2man-indent-level]]u
+..
+.TH "LLVM-DWARFUTIL" "1" "2023-05-24" "16" "LLVM"
+.SH NAME
+llvm-dwarfutil \- A tool to copy and manipulate debug info
+.SH SYNOPSIS
+.sp
+\fBllvm\-dwarfutil\fP [\fIoptions\fP] \fIinput\fP \fIoutput\fP
+.SH DESCRIPTION
+.sp
+\fBllvm\-dwarfutil\fP is a tool to copy and manipulate debug info.
+.sp
+In basic usage, it makes a semantic copy of the input to the output. If any
+options are specified, the output may be modified along the way, e.g.
+by removing unused debug info.
+.sp
+If \(dq\-\(dq is specified for the input file, the input is read from the program\(aqs
+standard input stream. If \(dq\-\(dq is specified for the output file, the output
+is written to the standard output stream of the program.
+.sp
+The tool is still in active development.
+.SH COMMAND-LINE OPTIONS
+.INDENT 0.0
+.TP
+.B \-\-garbage\-collection
+Removes pieces of debug information related to discarded sections.
+When the linker does section garbage collection the abandoned debug info
+is left behind. Such abandoned debug info references address ranges using
+tombstone values. Thus, when this option is specified, the tool removes
+debug info which is marked with the tombstone value.
+.sp
+That option is enabled by default.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-odr\-deduplication
+Remove duplicated types (if \(dqOne Definition Rule\(dq is supported by source
+language). Keeps first type definition and removes other definitions,
+potentially significantly reducing the size of output debug info.
+.sp
+That option is enabled by default.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-help, \-h
+Print a summary of command line options.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-no\-garbage\-collection
+Disable \fI\%\-\-garbage\-collection\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-no\-odr\-deduplication
+Disable \fI\%\-\-odr\-deduplication\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-no\-separate\-debug\-file
+Disable \fI\%\-\-separate\-debug\-file\fP\&.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-num\-threads=<n>, \-j
+Specifies the maximum number (\fIn\fP) of simultaneous threads to use
+for processing.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-separate\-debug\-file
+Generate separate file containing output debug info. Using
+\fBllvm\-dwarfutil\fP with that option equals to the
+following set of commands:
+.UNINDENT
+.INDENT 0.0
+.INDENT 3.5
+.sp
+.nf
+.ft C
+:program:\(gallvm\-objcopy\(ga \-\-only\-keep\-debug in\-file out\-file.debug
+:program:\(gallvm\-objcopy\(ga \-\-strip\-debug in\-file out\-file
+:program:\(gallvm\-objcopy\(ga \-\-add\-gnu\-debuglink=out\-file.debug out\-file
+.ft P
+.fi
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-tombstone=<value>
+<value> can be one of the following values:
+.INDENT 7.0
+.INDENT 3.5
+.INDENT 0.0
+.IP \(bu 2
+\fIbfd\fP: zero for all addresses and [1,1] for DWARF v4 (or less) address ranges and exec.
+.IP \(bu 2
+\fImaxpc\fP: \-1 for all addresses and \-2 for DWARF v4 (or less) address ranges.
+.IP \(bu 2
+\fIuniversal\fP: both \fIbfd\fP and \fImaxpc\fP\&.
+.IP \(bu 2
+\fIexec\fP: match with address ranges of executable sections.
+.UNINDENT
+.sp
+The value \fIuniversal\fP is used by default.
+.UNINDENT
+.UNINDENT
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-verbose
+Enable verbose logging. This option disables multi\-thread mode.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-verify
+Run the DWARF verifier on the output DWARF debug info.
+.UNINDENT
+.INDENT 0.0
+.TP
+.B \-\-version
+Print the version of this program.
+.UNINDENT
+.SH SUPPORTED FORMATS
+.sp
+The following formats are currently supported by \fBllvm\-dwarfutil\fP:
+.sp
+ELF
+.SH EXIT STATUS
+.sp
+\fBllvm\-dwarfutil\fP exits with a non\-zero exit code if there is an error.
+Otherwise, it exits with code 0.
+.SH BUGS
+.sp
+To report bugs, please visit <\fI\%https://github.com/llvm/llvm\-project/labels/tools:llvm\-dwarfutil/\fP>.
+.SH AUTHOR
+Maintained by the LLVM Team (https://llvm.org/).
+.SH COPYRIGHT
+2003-2023, LLVM Project
+.\" Generated by docutils manpage writer.
+.