public inbox for gdb-prs@sourceware.org
help / color / mirror / Atom feed
* [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test
@ 2023-04-29  8:05 vries at gcc dot gnu.org
  2023-04-29  8:06 ` [Bug testsuite/30403] " vries at gcc dot gnu.org
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-04-29  8:05 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30403

            Bug ID: 30403
           Summary: [gdb/testsuite] -wrap no longer in sync with gdb_test
           Product: gdb
           Version: HEAD
            Status: NEW
          Severity: normal
          Priority: P2
         Component: testsuite
          Assignee: unassigned at sourceware dot org
          Reporter: vries at gcc dot gnu.org
  Target Milestone: ---

The semantics of -wrap is defined as doing what gdb_test does:
...
# In EXPECT_ARGUMENTS we can use a -wrap pattern flag, that wraps the regexp    
# pattern as gdb_test wraps its message argument.                               
# This allows us to rewrite:                                                    
#   gdb_test <command> <pattern> <message>                                      
# into:                                                                         
#   gdb_test_multiple <command> <message> {                                     
#       -re -wrap <pattern> {                                                   
#           pass $gdb_test_name                                                 
#       }                                                                       
#   }                                                                          
                               ...

There are recent changes in gdb_test semantics, but -wrap was not updated:
...
        if { $wrap_pattern } {
            # Wrap subst_item as is done for the gdb_test PATTERN argument.     
            lappend $current_list \
                "\[\r\n\]*(?:$subst_item)\[\r\n\]+$prompt_regexp"
            set wrap_pattern 0
        } else {
...

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug testsuite/30403] [gdb/testsuite] -wrap no longer in sync with gdb_test
  2023-04-29  8:05 [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test vries at gcc dot gnu.org
@ 2023-04-29  8:06 ` vries at gcc dot gnu.org
  2023-05-04  6:44 ` vries at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-04-29  8:06 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30403

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aburgess at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug testsuite/30403] [gdb/testsuite] -wrap no longer in sync with gdb_test
  2023-04-29  8:05 [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test vries at gcc dot gnu.org
  2023-04-29  8:06 ` [Bug testsuite/30403] " vries at gcc dot gnu.org
@ 2023-05-04  6:44 ` vries at gcc dot gnu.org
  2023-05-05 16:59 ` cvs-commit at gcc dot gnu.org
  2023-05-23  5:34 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-05-04  6:44 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30403

--- Comment #1 from Tom de Vries <vries at gcc dot gnu.org> ---
FTR, as mentioned on the ml, same thing for the new interpretation of ^ at the
start of a pattern in gdb_test.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug testsuite/30403] [gdb/testsuite] -wrap no longer in sync with gdb_test
  2023-04-29  8:05 [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test vries at gcc dot gnu.org
  2023-04-29  8:06 ` [Bug testsuite/30403] " vries at gcc dot gnu.org
  2023-05-04  6:44 ` vries at gcc dot gnu.org
@ 2023-05-05 16:59 ` cvs-commit at gcc dot gnu.org
  2023-05-23  5:34 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-05-05 16:59 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30403

--- Comment #2 from cvs-commit at gcc dot gnu.org <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Andrew Burgess <aburgess@sourceware.org>:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=a5d3f94c271dde580980d82c2a8420bf6612e58c

commit a5d3f94c271dde580980d82c2a8420bf6612e58c
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Tue May 2 10:56:55 2023 +0100

    gdb/testsuite: more newline pattern cleanup

    After this commit:

      commit e2f620135d92f7cd670af4e524fffec7ac307666
      Date:   Thu Mar 30 13:26:25 2023 +0100

          gdb/testsuite: change newline patterns used in gdb_test

    It was pointed out in PR gdb/30403 that the same patterns can be found
    in other lib/gdb.exp procs and that it would probably be a good idea
    if these procs remained in sync with gdb_test.  Actually, the bug
    specifically calls out gdb_test_multiple when using with '-wrap', but
    I found a couple of other locations in gdb_continue_to_breakpoint,
    gdb_test_multiline, get_valueof, and get_local_valueof.

    In all these locations one or both of the following issues are
    addressed:

      1. A leading pattern of '[\r\n]*' is pointless.  If there is a
      newline it will be matched, but if there is not then the testsuite
      doesn't care.  Also, as expect is happy to skip non-matched output
      at the start of a pattern, if there is a newline expect is happy to
      skip over it before matching the rest.  As such, this leading
      pattern is removed.

      2. Using '\[\r\n\]*$gdb_prompt' means that we will swallow
      unexpected blank lines at the end of a command's output, but also,
      if the pattern from the test script ends with a '\r', '\n', or '.'
      then these will partially match the trailing newline, with the
      remainder of the newline matched by the pattern from gdb.exp.  This
      split matching doesn't add any value, it's just something that has
      appeared as a consequence of how gdb.exp was originally written.  In
      this case the '\[\r\n\]*' is replaced with '\r\n'.

    I've rerun the testsuite and fixed the regressions that I saw, these
    were places where GDB emits a blank line at the end of the command
    output, which we now need to explicitly match in the test script, this
    was for:

      gdb.dwarf2/dw2-out-of-range-end-of-seq.exp
      gdb.guile/guile.exp
      gdb.python/python.exp

    Or a location where the test script was matching part of the newline
    sequence, while gdb.exp was previously matching the remainder of the
    newline sequence.  Now we rely on gdb.exp to match the complete
    newline sequence, this was for:

      gdb.base/commands.exp

    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=30403

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug testsuite/30403] [gdb/testsuite] -wrap no longer in sync with gdb_test
  2023-04-29  8:05 [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test vries at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2023-05-05 16:59 ` cvs-commit at gcc dot gnu.org
@ 2023-05-23  5:34 ` vries at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: vries at gcc dot gnu.org @ 2023-05-23  5:34 UTC (permalink / raw)
  To: gdb-prs

https://sourceware.org/bugzilla/show_bug.cgi?id=30403

Tom de Vries <vries at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |14.1
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Tom de Vries <vries at gcc dot gnu.org> ---
With commit a68f7e98442 ("gdb/testsuite: extend special '^' handling to
gdb_test_multiple") in place, I think we can close this as fixed.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2023-05-23  5:34 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-29  8:05 [Bug testsuite/30403] New: [gdb/testsuite] -wrap no longer in sync with gdb_test vries at gcc dot gnu.org
2023-04-29  8:06 ` [Bug testsuite/30403] " vries at gcc dot gnu.org
2023-05-04  6:44 ` vries at gcc dot gnu.org
2023-05-05 16:59 ` cvs-commit at gcc dot gnu.org
2023-05-23  5:34 ` vries at gcc dot gnu.org

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