Re: [PATCH] Relax type-printer regexp in libstdc++ test suite

2023-06-29 Thread Tom Tromey via Gcc-patches
> Jonathan Wakely  writes:

> Looks good. OK for trunk, and OK to backport after some soak time on trunk. 
> Thanks.

AdaCore doesn't need a backport of this, and I don't think it's
extremely important; so unless you want me to do it, I don't plan to.

I did check it in on trunk earlier today.

thanks,
Tom


[PATCH] Relax type-printer regexp in libstdc++ test suite

2023-06-28 Thread Tom Tromey via Gcc-patches
The libstdc++ test suite checks whether gdb type printers are
available like so:

set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
   "\\\[\\\]"]

This regexp assumes that the list of printers is empty.  However,
sometimes it's convenient to ship a gdb that comes with some default
printers, causing this to erroneously report that gdb is "too old".

I believe the intent of this check is to ensure that gdb.type_printers
exists -- not to check its starting value.  This patch changes the
check to accept any Python list as output.

Note that the patch doesn't look for the trailing "]".  I tried this
but in my case the output was too long for expect.  It seemed fine to
just check the start, as the point really is to reject the case where
the command prints an error message.

* testsuite/lib/gdb-test.exp (gdb-test): Relax type-printer
regexp.
---
 libstdc++-v3/testsuite/lib/gdb-test.exp | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/libstdc++-v3/testsuite/lib/gdb-test.exp 
b/libstdc++-v3/testsuite/lib/gdb-test.exp
index 3728a060aa4..d8e572ef7b3 100644
--- a/libstdc++-v3/testsuite/lib/gdb-test.exp
+++ b/libstdc++-v3/testsuite/lib/gdb-test.exp
@@ -107,8 +107,12 @@ proc gdb-test { marker {selector {}} {load_xmethods 0} } {
}
 }
 
+# A very old version of gdb will not have the type_printers
+# global.  Some organizations may ship a gdb that has some default
+# type printers, so accept any list output as indication that the
+# global exists.
 set do_whatis_tests [gdb_batch_check "python print(gdb.type_printers)" \
-  "\\\[\\\]"]
+  "\\\[.+"]
 if {!$do_whatis_tests} {
send_log "skipping 'whatis' tests - gdb too old"
 }
-- 
2.40.1



Re: [PATCH] [rs6000] adjust return_pc debug attrs

2023-03-24 Thread Tom Tromey via Gcc-patches
> "Segher" == Segher Boessenkool  writes:

>> FWIW I sent a gdb patch to work around this bug.  However, in my
>> examples, I only ever saw a nop following the call instruction -- so I
>> had gdb check for this.

Segher> GCC inserts just a nop in most cases, but the linker or dynamic linker
Segher> can replace it.

Thanks.  I've updated my gdb patch to drop the nop check.

Tom


Re: [PATCH] [rs6000] adjust return_pc debug attrs

2023-03-17 Thread Tom Tromey via Gcc-patches
> "Segher" == Segher Boessenkool  writes:

Segher> Yes.  On most architectures you can get multiple machine instructions of
Segher> course (for long calls for example), but on rs6000 (with some ABIs, in
Segher> some circumstances) we generate a nop insn after calls, so that the
Segher> linker has a spot to insert fixup code after calls (typically to restore
Segher> the r2 contents, but it could be anything).

FWIW I sent a gdb patch to work around this bug.  However, in my
examples, I only ever saw a nop following the call instruction -- so I
had gdb check for this.

Patch is here:

https://sourceware.org/pipermail/gdb-patches/2023-March/197951.html

... but I suppose I should change it to drop the nop check?

It would of course be better not to have to have gdb work around this
problem.

Tom


Re: [PATCH Rust front-end v3 01/46] Use DW_ATE_UTF for the Rust 'char' type

2022-10-31 Thread Tom Tromey via Gcc-patches
> "Mark" == Mark Wielaard  writes:

Mark> DW_LANG_Rust_old was used by old rustc compilers <= 2016 before DWARF5
Mark> assigned an official number. It might be recognized by some
Mark> debuggers.

FWIW I wouldn't worry about it any more.
We could probably just remove the '_old' constant.

Tom


[PATCH] Remove --with-gmp-dir and --with-mpfr-dir

2022-03-18 Thread Tom Tromey via Gcc-patches
The top-level configure options --with-gmp-dir and --with-mpfr-dir
were obsoleted and marked as "REMOVED" back in 2006.  I think that's
long enough ago for everyone to have updated their scripts, so this
patch removes them entirely.  While doing this, I also found one other
leftover that wasn't removed by the earlier patch.  This is also
removed here.

ChangeLog
2022-03-18  Tom Tromey  

* configure.ac: Remove --with-mpfr-dir and --with-gmp-dir.
* configure: Rebuild.
---
 ChangeLog|  5 +
 configure| 22 +-
 configure.ac | 14 ++
 3 files changed, 8 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index f7e0fa46c9c..69d8fc046c3 100755
--- a/configure
+++ b/configure
@@ -811,11 +811,9 @@ enable_pgo_build
 with_mpc
 with_mpc_include
 with_mpc_lib
-with_mpfr_dir
 with_mpfr
 with_mpfr_include
 with_mpfr_lib
-with_gmp_dir
 with_gmp
 with_gmp_include
 with_gmp_lib
@@ -1588,14 +1586,12 @@ Optional Packages:
   --with-mpc-lib=PATH/lib
   --with-mpc-include=PATH specify directory for installed MPC include files
   --with-mpc-lib=PATH specify directory for the installed MPC library
-  --with-mpfr-dir=PATHthis option has been REMOVED
   --with-mpfr=PATHspecify prefix directory for installed MPFR package.
   Equivalent to --with-mpfr-include=PATH/include plus
   --with-mpfr-lib=PATH/lib
   --with-mpfr-include=PATH
   specify directory for installed MPFR include files
   --with-mpfr-lib=PATHspecify directory for the installed MPFR library
-  --with-gmp-dir=PATH this option has been REMOVED
   --with-gmp=PATH specify prefix directory for the installed GMP
   package. Equivalent to
   --with-gmp-include=PATH/include plus
@@ -3768,7 +3764,7 @@ case "${target}" in
   *-*-dragonfly*)
 ;;
   *-*-freebsd*)
-if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
+if test "x$with_gmp" = x \
&& ! test -d ${srcdir}/gmp \
&& test -f /usr/local/include/gmp.h; then
   with_gmp=/usr/local
@@ -7999,14 +7995,6 @@ fi
 # Specify a location for mpfr
 # check for this first so it ends up on the link line before gmp.
 
-# Check whether --with-mpfr-dir was given.
-if test "${with_mpfr_dir+set}" = set; then :
-  withval=$with_mpfr_dir; as_fn_error $? "The --with-mpfr-dir=PATH option has 
been removed.
-Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH" 
"$LINENO" 5
-fi
-
-
-
 # Check whether --with-mpfr was given.
 if test "${with_mpfr+set}" = set; then :
   withval=$with_mpfr;
@@ -8052,14 +8040,6 @@ fi
 
 # Specify a location for gmp
 
-# Check whether --with-gmp-dir was given.
-if test "${with_gmp_dir+set}" = set; then :
-  withval=$with_gmp_dir; as_fn_error $? "The --with-gmp-dir=PATH option has 
been removed.
-Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH" 
"$LINENO" 5
-fi
-
-
-
 # Check whether --with-gmp was given.
 if test "${with_gmp+set}" = set; then :
   withval=$with_gmp;
diff --git a/configure.ac b/configure.ac
index 434b1a267a4..d0f6d215b99 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,6 @@
 #   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
 #   2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012,
-#   2014, 2015, 2016, 2019 Free Software Foundation, Inc.
+#   2014, 2015, 2016, 2019, 2022 Free Software Foundation, Inc.
 #
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1021,7 +1021,7 @@ case "${target}" in
   *-*-dragonfly*)
 ;;
   *-*-freebsd*)
-if test "x$with_gmp" = x && test "x$with_gmp_dir" = x \
+if test "x$with_gmp" = x \
&& ! test -d ${srcdir}/gmp \
&& test -f /usr/local/include/gmp.h; then
   with_gmp=/usr/local
@@ -1568,11 +1568,6 @@ fi
 
 # Specify a location for mpfr
 # check for this first so it ends up on the link line before gmp.
-AC_ARG_WITH(mpfr-dir,
-[AS_HELP_STRING([--with-mpfr-dir=PATH], [this option has been REMOVED])],
-[AC_MSG_ERROR([The --with-mpfr-dir=PATH option has been removed.
-Use --with-mpfr=PATH or --with-mpfr-include=PATH plus --with-mpfr-lib=PATH])])
-
 AC_ARG_WITH(mpfr,
 [AS_HELP_STRING([--with-mpfr=PATH],
[specify prefix directory for installed MPFR package.
@@ -1612,11 +1607,6 @@ Building GCC with MPFR in the source tree is only 
handled for MPFR 3.1.0+.])
 fi
 
 # Specify a location for gmp
-AC_ARG_WITH(gmp-dir,
-[AS_HELP_STRING([--with-gmp-dir=PATH], [this option has been REMOVED])],
-[AC_MSG_ERROR([The --with-gmp-dir=PATH option has been removed.
-Use --with-gmp=PATH or --with-gmp-include=PATH plus --with-gmp-lib=PATH])])
-
 AC_ARG_WITH(gmp,
 [AS_HELP_STRING([--with-gmp=PATH],
[specify prefix directory for the installed GMP package.
-- 
2.34.1