public inbox for gdb-cvs@sourceware.org
help / color / mirror / Atom feed
* [binutils-gdb] gdb/testsuite: fix failure in gdb.python/py-unwind.exp
@ 2023-04-03 10:01 Andrew Burgess
  0 siblings, 0 replies; only message in thread
From: Andrew Burgess @ 2023-04-03 10:01 UTC (permalink / raw)
  To: gdb-cvs

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

commit 4c148f65fc148918d0be15607938770ad8c46e36
Author: Andrew Burgess <aburgess@redhat.com>
Date:   Mon Apr 3 10:56:10 2023 +0100

    gdb/testsuite: fix failure in gdb.python/py-unwind.exp
    
    A potential test failure was introduced with commit:
    
      commit 6bf5f25bb150c0fbcb125e3ee466ba8f9680310b
      Date:   Wed Mar 8 16:11:30 2023 +0000
    
          gdb/python: make the gdb.unwinder.Unwinder class more robust
    
    In this commit a new test was added, however the expected output
    pattern varies depending on which Python version GDB is linked
    against.
    
    Older versions of Python result in output like this:
    
        (gdb) python global_test_unwinder.name = "foo"
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
        AttributeError: can't set attribute
        Error while executing Python code.
        (gdb)
    
    While more recent versions of Python give a similar, but slightly more
    verbose error message, like this:
    
        (gdb) python global_test_unwinder.name = "foo"
        Traceback (most recent call last):
          File "<string>", line 1, in <module>
        AttributeError: can't set attribute 'name'
        Error while executing Python code.
        (gdb)
    
    The test was only accepting the first version of the output.  This
    commit extends the test pattern so that either version will be
    accepted.

Diff:
---
 gdb/testsuite/gdb.python/py-unwind.exp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/gdb/testsuite/gdb.python/py-unwind.exp b/gdb/testsuite/gdb.python/py-unwind.exp
index fddf4f15393..d0a1960058b 100644
--- a/gdb/testsuite/gdb.python/py-unwind.exp
+++ b/gdb/testsuite/gdb.python/py-unwind.exp
@@ -107,7 +107,7 @@ check_info_unwinder "info unwinder after failed disable" on
 # 'register_unwinder'.
 gdb_test "python global_test_unwinder.name = \"foo\"" \
     [multi_line \
-	 "AttributeError: can't set attribute" \
+	 "AttributeError: can't set attribute(?: 'name')?" \
 	 "Error while executing Python code\\."]
 check_info_unwinder "info unwinder after failed name change" on

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-04-03 10:01 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-04-03 10:01 [binutils-gdb] gdb/testsuite: fix failure in gdb.python/py-unwind.exp 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).