public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] gdb: Unset PROMPT_COMMAND before testing
@ 2017-06-16 23:12 Andrew Burgess
  2017-06-22 10:12 ` Yao Qi
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Burgess @ 2017-06-16 23:12 UTC (permalink / raw)
  To: gdb-patches; +Cc: Andrew Burgess

One of the GDB tests starts up a sub-shell and runs a few commands in
it.  In some cases, a users PROMPT_COMMAND might not work in the
sub-shell GDB starts, which could cause the shell to emit unexpected
warnings or errors, this in turn could cause tests to fail.

The current example is gdb.base/batch-preserve-term-settings.exp, but
there could be others in the future.

I don't see any regressions with this patch, but I do now see 5
additional passes on gdb.base/batch-preserve-term-settings.exp.

OK to apply?

Thanks,
Andrew

---

gdb/testsuite/ChangeLog:

	* lib/gdb.exp (gdb_init): Unset PROMPT_COMMAND.
---
 gdb/testsuite/ChangeLog   | 4 ++++
 gdb/testsuite/lib/gdb.exp | 5 +++++
 2 files changed, 9 insertions(+)

diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index a74f97465e..053bc65e09 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4626,6 +4626,11 @@ proc gdb_init { test_file_name } {
     # especially having color output turned on can cause tests to fail.
     setenv GREP_OPTIONS ""
 
+    # Some tests run a shell.  If a user has PROMPT_COMMAND set then
+    # there's no guarantee that what it's set to will work correctly
+    # within the sub-shells we run.  For safety clear it.
+    setenv PROMPT_COMMAND ""
+
     # Clear $gdbserver_reconnect_p.
     global gdbserver_reconnect_p
     set gdbserver_reconnect_p 1
-- 
2.12.2

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: Unset PROMPT_COMMAND before testing
  2017-06-16 23:12 [PATCH] gdb: Unset PROMPT_COMMAND before testing Andrew Burgess
@ 2017-06-22 10:12 ` Yao Qi
  2017-06-22 19:14   ` Andrew Burgess
  0 siblings, 1 reply; 3+ messages in thread
From: Yao Qi @ 2017-06-22 10:12 UTC (permalink / raw)
  To: Andrew Burgess; +Cc: gdb-patches

Andrew Burgess <andrew.burgess@embecosm.com> writes:

> One of the GDB tests starts up a sub-shell and runs a few commands in
> it.  In some cases, a users PROMPT_COMMAND might not work in the
> sub-shell GDB starts, which could cause the shell to emit unexpected
> warnings or errors, this in turn could cause tests to fail.

What is the concrete output in your case?

>
> The current example is gdb.base/batch-preserve-term-settings.exp, but
> there could be others in the future.
>
> I don't see any regressions with this patch, but I do now see 5
> additional passes on gdb.base/batch-preserve-term-settings.exp.

This patch sets the env for build rather than host, so it doesn't help
in remote host.  Note that I don't think DejaGNU can set env in remote.

-- 
Yao (齐尧)

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] gdb: Unset PROMPT_COMMAND before testing
  2017-06-22 10:12 ` Yao Qi
@ 2017-06-22 19:14   ` Andrew Burgess
  0 siblings, 0 replies; 3+ messages in thread
From: Andrew Burgess @ 2017-06-22 19:14 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

* Yao Qi <qiyaoltc@gmail.com> [2017-06-22 11:12:02 +0100]:

> Andrew Burgess <andrew.burgess@embecosm.com> writes:
> 
> > One of the GDB tests starts up a sub-shell and runs a few commands in
> > it.  In some cases, a users PROMPT_COMMAND might not work in the
> > sub-shell GDB starts, which could cause the shell to emit unexpected
> > warnings or errors, this in turn could cause tests to fail.
> 
> What is the concrete output in your case?
> 
> >
> > The current example is gdb.base/batch-preserve-term-settings.exp, but
> > there could be others in the future.
> >
> > I don't see any regressions with this patch, but I do now see 5
> > additional passes on gdb.base/batch-preserve-term-settings.exp.
> 
> This patch sets the env for build rather than host, so it doesn't help
> in remote host.  Note that I don't think DejaGNU can set env in remote.

Thank you for taking the time to look at this patch, but after reading
your feedback and further consideration I now realise that this issue
should really be fixed at my end.

Apologies for wasting your time, and the mailing list noise.

Thanks,
Andrew

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2017-06-22 19:14 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-16 23:12 [PATCH] gdb: Unset PROMPT_COMMAND before testing Andrew Burgess
2017-06-22 10:12 ` Yao Qi
2017-06-22 19:14   ` Andrew Burgess

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).