-
Notifications
You must be signed in to change notification settings - Fork 13.2k
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
debuginfo: Add script that allows to conveniently start LLDB in "rust-mode" #19144
Closed
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
alexcrichton
added a commit
to alexcrichton/rust
that referenced
this pull request
Nov 22, 2014
This PR adds the `rust-lldb` script (feel free to bikeshed about the name). The script will start LLDB and, before doing anything else, load [LLDB type summaries](http://lldb.llvm.org/varformats.html) that will make LLDB print values with Rust syntax. Just use the script like you would normally use LLDB: ``` rust-lldb executable-to-debug --and-any-other-commandline --args ``` The script will just add one additional commandline argument to the LLDB invocation and pass along the rest of the arguments to LLDB after that. Given the following program... ```rust fn main() { let x = Some(1u); let y = [0, 1, 2i]; let z = (x, y); println!("{} {} {}", x, y, z); } ``` ...*without* the 'LLDB type summaries', values will be printed something like this... ``` (lldb) p x (core::option::Option<uint>) $3 = { = (RUST$ENUM$DISR = Some) = (RUST$ENUM$DISR = Some, 1) } (lldb) p y (long [3]) $4 = ([0] = 0, [1] = 1, [2] = 2) (lldb) p z ((core::option::Option<uint>, [int, ..3])) $5 = { = { = (RUST$ENUM$DISR = Some) = (RUST$ENUM$DISR = Some, 1) } = ([0] = 0, [1] = 1, [2] = 2) } ``` ...*with* the 'LLDB type summaries', values will be printed like this: ``` (lldb) p x (core::option::Option<uint>) $0 = Some(1) (lldb) p y (long [3]) $1 = [0, 1, 2] (lldb) p z ((core::option::Option<uint>, [int, ..3])) $2 = (Some(1), [0, 1, 2]) ``` The 'LLDB type summaries' used by the script have been in use for a while in the LLDB autotests but I still consider them to be of alpha-version quality. If you see anything weird when you use them, feel free to file an issue. The script will use whatever Rust "installation" is in PATH, so whichever `rustc` will be called if you type `rustc` into the console, this is the one that the script will ask for the LLDB extension module location. The build system will take care of putting the script and LLDB python module in the right places, whether you want to use the stage1 or stage2 compiler or the one coming with `make install` / `rustup.sh`. Since I don't have much experience with the build system, Makefiles and shell scripts, please look these changes over carefully.
When I included this in the rollup I think that this accidentally caused stage1 to always be rebuilt whenever r=me with the fix! |
afbd35c
to
84d9ad7
Compare
84d9ad7
to
67ba096
Compare
I don't think that this error has something to do with my changes. |
bors
added a commit
that referenced
this pull request
Nov 26, 2014
…hton This PR adds the `rust-lldb` script (feel free to bikeshed about the name). The script will start LLDB and, before doing anything else, load [LLDB type summaries](http://lldb.llvm.org/varformats.html) that will make LLDB print values with Rust syntax. Just use the script like you would normally use LLDB: ``` rust-lldb executable-to-debug --and-any-other-commandline --args ``` The script will just add one additional commandline argument to the LLDB invocation and pass along the rest of the arguments to LLDB after that. Given the following program... ```rust fn main() { let x = Some(1u); let y = [0, 1, 2i]; let z = (x, y); println!("{} {} {}", x, y, z); } ``` ...*without* the 'LLDB type summaries', values will be printed something like this... ``` (lldb) p x (core::option::Option<uint>) $3 = { = (RUST$ENUM$DISR = Some) = (RUST$ENUM$DISR = Some, 1) } (lldb) p y (long [3]) $4 = ([0] = 0, [1] = 1, [2] = 2) (lldb) p z ((core::option::Option<uint>, [int, ..3])) $5 = { = { = (RUST$ENUM$DISR = Some) = (RUST$ENUM$DISR = Some, 1) } = ([0] = 0, [1] = 1, [2] = 2) } ``` ...*with* the 'LLDB type summaries', values will be printed like this: ``` (lldb) p x (core::option::Option<uint>) $0 = Some(1) (lldb) p y (long [3]) $1 = [0, 1, 2] (lldb) p z ((core::option::Option<uint>, [int, ..3])) $2 = (Some(1), [0, 1, 2]) ``` The 'LLDB type summaries' used by the script have been in use for a while in the LLDB autotests but I still consider them to be of alpha-version quality. If you see anything weird when you use them, feel free to file an issue. The script will use whatever Rust "installation" is in PATH, so whichever `rustc` will be called if you type `rustc` into the console, this is the one that the script will ask for the LLDB extension module location. The build system will take care of putting the script and LLDB python module in the right places, whether you want to use the stage1 or stage2 compiler or the one coming with `make install` / `rustup.sh`. Since I don't have much experience with the build system, Makefiles and shell scripts, please look these changes over carefully.
lnicola
pushed a commit
to lnicola/rust
that referenced
this pull request
Feb 17, 2025
…drop minor: don't show drop hints for other pattern
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds the
rust-lldb
script (feel free to bikeshed about the name).The script will start LLDB and, before doing anything else, load LLDB type summaries that will make LLDB print values with Rust syntax. Just use the script like you would normally use LLDB:
The script will just add one additional commandline argument to the LLDB invocation and pass along the rest of the arguments to LLDB after that.
Given the following program...
...without the 'LLDB type summaries', values will be printed something like this...
...with the 'LLDB type summaries', values will be printed like this:
The 'LLDB type summaries' used by the script have been in use for a while in the LLDB autotests but I still consider them to be of alpha-version quality. If you see anything weird when you use them, feel free to file an issue.
The script will use whatever Rust "installation" is in PATH, so whichever
rustc
will be called if you typerustc
into the console, this is the one that the script will ask for the LLDB extension module location. The build system will take care of putting the script and LLDB python module in the right places, whether you want to use the stage1 or stage2 compiler or the one coming withmake install
/rustup.sh
.Since I don't have much experience with the build system, Makefiles and shell scripts, please look these changes over carefully.