Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
@ 2014-03-25  2:05 Yao Qi
  2014-04-01  2:26 ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2014-03-25  2:05 UTC (permalink / raw)
  To: gdb-patches; +Cc: muller

From: Pierre Muller <muller@sourceware.org>

On mingw host, we have seen two fails as below,

p int1dim[0]^V@2
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]^V@2^V@3
Invalid character '^V' in expression.
(gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2@3

In the test, the comment says "# Send \026@ instead of just @ in case
the kill character is @".  Historically, kill character was @, and
Ctrl-V (\026) is to escape the next character.  However, we don't have
to do so on mingw.  This patch is to disable ctrl-v usage on mingw
hots.  With this patch applied, it becomes:

p int1dim[0]@2
$607 = {0, 1}
(gdb) PASS: gdb.base/printcmds.exp: p int1dim[0]@2
p int1dim[0]@2@3
$608 = {{0, 1}, {2, 3}, {4, 5}}

Note that this patch is picked from Pierre's submission,

  [RFC 6/6] Fix remaining failures in gdb.base/printcmds.exp for mingw hosts.
  https://www.sourceware.org/ml/gdb-patches/2013-09/msg00943.html

gdb/testsuite:

2014-03-25  Pierre Muller  <muller@sourceware.org>

	* gdb.base/printcmds.exp (test_artificial_arrays): Disable
	Ctrl-V use for mingw hosts.
---
 gdb/testsuite/gdb.base/printcmds.exp |   10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 8f38aca..653b235 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -631,8 +631,14 @@ proc test_print_typedef_arrays {} {
 
 proc test_artificial_arrays {} {
     # Send \026@ instead of just @ in case the kill character is @.
-    gdb_test_escape_braces "p int1dim\[0\]\026@2" " = {0, 1}" {p int1dim[0]@2}
-    gdb_test_escape_braces "p int1dim\[0\]\026@2\026@3" \
+    # \026 (ctrl-v) is to escape the next character (@), but it is
+    # unnecessary to do so on MingW hosts.
+    set ctrlv "\026"
+    if [ishost *-*-mingw*] {
+	set ctrlv ""
+    }
+    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2" " = {0, 1}" {p int1dim[0]@2}
+    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2${ctrlv}@3" \
 	"({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
 	{p int1dim[0]@2@3}
     gdb_test_escape_braces {p/x (short [])0x12345678} \
-- 
1.7.7.6


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

* Re: [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
  2014-03-25  2:05 [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts Yao Qi
@ 2014-04-01  2:26 ` Yao Qi
  2014-04-07 16:39   ` Joel Brobecker
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2014-04-01  2:26 UTC (permalink / raw)
  To: gdb-patches

On 03/25/2014 10:02 AM, Yao Qi wrote:
> On mingw host, we have seen two fails as below,
> 
> p int1dim[0]^V@2
> Invalid character '^V' in expression.
> (gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2
> p int1dim[0]^V@2^V@3
> Invalid character '^V' in expression.
> (gdb) FAIL: gdb.base/printcmds.exp: p int1dim[0]@2@3
> 
> In the test, the comment says "# Send \026@ instead of just @ in case
> the kill character is @".  Historically, kill character was @, and
> Ctrl-V (\026) is to escape the next character.  However, we don't have
> to do so on mingw.  This patch is to disable ctrl-v usage on mingw
> hots.  With this patch applied, it becomes:
> 
> p int1dim[0]@2
> $607 = {0, 1}
> (gdb) PASS: gdb.base/printcmds.exp: p int1dim[0]@2
> p int1dim[0]@2@3
> $608 = {{0, 1}, {2, 3}, {4, 5}}
> 
> Note that this patch is picked from Pierre's submission,
> 
>   [RFC 6/6] Fix remaining failures in gdb.base/printcmds.exp for mingw hosts.
>   https://www.sourceware.org/ml/gdb-patches/2013-09/msg00943.html
> 
> gdb/testsuite:
> 
> 2014-03-25  Pierre Muller  <muller@sourceware.org>
> 
> 	* gdb.base/printcmds.exp (test_artificial_arrays): Disable
> 	Ctrl-V use for mingw hosts.

Ping.  https://sourceware.org/ml/gdb-patches/2014-03/msg00590.html

-- 
Yao (齐尧)


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

* Re: [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
  2014-04-01  2:26 ` Yao Qi
@ 2014-04-07 16:39   ` Joel Brobecker
  2014-04-08  6:07     ` Yao Qi
  0 siblings, 1 reply; 5+ messages in thread
From: Joel Brobecker @ 2014-04-07 16:39 UTC (permalink / raw)
  To: Yao Qi; +Cc: gdb-patches

> > 2014-03-25  Pierre Muller  <muller@sourceware.org>
> > 
> > 	* gdb.base/printcmds.exp (test_artificial_arrays): Disable
> > 	Ctrl-V use for mingw hosts.
> 
> Ping.  https://sourceware.org/ml/gdb-patches/2014-03/msg00590.html

Sorry about the wait. OK, but with a small change in the comment
to say that the ctrl-v character is not only unnecessary on MinGW
but actually harmful for the test because that character isn't
recognized as an escape character.

It'd be nice to know when @ is actually an escape character (just
thinking out loud, not asking you to do the research - a google
research doesn't quite clarify this for me).

-- 
Joel


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

* Re: [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
  2014-04-07 16:39   ` Joel Brobecker
@ 2014-04-08  6:07     ` Yao Qi
  2014-04-08  8:09       ` Pierre Muller
  0 siblings, 1 reply; 5+ messages in thread
From: Yao Qi @ 2014-04-08  6:07 UTC (permalink / raw)
  To: Joel Brobecker; +Cc: gdb-patches

On 04/08/2014 12:39 AM, Joel Brobecker wrote:
> Sorry about the wait. OK, but with a small change in the comment
> to say that the ctrl-v character is not only unnecessary on MinGW
> but actually harmful for the test because that character isn't
> recognized as an escape character.

OK, comments are updated.  Patch below is pushed in.

> 
> It'd be nice to know when @ is actually an escape character (just
> thinking out loud, not asking you to do the research - a google
> research doesn't quite clarify this for me).

I don't know either.

-- 
Yao (齐尧)

gdb/testsuite:

2014-04-08  Pierre Muller  <muller@sourceware.org>

	* gdb.base/printcmds.exp (test_artificial_arrays): Disable
	Ctrl-V use for mingw hosts.
---
 gdb/testsuite/gdb.base/printcmds.exp | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.base/printcmds.exp b/gdb/testsuite/gdb.base/printcmds.exp
index 8f38aca..3253d91 100644
--- a/gdb/testsuite/gdb.base/printcmds.exp
+++ b/gdb/testsuite/gdb.base/printcmds.exp
@@ -631,8 +631,16 @@ proc test_print_typedef_arrays {} {
 
 proc test_artificial_arrays {} {
     # Send \026@ instead of just @ in case the kill character is @.
-    gdb_test_escape_braces "p int1dim\[0\]\026@2" " = {0, 1}" {p int1dim[0]@2}
-    gdb_test_escape_braces "p int1dim\[0\]\026@2\026@3" \
+    # \026 (ctrl-v) is to escape the next character (@), but it is
+    # not only unnecessary to do so on MingW hosts, but also harmful
+    # for the test because that character isn't recognized as an
+    # escape character.
+    set ctrlv "\026"
+    if [ishost *-*-mingw*] {
+	set ctrlv ""
+    }
+    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2" " = {0, 1}" {p int1dim[0]@2}
+    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2${ctrlv}@3" \
 	"({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
 	{p int1dim[0]@2@3}
     gdb_test_escape_braces {p/x (short [])0x12345678} \
-- 
1.8.1.4


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

* RE: [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
  2014-04-08  6:07     ` Yao Qi
@ 2014-04-08  8:09       ` Pierre Muller
  0 siblings, 0 replies; 5+ messages in thread
From: Pierre Muller @ 2014-04-08  8:09 UTC (permalink / raw)
  To: 'Yao Qi', 'Joel Brobecker'; +Cc: gdb-patches

  Hi all,

  the comment is a more useful addition to the patch
than the change itself, so please don't forget to add
your name to mine in the ChangeLog entry!

Pierre Muller

> -----Message d'origine-----
> De : gdb-patches-owner@sourceware.org [mailto:gdb-patches-
> owner@sourceware.org] De la part de Yao Qi
> Envoyé : mardi 8 avril 2014 08:05
> À : Joel Brobecker
> Cc : gdb-patches@sourceware.org
> Objet : Re: [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts.
> 
> On 04/08/2014 12:39 AM, Joel Brobecker wrote:
> > Sorry about the wait. OK, but with a small change in the comment
> > to say that the ctrl-v character is not only unnecessary on MinGW
> > but actually harmful for the test because that character isn't
> > recognized as an escape character.
> 
> OK, comments are updated.  Patch below is pushed in.
> 
> >
> > It'd be nice to know when @ is actually an escape character (just
> > thinking out loud, not asking you to do the research - a google
> > research doesn't quite clarify this for me).
> 
> I don't know either.
> 
> --
> Yao (齐尧)
> 
> gdb/testsuite:
> 
> 2014-04-08  Pierre Muller  <muller@sourceware.org>
> 
> 	* gdb.base/printcmds.exp (test_artificial_arrays): Disable
> 	Ctrl-V use for mingw hosts.
> ---
>  gdb/testsuite/gdb.base/printcmds.exp | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/gdb/testsuite/gdb.base/printcmds.exp
> b/gdb/testsuite/gdb.base/printcmds.exp
> index 8f38aca..3253d91 100644
> --- a/gdb/testsuite/gdb.base/printcmds.exp
> +++ b/gdb/testsuite/gdb.base/printcmds.exp
> @@ -631,8 +631,16 @@ proc test_print_typedef_arrays {} {
> 
>  proc test_artificial_arrays {} {
>      # Send \026@ instead of just @ in case the kill character is @.
> -    gdb_test_escape_braces "p int1dim\[0\]\026@2" " = {0, 1}" {p
> int1dim[0]@2}
> -    gdb_test_escape_braces "p int1dim\[0\]\026@2\026@3" \
> +    # \026 (ctrl-v) is to escape the next character (@), but it is
> +    # not only unnecessary to do so on MingW hosts, but also harmful
> +    # for the test because that character isn't recognized as an
> +    # escape character.
> +    set ctrlv "\026"
> +    if [ishost *-*-mingw*] {
> +	set ctrlv ""
> +    }
> +    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2" " = {0, 1}" {p
> int1dim[0]@2}
> +    gdb_test_escape_braces "p int1dim\[0\]${ctrlv}@2${ctrlv}@3" \
>  	"({{0, 1}, {2, 3}, {4, 5}}|\[Cc\]annot.*)" \
>  	{p int1dim[0]@2@3}
>      gdb_test_escape_braces {p/x (short [])0x12345678} \
> --
> 1.8.1.4


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

end of thread, other threads:[~2014-04-08  8:09 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-25  2:05 [PATCH] [testsuite] Disable Ctrl-V use for mingw hosts Yao Qi
2014-04-01  2:26 ` Yao Qi
2014-04-07 16:39   ` Joel Brobecker
2014-04-08  6:07     ` Yao Qi
2014-04-08  8:09       ` Pierre Muller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox