Skip to content

debuginfo: Add option for cheap, line-table-only debuginfo (fixes #12280) #12714

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 3 commits into from
Mar 6, 2014

Conversation

michaelwoerister
Copy link
Member

This PR brings back limited debuginfo which allows for nice backtraces and breakpoints, but omits any info about variables and types.

The -g and --debuginfo command line options have been extended to take an optional argument:
-g0 means no debug info.
-g1 means line-tables only.
-g2 means full debug info.

Specifying -g without argument is equivalent to -g2.

Fixes #12280

@thestinger
Copy link
Contributor

Reminds me that I need to update the zsh completion file...

@alexcrichton
Copy link
Member

Just a few small things, but this is awesome, nice work!

@michaelwoerister
Copy link
Member Author

Thanks for taking a look at it. I'll take care of the issues first thing tomorrow morning.

@michaelwoerister
Copy link
Member Author

I fixed the file permissions issues.

bors added a commit that referenced this pull request Mar 6, 2014
…xcrichton

This PR brings back limited debuginfo which allows for nice backtraces and breakpoints, but omits any info about variables and types.

The `-g` and `--debuginfo` command line options have been extended to take an optional argument:
`-g0` means no debug info.
`-g1` means line-tables only.
`-g2` means full debug info.

Specifying `-g` without argument is equivalent to `-g2`.

Fixes #12280
@bors bors closed this Mar 6, 2014
@bors bors merged commit a5b4d94 into rust-lang:master Mar 6, 2014
@pnkfelix
Copy link
Member

hmm, it seems like this might be using some semi-flaky parts of our getopts library.

In particular:

% rustc /tmp/hw.rs -g
% rustc -g /tmp/hw.rs
error: no input filename given
% rustc -g=2 /tmp/hw.rs
error: debug info level needs to be between 0-2
% rustc -g 2 /tmp/hw.rs
% rustc -g2 /tmp/hw.rs
% 

Personally, I would prefer if -g took no argument ever (and just used a reasonable default, say 2), and --debuginfo either required its argument or used a different syntax (e.g. --debuginfo=2) to select it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add a cheap & basic debug-info generation option
5 participants