Skip to content

Commit

Permalink
allow to set line-directives-only too
Browse files Browse the repository at this point in the history
  • Loading branch information
klensy committed Apr 17, 2024
1 parent 3ea7cf5 commit 1d929cf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
7 changes: 2 additions & 5 deletions config.example.toml
Original file line number Diff line number Diff line change
Expand Up @@ -517,11 +517,8 @@
#overflow-checks-std = rust.overflow-checks (boolean)

# Debuginfo level for most of Rust code, corresponds to the `-C debuginfo=N` option of `rustc`.
# `0` - no debug info
# `1` - line tables only - sufficient to generate backtraces that include line
# information and inlined functions, set breakpoints at source code
# locations, and step through execution in a debugger.
# `2` - full debug info with variable and type information
# See https://doc.rust-lang.org/rustc/codegen-options/index.html#debuginfo for available options.
#
# Can be overridden for specific subsets of Rust code (rustc, std or tools).
# Debuginfo for tests run with compiletest is not controlled by this option
# and needs to be enabled separately with `debuginfo-level-tests`.
Expand Down
5 changes: 5 additions & 0 deletions src/bootstrap/src/core/config/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ pub enum DryRun {
pub enum DebuginfoLevel {
#[default]
None,
LineDirectivesOnly,
LineTablesOnly,
Limited,
Full,
Expand All @@ -72,6 +73,9 @@ impl<'de> Deserialize<'de> for DebuginfoLevel {
Ok(match Deserialize::deserialize(deserializer)? {
StringOrInt::String(s) if s == "none" => DebuginfoLevel::None,
StringOrInt::Int(0) => DebuginfoLevel::None,
StringOrInt::String(s) if s == "line-directives-only" => {
DebuginfoLevel::LineDirectivesOnly
}
StringOrInt::String(s) if s == "line-tables-only" => DebuginfoLevel::LineTablesOnly,
StringOrInt::String(s) if s == "limited" => DebuginfoLevel::Limited,
StringOrInt::Int(1) => DebuginfoLevel::Limited,
Expand All @@ -98,6 +102,7 @@ impl Display for DebuginfoLevel {
use DebuginfoLevel::*;
f.write_str(match self {
None => "0",
LineDirectivesOnly => "line-directives-only",
LineTablesOnly => "line-tables-only",
Limited => "1",
Full => "2",
Expand Down

0 comments on commit 1d929cf

Please sign in to comment.