[commit/obvious] Fix PR 21352: Command tsave does not support -r argument
Commit Message
On Wednesday, April 05 2017, Pedro Alves wrote:
> On 04/05/2017 05:31 PM, Sergio Durigan Junior wrote:
>> 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.
>
> We have a few tests under gdb.trace/ that exercise "tsave". Would it
> be easy to augment some to exercise this?
Yes, absolutely. I was thinking about doing that but decided not too.
Anyway, here's what I checked in.
Thanks,
Comments
On 04/05/2017 05:45 PM, Sergio Durigan Junior wrote:
> On Wednesday, April 05 2017, Pedro Alves wrote:
>
>> On 04/05/2017 05:31 PM, Sergio Durigan Junior wrote:
>>> 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.
>>
>> We have a few tests under gdb.trace/ that exercise "tsave". Would it
>> be easy to augment some to exercise this?
>
> Yes, absolutely. I was thinking about doing that but decided not too.
> Anyway, here's what I checked in.
Thanks, I like the new decision better. :-)
@@ -1,3 +1,8 @@
+2017-04-05 Sergio Durigan Junior <sergiodj@redhat.com>
+
+ PR gdb/21352
+ * gdb.trace/tsv.exp: Add test for "tsave -r".
+
2017-03-29 Jan Kratochvil <jan.kratochvil@redhat.com>
* gdb.python/py-section-script.exp (sepdebug): New testcases.
@@ -26,6 +26,10 @@ if { [gdb_compile "$srcdir/$subdir/$srcfile" $binfile \
}
gdb_load $binfile
+# PR gdb/21352: Command tsave does not support -r argument
+gdb_test "tsave -r" "Argument required \\\(file in which to save trace data\\\)\." \
+ "tsave command properly supports -r argument"
+
gdb_test "tvariable \$tvar1" \
"Trace state variable \\\$tvar1 created, with initial value 0." \
"create a trace state variable"