Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: GDB Patches <gdb-patches@sourceware.org>
Cc: Sergio Durigan Junior <sergiodj@redhat.com>
Subject: [commit/obvious] Fix PR 21352: Command tsave does not support -r argument
Date: Wed, 05 Apr 2017 16:31:00 -0000	[thread overview]
Message-ID: <20170405163129.24815-1-sergiodj@redhat.com> (raw)

This is an obvious fix for PR 21352.  The problem is that the argument
parsing loop is not using an "else if" where it should, and therefore
the '-r' option ends up unrecognized by GDB.

gdb/ChangeLog:
2017-04-05  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR gdb/21352
	* tracefile.c (tsave_command): Fix argument parsing for '-r'
	option.
---
 gdb/ChangeLog   | 6 ++++++
 gdb/tracefile.c | 2 +-
 2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index c3999b6..4141beb 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,3 +1,9 @@
+2017-04-05  Sergio Durigan Junior  <sergiodj@redhat.com>
+
+	PR gdb/21352
+	* tracefile.c (tsave_command): Fix argument parsing for '-r'
+	option.
+
 2017-04-05  Yao Qi  <yao.qi@linaro.org>
 
 	* frame.c (frame_unwind_register_unsigned): Call
diff --git a/gdb/tracefile.c b/gdb/tracefile.c
index 641ad4d..cc90945 100644
--- a/gdb/tracefile.c
+++ b/gdb/tracefile.c
@@ -325,7 +325,7 @@ tsave_command (char *args, int from_tty)
     {
       if (strcmp (*argv, "-r") == 0)
 	target_does_save = 1;
-      if (strcmp (*argv, "-ctf") == 0)
+      else if (strcmp (*argv, "-ctf") == 0)
 	generate_ctf = 1;
       else if (**argv == '-')
 	error (_("unknown option `%s'"), *argv);
-- 
2.9.3


             reply	other threads:[~2017-04-05 16:31 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-05 16:31 Sergio Durigan Junior [this message]
2017-04-05 16:34 ` Pedro Alves
2017-04-05 16:45   ` Sergio Durigan Junior
2017-04-05 16:49     ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20170405163129.24815-1-sergiodj@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox