This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[commit/obvious] Fix PR 21352: Command tsave does not support -r argument
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: GDB Patches <gdb-patches at sourceware dot org>
- Cc: Sergio Durigan Junior <sergiodj at redhat dot com>
- Date: Wed, 5 Apr 2017 12:31:29 -0400
- Subject: [commit/obvious] Fix PR 21352: Command tsave does not support -r argument
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=sergiodj at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 6A58819CBD1
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 6A58819CBD1
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