Bug 26954 - FAIL: gdb.base/float128.exp: print large128 (GDB may be missing MPFR support!)
Summary: FAIL: gdb.base/float128.exp: print large128 (GDB may be missing MPFR support!)
Status: RESOLVED FIXED
Alias: None
Product: gdb
Classification: Unclassified
Component: testsuite (show other bugs)
Version: HEAD
: P2 normal
Target Milestone: 11.1
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-11-26 14:58 UTC by Tom de Vries
Modified: 2020-12-11 12:55 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 2020-11-26 14:58:48 UTC
Indeed:
...
$ ./gdb -configuration | grep -i mpfr
             --without-mpfr
...

On another gdb where the test passes:
...
$ ./gdb --configuration | grep mpfr
             --with-mpfr
...

This shouldn't be FAIL, just unsupported or some such.
Comment 1 Tom de Vries 2020-11-26 16:59:28 UTC
Tentative patch:
...
diff --git a/gdb/testsuite/gdb.base/float128.exp b/gdb/testsuite/gdb.base/float128.exp
index 40babca..9508982 100644
--- a/gdb/testsuite/gdb.base/float128.exp
+++ b/gdb/testsuite/gdb.base/float128.exp
@@ -32,6 +32,16 @@ if { [do_compile] != "" && [do_compile {-mfloat128}] != "" } {
 
 clean_restart ${binfile}
 
+set mpfr_supported -1
+gdb_test_multiple "show configuration" "" {
+    -wrap -re "--with-mpfr\r\n.*" {
+       set mpfr_supported 1
+    }
+    -wrap -re "--without-mpfr\r\n.*" {
+       set mpfr_supported 0
+    }
+}
+
 if ![runto_main] then {
     perror "couldn't run to breakpoint"
     continue
@@ -84,7 +94,11 @@ gdb_test_multiple "print large128" "$test" {
        pass "$test"
     }
     -re ".* = inf.*$gdb_prompt $" {
-       fail "$test (GDB may be missing MPFR support!)"
+       if { $mpfr_supported == 0 } {
+           unsupported "$test (Missing MPFR support)"
+       } else {
+           fail $test
+       }
     }
     -re ".*$gdb_prompt $" {
        fail "$test"
...
Comment 2 Tom de Vries 2020-12-10 12:54:14 UTC
patch submitted: https://sourceware.org/pipermail/gdb-patches/2020-December/173972.html
Comment 3 Sourceware Commits 2020-12-11 12:55:08 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=9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56

commit 9cd7a95a2bb9ba9d5a6af022e5454c8ce78aee56
Author: Tom de Vries <tdevries@suse.de>
Date:   Fri Dec 11 13:55:04 2020 +0100

    [gdb/testsuite] Fix gdb.base/float128.exp with --with-mpfr=no
    
    When configuring gdb using --with-mpfr=no and running test-case
    gdb.base/float128.exp, we run into:
    ...
    FAIL: gdb.base/float128.exp: print large128 (GDB may be missing MPFR support!)
    ...
    
    Fix this by detecting that gdb was build without mpfr using the show
    configuration command, and changing the FAIL into UNSUPPORTED.
    
    Tested on x86_64-linux.
    
    gdb/testsuite/ChangeLog:
    
    2020-12-11  Tom de Vries  <tdevries@suse.de>
    
            PR testsuite/26954
            * gdb.base/float128.exp: Detect and handle no mpfr support.
Comment 4 Tom de Vries 2020-12-11 12:55:46 UTC
Patch fixing test-case committed, marking resolved-fixed.