Bug 31912 - [gdb/testsuite] FAIL: gdb.python/py-format-string.exp: format_string: lang_c: test_all_common: test_invalid_args: a_point_t with option invalid=True
Summary: [gdb/testsuite] FAIL: gdb.python/py-format-string.exp: format_string: lang_c:...
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: testsuite (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 16.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-06-19 12:37 UTC by Tom de Vries
Modified: 2024-08-01 07:24 UTC (History)
0 users

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Tom de Vries 2024-06-19 12:37:33 UTC
On Fedora rawhide, with python 3.13 I ran into:
...
(gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M
Python Exception <class 'TypeError'>: this function got an unexpected keyword argument 'invalid'^M
Error occurred in Python: this function got an unexpected keyword argument 'invalid'^M
(gdb) FAIL: gdb.python/py-format-string.exp: format_string: lang_c: test_all_common: test_invalid_args: a_point_t with option invalid=True
...

A passing version looks like:
...
(gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M
Python Exception <class 'TypeError'>: 'invalid' is an invalid keyword argument for this function^M
Error occurred in Python: 'invalid' is an invalid keyword argument for this function^M
(gdb) PASS: gdb.python/py-format-string.exp: format_string: lang_c: test_all_common: test_invalid_args: a_point_t with option invalid=True
...
Comment 2 Sourceware Commits 2024-08-01 07:23:29 UTC
The master branch has been updated by Tom de Vries <vries@sourceware.org>:

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

commit 1d4ed5907570ef4901f2bbf383e563dc0854bf15
Author: Tom de Vries <tdevries@suse.de>
Date:   Thu Aug 1 09:23:24 2024 +0200

    [gdb/testsuite] Fix gdb.python/py-format-string.exp with python 3.13
    
    On fedora rawhide, with python 3.13, I run into:
    ...
    (gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M
    Python Exception <class 'TypeError'>: \
      this function got an unexpected keyword argument 'invalid'^M
    Error occurred in Python: \
      this function got an unexpected keyword argument 'invalid'^M
    (gdb) FAIL: $exp: format_string: lang_c: test_all_common: test_invalid_args: \
      a_point_t with option invalid=True
    ...
    
    A passing version with an older python version looks like:
    ...
    (gdb) python print (gdb.parse_and_eval ('a_point_t').format_string (invalid=True))^M
    Python Exception <class 'TypeError'>: \
      'invalid' is an invalid keyword argument for this function^M
    Error occurred in Python: \
      'invalid' is an invalid keyword argument for this function^M
    (gdb) PASS: $exp: format_string: lang_c: test_all_common: test_invalid_args: \
      a_point_t with option invalid=True
    ...
    
    Fix this by accepting the updated error message.
    
    Tested on aarch64-linux.
    
    PR testsuite/31912
    Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=31912
Comment 3 Tom de Vries 2024-08-01 07:24:04 UTC
Fixed.