public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
@ 2015-06-28  4:01 Martin Galvan
  2015-06-28  9:07 ` Andreas Schwab
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Galvan @ 2015-06-28  4:01 UTC (permalink / raw)
  To: gdb-patches, qiyaoltc, dje

From here: https://sourceware.org/ml/gdb-patches/2015-06/msg00484.html

we concluded that, as these characters don't need to be escaped for strings
wrapped inside {} braces, we can remove the unneeded backslashes.

Ok to commit?
---
 gdb/testsuite/ChangeLog   | 5 +++++
 gdb/testsuite/lib/gdb.exp | 8 +++++---
 2 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog
index 89d8e32..014132a 100644
--- a/gdb/testsuite/ChangeLog
+++ b/gdb/testsuite/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-28  Martin Galvan  <martin.galvan@tallertechnologies.com>
+
+	* lib/gdb.exp (test_class_help): Remove the unneeded escaping of
+	'[' and ']' characters.
+
 2015-06-26  Keith Seitz  <keiths@redhat.com>
 	    Doug Evans  <dje@google.com>
 
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index c0e0cb1..381297a 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -4694,11 +4694,13 @@ proc help_test_raw { gdb_command expected_lines args } {
 # are regular expressions that should match the beginning of output,
 # before the list of commands in that class.  The presence of 
 # command list and standard epilogue will be tested automatically.
+# Notice that the '[' and ']' characters don't need to be escaped for strings
+# wrapped in {} braces.
 proc test_class_help { command_class expected_initial_lines args } {
     set l_stock_body {
-        "List of commands\:.*\[\r\n\]+"
-        "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
-        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
+        "List of commands\:.*[\r\n]+"
+        "Type \"help\" followed by command name for full documentation\.[\r\n]+"
+        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n]+"
         "Command name abbreviations are allowed if unambiguous\." 
     }
     set l_entire_body [concat $expected_initial_lines $l_stock_body]
-- 
2.4.5

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

* Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
  2015-06-28  4:01 [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help Martin Galvan
@ 2015-06-28  9:07 ` Andreas Schwab
  2015-06-29 14:04   ` Doug Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Schwab @ 2015-06-28  9:07 UTC (permalink / raw)
  To: Martin Galvan; +Cc: gdb-patches, qiyaoltc, dje

Martin Galvan <martin.galvan@tallertechnologies.com> writes:

> +# Notice that the '[' and ']' characters don't need to be escaped for strings
> +# wrapped in {} braces.

This isn't true in general, it's because this is a tcl list.  The
backslashes are removed when the list is passed through join in
help_test_raw (which removes one level of quoting, but doesn't do
command or variable expansion).  But that also means that the backslash
before '.' is ineffective and should be replaced by a double backslash.
Alternatively, each element could be enclosed with braces which disables
any quoting inside it.

>  proc test_class_help { command_class expected_initial_lines args } {
>      set l_stock_body {
> -        "List of commands\:.*\[\r\n\]+"
> -        "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
> -        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
> +        "List of commands\:.*[\r\n]+"

The backslash before ':' is useless.

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

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

* Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
  2015-06-28  9:07 ` Andreas Schwab
@ 2015-06-29 14:04   ` Doug Evans
  2015-06-29 21:17     ` Martin Galvan
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Evans @ 2015-06-29 14:04 UTC (permalink / raw)
  To: Andreas Schwab; +Cc: Martin Galvan, gdb-patches, Yao Qi

