Skip to content
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

Use an (over-writable) environment variable for the gdb command #41372

Merged
merged 2 commits into from
Apr 21, 2017
Merged

Use an (over-writable) environment variable for the gdb command #41372

merged 2 commits into from
Apr 21, 2017

Conversation

nbigaouette
Copy link
Contributor

Instead of hard-coding the command to run, using the environment
variable GDB_CMD (that defaults to gdb) allows using a different
debugger than the default gdb executable.

This gives the possibility to use cgdb as the debugger, which provides
a nicer user interface. Note that one has to use GDB_CMD="cgdb --" to
use cgdb (note the trailing --) to let cgdb pass the proper arguments
to gdb.

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@nbigaouette-eai
Copy link

Note that the syntax ${var:-DEFAULT} should be POSIX compatible.

See http://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_06_02

@ltratt
Copy link
Contributor

ltratt commented Apr 18, 2017

This would certainly be a big help to those of us on platforms whose stock gdb doesn't work with Rust. [See https://github.com/semarie/build-rust/issues/4.]

@aidanhs
Copy link
Member

aidanhs commented Apr 19, 2017

Thanks for the PR @nbigaouette! We'll make sure @alexcrichton or another reviewer gets to your PR soon.

@aidanhs aidanhs added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Apr 19, 2017
@alexcrichton
Copy link
Member

Thanks @nbigaouette!

I wonder if we could perhaps call this env var RUST_GDB_CMD though? (or maybe RUST_GDB?)

Just to make it clear that it's rust-specific

@alexcrichton alexcrichton added S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. T-tools and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 20, 2017
@nbigaouette
Copy link
Contributor Author

Yes, I agree the variable should be descriptive enough that it's clear what it is used for.

I like RUST_GDB. I had GDB initially but found it too generic, adding a RUST_ prefix would eliminate ambiguity.

@alexcrichton
Copy link
Member

@bors: r+

Thanks!

@bors
Copy link
Contributor

bors commented Apr 20, 2017

📌 Commit 61b7ebe has been approved by alexcrichton

@alexcrichton alexcrichton added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Apr 20, 2017
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 20, 2017
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
TimNN added a commit to TimNN/rust that referenced this pull request Apr 21, 2017
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
TimNN added a commit to TimNN/rust that referenced this pull request Apr 21, 2017
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 21, 2017
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
frewsxcv added a commit to frewsxcv/rust that referenced this pull request Apr 21, 2017
Use an (over-writable) environment variable for the `gdb` command

Instead of hard-coding the command to run, using the environment
variable `GDB_CMD` (that defaults to `gdb`) allows using a different
debugger than the default `gdb` executable.

This gives the possibility to use `cgdb` as the debugger, which provides
a nicer user interface. Note that one has to use `GDB_CMD="cgdb --"` to
use cgdb (note the trailing `--`) to let cgdb pass the proper arguments
to `gdb`.
bors added a commit that referenced this pull request Apr 21, 2017
Rollup of 4 pull requests

- Successful merges: #41372, #41376, #41426, #41429
- Failed merges:
@bors bors merged commit 61b7ebe into rust-lang:master Apr 21, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants