Skip to content

Debuginfo level #333

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jun 11, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/compiler-debugging.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,10 @@ stack backtrace:
37: rustc_driver::run_compiler
```

If you want line numbers for the stack trace, you can enable
`debuginfo-level = 1` or `debuginfo-level = 2` in your config.toml and rebuild the
compiler. Then the backtrace will look like this:
If you want line numbers for the stack trace, you can enable `debug = true` in
your config.toml and rebuild the compiler (`debuginfo-level = 1` will also add
line numbers, but `debug = true` gives full debuginfo). Then the backtrace will
look like this:

```text
stack backtrace:
Expand Down
14 changes: 7 additions & 7 deletions src/how-to-build-and-run.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,17 +28,17 @@ settings (and possibly others, such as `llvm.ccache`):
assertions = true

[rust]
# This enables some assertions, but more importantly it enables the `debug!`
# logging macros that are essential for debugging `rustc`.
debug-assertions = true

# This will make your build more parallel; it costs a bit of runtime
# performance perhaps (less inlining) but it's worth it.
codegen-units = 0

# I always enable full debuginfo, however the line debuginfo (which is a more important part
# and enables e.g. line numbers in backtraces) is enabled by `debuginfo-level = 1` too.
debuginfo-level = 2
# This enables full debuginfo and debug assertions. The line debuginfo is also
# enabled by `debuginfo-level = 1`. Full debuginfo is also enabled by
# `debuginfo-level = 2`. Debug assertions can also be enabled with
# `debug-assertions = true`. Note that `debug = true` will make your build
# slower, so you may want to try individually enabling debuginfo and assertions
# or enable only line debuginfo which is basically free.
debug = true
```

### What is `x.py`?
Expand Down