On Sun, Jun 28, 2015 at 4:07 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
> Martin Galvan <martin.galvan@tallertechnologies.com> writes:
>
>> +# Notice that the '[' and ']' characters don't need to be escaped for strings
>> +# wrapped in {} braces.
>
> This isn't true in general, it's because this is a tcl list.  The
> backslashes are removed when the list is passed through join in
> help_test_raw (which removes one level of quoting, but doesn't do
> command or variable expansion).  But that also means that the backslash
> before '.' is ineffective and should be replaced by a double backslash.
> Alternatively, each element could be enclosed with braces which disables
> any quoting inside it.
>
>>  proc test_class_help { command_class expected_initial_lines args } {
>>      set l_stock_body {
>> -        "List of commands\:.*\[\r\n\]+"
>> -        "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
>> -        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
>> +        "List of commands\:.*[\r\n]+"
>
> The backslash before ':' is useless.

Thanks for the clarity.
We don't have to fix all issues in this patch, so the patch is fine with me.

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

* Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
  2015-06-29 14:04   ` Doug Evans
@ 2015-06-29 21:17     ` Martin Galvan
  2015-06-29 21:43       ` Doug Evans
  0 siblings, 1 reply; 6+ messages in thread
From: Martin Galvan @ 2015-06-29 21:17 UTC (permalink / raw)
  To: Doug Evans; +Cc: Andreas Schwab, gdb-patches, Yao Qi

Is it ok to commit as it is, or should I change the comment to reflect
what Andreas said?

On Mon, Jun 29, 2015 at 11:03 AM, Doug Evans <dje@google.com> wrote:
> On Sun, Jun 28, 2015 at 4:07 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>> Martin Galvan <martin.galvan@tallertechnologies.com> writes:
>>
>>> +# Notice that the '[' and ']' characters don't need to be escaped for strings
>>> +# wrapped in {} braces.
>>
>> This isn't true in general, it's because this is a tcl list.  The
>> backslashes are removed when the list is passed through join in
>> help_test_raw (which removes one level of quoting, but doesn't do
>> command or variable expansion).  But that also means that the backslash
>> before '.' is ineffective and should be replaced by a double backslash.
>> Alternatively, each element could be enclosed with braces which disables
>> any quoting inside it.
>>
>>>  proc test_class_help { command_class expected_initial_lines args } {
>>>      set l_stock_body {
>>> -        "List of commands\:.*\[\r\n\]+"
>>> -        "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
>>> -        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
>>> +        "List of commands\:.*[\r\n]+"
>>
>> The backslash before ':' is useless.
>
> Thanks for the clarity.
> We don't have to fix all issues in this patch, so the patch is fine with me.



-- 


Martin Galvan

Software Engineer

Taller Technologies Argentina


San Lorenzo 47, 3rd Floor, Office 5

Córdoba, Argentina

Phone: 54 351 4217888 / +54 351 4218211

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

* Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
  2015-06-29 21:17     ` Martin Galvan
@ 2015-06-29 21:43       ` Doug Evans
  2015-06-30 21:28         ` Martin Galvan
  0 siblings, 1 reply; 6+ messages in thread
From: Doug Evans @ 2015-06-29 21:43 UTC (permalink / raw)
  To: Martin Galvan; +Cc: Andreas Schwab, gdb-patches, Yao Qi

It is ok to commit as is.

On Mon, Jun 29, 2015 at 4:16 PM, Martin Galvan
<martin.galvan@tallertechnologies.com> wrote:
> Is it ok to commit as it is, or should I change the comment to reflect
> what Andreas said?
>
> On Mon, Jun 29, 2015 at 11:03 AM, Doug Evans <dje@google.com> wrote:
>> On Sun, Jun 28, 2015 at 4:07 AM, Andreas Schwab <schwab@linux-m68k.org> wrote:
>>> Martin Galvan <martin.galvan@tallertechnologies.com> writes:
>>>
>>>> +# Notice that the '[' and ']' characters don't need to be escaped for strings
>>>> +# wrapped in {} braces.
>>>
>>> This isn't true in general, it's because this is a tcl list.  The
>>> backslashes are removed when the list is passed through join in
>>> help_test_raw (which removes one level of quoting, but doesn't do
>>> command or variable expansion).  But that also means that the backslash
>>> before '.' is ineffective and should be replaced by a double backslash.
>>> Alternatively, each element could be enclosed with braces which disables
>>> any quoting inside it.
>>>
>>>>  proc test_class_help { command_class expected_initial_lines args } {
>>>>      set l_stock_body {
>>>> -        "List of commands\:.*\[\r\n\]+"
>>>> -        "Type \"help\" followed by command name for full documentation\.\[\r\n\]+"
>>>> -        "Type \"apropos word\" to search for commands related to \"word\"\.[\r\n\]+"
>>>> +        "List of commands\:.*[\r\n]+"
>>>
>>> The backslash before ':' is useless.
>>
>> Thanks for the clarity.
>> We don't have to fix all issues in this patch, so the patch is fine with me.
>
>
>
> --
>
>
> Martin Galvan
>
> Software Engineer
>
> Taller Technologies Argentina
>
>
> San Lorenzo 47, 3rd Floor, Office 5
>
> Córdoba, Argentina
>
> Phone: 54 351 4217888 / +54 351 4218211

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

* Re: [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help
  2015-06-29 21:43       ` Doug Evans
@ 2015-06-30 21:28         ` Martin Galvan
  0 siblings, 0 replies; 6+ messages in thread
From: Martin Galvan @ 2015-06-30 21:28 UTC (permalink / raw)
  To: Doug Evans; +Cc: Andreas Schwab, gdb-patches, Yao Qi

On Mon, Jun 29, 2015 at 6:42 PM, Doug Evans <dje@google.com> wrote:
> It is ok to commit as is.

Commited!

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git&a=commit&h=06f810bd8ee52d2485c180d45c635c25c9a15108

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

end of thread, other threads:[~2015-06-30 21:28 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-28  4:01 [PATCH] testsuite: Remove the unneeded escaping of '[' and ']' characters in test_class_help Martin Galvan
2015-06-28  9:07 ` Andreas Schwab
2015-06-29 14:04   ` Doug Evans
2015-06-29 21:17     ` Martin Galvan
2015-06-29 21:43       ` Doug Evans
2015-06-30 21:28         ` Martin Galvan

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).