You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto merge of rust-lang#109808 - jyn514:debuginfo-options, r=michaelwoerister
Extend -Cdebuginfo with new options and named aliases
This is a rebase of rust-lang#83947, along with my best guess at what the new options mean. I tried to follow the LLVM source code to get a better idea but ran into quite a lot of trouble (https://rust-lang.zulipchat.com/#narrow/stream/187780-t-compiler.2Fwg-llvm/topic/go-to-definition.20in.20src.2Fllvm-project.3F). The description for the original PR follows below.
Note that the changes in this PR have already been through FCP: rust-lang#83947 (comment)Closesrust-lang#109311. Helps with rust-lang#104968.
r? `@michaelwoerister` cc `@cuviper`
---
The -Cdebuginfo=1 option was never line tables only and can't be due to backwards compatibility issues. This was clarified and an option for emitting line tables only was added. Additionally an option for emitting line info directives only was added, which is needed for some targets, i.e. nvptx. The debug info options should now behave similarly to clang's debug info options.
Fixrust-lang#60020Fixrust-lang#64405
Copy file name to clipboardExpand all lines: src/doc/rustc/src/codegen-options/index.md
+5-3
Original file line number
Diff line number
Diff line change
@@ -71,9 +71,11 @@ If not specified, debug assertions are automatically enabled only if the
71
71
This flag controls the generation of debug information. It takes one of the
72
72
following values:
73
73
74
-
*`0`: no debug info at all (the default).
75
-
*`1`: line tables only.
76
-
*`2`: full debug info.
74
+
*`0` or `none`: no debug info at all (the default).
75
+
*`line-directives-only`: line info directives only. For the nvptx* targets this enables [profiling](https://reviews.llvm.org/D46061). For other use cases, `line-tables-only` is the better, more compatible choice.
76
+
*`line-tables-only`: line tables only. Generates the minimal amount of debug info for backtraces with filename/line number info, but not anything else, i.e. no variable or function parameter info.
77
+
*`1` or `limited`: debug info without type or variable-level information.
78
+
*`2` or `full`: full debug info.
77
79
78
80
Note: The [`-g` flag][option-g-debug] is an alias for `-C debuginfo=2`.
Copy file name to clipboardExpand all lines: tests/rustdoc-ui/c-help.stdout
+1-1
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
-C codegen-units=val -- divide crate into N units to optimize in parallel
4
4
-C control-flow-guard=val -- use Windows Control Flow Guard (default: no)
5
5
-C debug-assertions=val -- explicitly enable the `cfg(debug_assertions)` directive
6
-
-C debuginfo=val -- debug info emission level (0 = no debug info, 1 = linetablesonly, 2 = full debug info with variable and type information; default: 0)
6
+
-C debuginfo=val -- debug info emission level (0-2, none, line-directives-only, line-tables-only, limited, or full; default: 0)
7
7
-C default-linker-libraries=val -- allow the linker to link its default libraries (default: no)
8
8
-C embed-bitcode=val -- emit bitcode in rlibs (default: yes)
9
9
-C extra-filename=val -- extra data to put in each output filename
0 commit comments