Allow gdb version 10 in pretty printer tests.

Message ID 20210311094515.3955-1-stli@linux.ibm.com
State Committed
Commit e91f44089c3203f647d6feadb958ff5f388427bd
Headers
Series Allow gdb version 10 in pretty printer tests. |

Commit Message

Stefan Liebler March 11, 2021, 9:45 a.m. UTC
  With gdb 10, the pretty printer tests are UNSUPPORTED::
The gdb version string (gdb -v) is incorrectly formatted.

This is observable in:
nptl/test-cond-printers, nptl/test-condattr-printers,
nptl/test-mutex-printers, nptl/test-mutexattr-printers,
nptl/test-rwlock-printers, nptl/test-rwlockattr-printers

After updating the regexp and building with debug-info,
all those tests are passing.
---
 scripts/test_printers_common.py | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
  

Comments

Florian Weimer March 11, 2021, 10:25 a.m. UTC | #1
* Stefan Liebler via Libc-alpha:

> With gdb 10, the pretty printer tests are UNSUPPORTED::
> The gdb version string (gdb -v) is incorrectly formatted.
>
> This is observable in:
> nptl/test-cond-printers, nptl/test-condattr-printers,
> nptl/test-mutex-printers, nptl/test-mutexattr-printers,
> nptl/test-rwlock-printers, nptl/test-rwlockattr-printers
>
> After updating the regexp and building with debug-info,
> all those tests are passing.
> ---
>  scripts/test_printers_common.py | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
> index 0d515891f6..34a3df6e6b 100644
> --- a/scripts/test_printers_common.py
> +++ b/scripts/test_printers_common.py
> @@ -72,7 +72,8 @@ try:
>      # The gdb version string is "GNU gdb <PKGVERSION><version>", where
>      # PKGVERSION can be any text.  We assume that there'll always be a space
>      # between PKGVERSION and the version number for the sake of the regexp.
> -    version_match = re.search(r'GNU gdb .* ([1-9]+)\.([0-9]+)', gdb_version_out)
> +    version_match = re.search(r'GNU gdb .* ([1-9][0-9]*)\.([0-9]+)',
> +                              gdb_version_out)

Looks okay to me, thanks.

I really value your test debugging skills.

Florian
  
Stefan Liebler March 11, 2021, 1:10 p.m. UTC | #2
On 3/11/21 11:25 AM, Florian Weimer wrote:
> * Stefan Liebler via Libc-alpha:
> 
>> With gdb 10, the pretty printer tests are UNSUPPORTED::
>> The gdb version string (gdb -v) is incorrectly formatted.
>>
>> This is observable in:
>> nptl/test-cond-printers, nptl/test-condattr-printers,
>> nptl/test-mutex-printers, nptl/test-mutexattr-printers,
>> nptl/test-rwlock-printers, nptl/test-rwlockattr-printers
>>
>> After updating the regexp and building with debug-info,
>> all those tests are passing.
>> ---
>>  scripts/test_printers_common.py | 3 ++-
>>  1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
>> index 0d515891f6..34a3df6e6b 100644
>> --- a/scripts/test_printers_common.py
>> +++ b/scripts/test_printers_common.py
>> @@ -72,7 +72,8 @@ try:
>>      # The gdb version string is "GNU gdb <PKGVERSION><version>", where
>>      # PKGVERSION can be any text.  We assume that there'll always be a space
>>      # between PKGVERSION and the version number for the sake of the regexp.
>> -    version_match = re.search(r'GNU gdb .* ([1-9]+)\.([0-9]+)', gdb_version_out)
>> +    version_match = re.search(r'GNU gdb .* ([1-9][0-9]*)\.([0-9]+)',
>> +                              gdb_version_out)
> 
> Looks okay to me, thanks.
> 
> I really value your test debugging skills.
> 
> Florian
> 
Thanks.
Committed.
  

Patch

diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
index 0d515891f6..34a3df6e6b 100644
--- a/scripts/test_printers_common.py
+++ b/scripts/test_printers_common.py
@@ -72,7 +72,8 @@  try:
     # The gdb version string is "GNU gdb <PKGVERSION><version>", where
     # PKGVERSION can be any text.  We assume that there'll always be a space
     # between PKGVERSION and the version number for the sake of the regexp.
-    version_match = re.search(r'GNU gdb .* ([1-9]+)\.([0-9]+)', gdb_version_out)
+    version_match = re.search(r'GNU gdb .* ([1-9][0-9]*)\.([0-9]+)',
+                              gdb_version_out)
 
     if not version_match:
         print('The gdb version string (gdb -v) is incorrectly formatted.')