Restore original GDB prompt in define.exp
authorRichard Bunt <richard.bunt@arm.com>
Wed, 10 Jul 2019 13:14:16 +0000 (14:14 +0100)
committerRichard Bunt <richard.bunt@arm.com>
Wed, 10 Jul 2019 13:14:16 +0000 (14:14 +0100)
commitb863685d70199489b3fe27abedfb1eb6d1452b7d
tree2be7f7da8ce08d824d88fedba1f8937b01778756
parent166a82be89008621a31e6e56b2d52a049b53e341
Restore original GDB prompt in define.exp

define.exp will fail on a GDB which has set a custom prompt to identify
itself.  This is because the test resets the prompt to a hard coded
"(gdb)" but then verifies the success of this against the value in
$gdb_prompt, which is set to the custom prompt.

The original approach to fix this involved resetting the prompt to
$gdb_prompt rather than a hard coded "(gdb)". However it was noted during
review that $gdb_prompt is a regular expression rather than a string.
This is problematic because in general the prompt would be reset to a
regular expression rather than an instance of a string accepted by said
regular expression.

The fix used in this commit avoids the above issue by capturing the
literal prompt from running "show prompt" and uses this literal to
restore the previous prompt.

Regression tested with GCC 7.3.0 on x86_64, ppc64le, aarch64.

gdb/testsuite/ChangeLog:
2019-07-10  Richard Bunt  <richard.bunt@arm.com>
Stephen Roberts  <stephen.roberts@arm.com>

* gdb.base/define.exp: Restore original prompt.
gdb/testsuite/ChangeLog
gdb/testsuite/gdb.base/define.exp
This page took 0.038358 seconds and 4 git commands to generate.