Skip to content

Commit

Permalink
snap: add deprecation noticed to "snap run --gdb"
Browse files Browse the repository at this point in the history
Now that we promoted "snap run --gdbserver" the "snap run --gdb"
option should be deprecated. We plan to not improve it and it
needs to run as root, the program and gdb share a pty and it's
overall not great. So let's mark it deprecated and point users
to `snap run --gdbserver` instead.
  • Loading branch information
mvo5 committed Feb 8, 2021
1 parent 5b471fd commit 6afb41f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions cmd/snap-gdb-shim/snap-gdb-shim.c
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ int main(int argc, char **argv) {
}
// signal gdb to stop here
printf("\n\n");
printf("DEPRECATED: Please consider using --gdbserver instead.\n");
printf("\n");
printf("Welcome to `snap run --gdb`.\n");
printf("You are right before your application is execed():\n");
printf("- set any options you may need\n");
Expand Down
7 changes: 4 additions & 3 deletions cmd/snap/cmd_run.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,9 @@ type cmdRun struct {
// This options is both a selector (use or don't use strace) and it
// can also carry extra options for strace. This is why there is
// "default" and "optional-value" to distinguish this.
Strace string `long:"strace" optional:"true" optional-value:"with-strace" default:"no-strace" default-mask:"-"`
Gdb bool `long:"gdb"`
Strace string `long:"strace" optional:"true" optional-value:"with-strace" default:"no-strace" default-mask:"-"`
// deprecated in favor of Gdbserver
Gdb bool `long:"gdb" hidden:"yes"`
Gdbserver string `long:"gdbserver" default:"no-gdbserver" optional-value:":0" optional:"true"`
ExperimentalGdbserver string `long:"experimental-gdbserver" default:"no-gdbserver" optional-value:":0" optional:"true" hidden:"yes"`
TraceExec bool `long:"trace-exec"`
Expand Down Expand Up @@ -108,7 +109,7 @@ and environment.
// TRANSLATORS: This should not start with a lowercase letter.
"strace": i18n.G("Run the command under strace (useful for debugging). Extra strace options can be specified as well here. Pass --raw to strace early snap helpers."),
// TRANSLATORS: This should not start with a lowercase letter.
"gdb": i18n.G("Run the command with gdb"),
"gdb": i18n.G("Run the command with gdb (deprecated, use --gdbserver instead)"),
// TRANSLATORS: This should not start with a lowercase letter.
"gdbserver": i18n.G("Run the command with gdbserver"),
// TRANSLATORS: This should not start with a lowercase letter.
Expand Down

0 comments on commit 6afb41f

Please sign in to comment.