From ae5369e773c341ab55a130fffb4678bb3595d692 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ludovic=20Court=C3=A8s?= Date: Sun, 28 Jun 2020 16:25:40 +0200 Subject: [PATCH] guile: Add support for Guile 3.0. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit gdb/ChangeLog 2020-06-28 Ludovic Courtès * guile/scm-math.c (vlscm_integer_fits_p): Use 'uintmax_t' and 'intmax_t' instead of 'scm_t_uintmax' and 'scm_t_intmax', which are deprecated in Guile 3.0. * configure.ac (try_guile_versions): Add "guile-3.0". * configure (try_guile_versions): Regenerate. * NEWS: Update entry. gdb/testsuite/ChangeLog 2020-06-28 Ludovic Courtès * gdb.guile/source2.scm: Add #f first argument to 'format'. * gdb.guile/types-module.exp: Remove "ERROR:" from regexps since Guile 3.0 no longer prints that. gdb/doc/ChangeLog 2020-06-28 Ludovic Courtès * doc/guile.texi (Guile Introduction): Mention Guile 3.0. Change-Id: Iff116c2e40f334e4e0ca4e759a097bfd23634679 --- gdb/ChangeLog | 9 +++++++++ gdb/NEWS | 2 +- gdb/configure | 2 +- gdb/configure.ac | 2 +- gdb/doc/ChangeLog | 4 ++++ gdb/doc/guile.texi | 2 +- gdb/guile/scm-math.c | 4 ++-- gdb/testsuite/ChangeLog | 6 ++++++ gdb/testsuite/gdb.guile/source2.scm | 2 +- gdb/testsuite/gdb.guile/types-module.exp | 6 +++--- 10 files changed, 29 insertions(+), 10 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8305a274e25..30ef2c8e35a 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,12 @@ +2020-07-20 Ludovic Courtès + + * guile/scm-math.c (vlscm_integer_fits_p): Use 'uintmax_t' + and 'intmax_t' instead of 'scm_t_uintmax' and 'scm_t_intmax', + which are deprecated in Guile 3.0. + * configure.ac (try_guile_versions): Add "guile-3.0". + * configure (try_guile_versions): Regenerate. + * NEWS: Update entry. + 2020-07-20 Ludovic Courtès Doug Evans diff --git a/gdb/NEWS b/gdb/NEWS index b1912625e36..001dc5e4683 100644 --- a/gdb/NEWS +++ b/gdb/NEWS @@ -132,7 +132,7 @@ GNU/Linux/RISC-V (gdbserver) riscv*-*-linux* * Guile API - ** GDB can now be built with GNU Guile 2.2 in addition to 2.0. + ** GDB can now be built with GNU Guile 3.0 and 2.2 in addition to 2.0. ** Procedures 'memory-port-read-buffer-size', 'set-memory-port-read-buffer-size!', 'memory-port-write-buffer-size', diff --git a/gdb/configure b/gdb/configure index 3b71d03ebb5..b259db585d1 100755 --- a/gdb/configure +++ b/gdb/configure @@ -10959,7 +10959,7 @@ fi -try_guile_versions="guile-2.2 guile-2.0" +try_guile_versions="guile-3.0 guile-2.2 guile-2.0" have_libguile=no case "${with_guile}" in no) diff --git a/gdb/configure.ac b/gdb/configure.ac index 0b40062e536..f9461b21507 100644 --- a/gdb/configure.ac +++ b/gdb/configure.ac @@ -1088,7 +1088,7 @@ AC_MSG_RESULT([$with_guile]) dnl We check guile with pkg-config. AC_PATH_PROG(pkg_config_prog_path, pkg-config, missing) -try_guile_versions="guile-2.2 guile-2.0" +try_guile_versions="guile-3.0 guile-2.2 guile-2.0" have_libguile=no case "${with_guile}" in no) diff --git a/gdb/doc/ChangeLog b/gdb/doc/ChangeLog index a573d205171..031e0efd937 100644 --- a/gdb/doc/ChangeLog +++ b/gdb/doc/ChangeLog @@ -1,3 +1,7 @@ +2020-07-20 Ludovic Courtès + + * doc/guile.texi (Guile Introduction): Mention Guile 3.0. + 2020-07-20 Ludovic Courtès * guile.texi (Memory Ports in Guile): Mark diff --git a/gdb/doc/guile.texi b/gdb/doc/guile.texi index 52da7e7c17a..9d1f55a8396 100644 --- a/gdb/doc/guile.texi +++ b/gdb/doc/guile.texi @@ -38,7 +38,7 @@ Guile support in @value{GDBN} follows the Python support in @value{GDBN} reasonably closely, so concepts there should carry over. However, some things are done differently where it makes sense. -@value{GDBN} requires Guile version 2.2 or 2.0. +@value{GDBN} requires Guile version 3.0, 2.2, or 2.0. @cindex guile scripts directory Guile scripts used by @value{GDBN} should be installed in diff --git a/gdb/guile/scm-math.c b/gdb/guile/scm-math.c index 7c63fa2ae04..419f5099bf4 100644 --- a/gdb/guile/scm-math.c +++ b/gdb/guile/scm-math.c @@ -578,7 +578,7 @@ vlscm_integer_fits_p (SCM obj, struct type *type) ULONGEST max; /* If scm_is_unsigned_integer can't work with this type, just punt. */ - if (TYPE_LENGTH (type) > sizeof (scm_t_uintmax)) + if (TYPE_LENGTH (type) > sizeof (uintmax_t)) return 0; get_unsigned_type_max (type, &max); return scm_is_unsigned_integer (obj, 0, max); @@ -588,7 +588,7 @@ vlscm_integer_fits_p (SCM obj, struct type *type) LONGEST min, max; /* If scm_is_signed_integer can't work with this type, just punt. */ - if (TYPE_LENGTH (type) > sizeof (scm_t_intmax)) + if (TYPE_LENGTH (type) > sizeof (intmax_t)) return 0; get_signed_type_minmax (type, &min, &max); return scm_is_signed_integer (obj, min, max); diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog index 885d317cb08..7dca586dd47 100644 --- a/gdb/testsuite/ChangeLog +++ b/gdb/testsuite/ChangeLog @@ -1,3 +1,9 @@ +2020-07-20 Ludovic Courtès + + * gdb.guile/source2.scm: Add #f first argument to 'format'. + * gdb.guile/types-module.exp: Remove "ERROR:" from + regexps since Guile 3.0 no longer prints that. + 2020-07-20 Ludovic Courtès * gdb.guile/scm-error.exp ("source $remote_guile_file_1"): Relax diff --git a/gdb/testsuite/gdb.guile/source2.scm b/gdb/testsuite/gdb.guile/source2.scm index 39638053d93..c39f03801a6 100644 --- a/gdb/testsuite/gdb.guile/source2.scm +++ b/gdb/testsuite/gdb.guile/source2.scm @@ -15,5 +15,5 @@ ;; You should have received a copy of the GNU General Public License ;; along with this program. If not, see . -(display (format "y~As" "e")) +(display (format #f "y~As" "e")) (newline) diff --git a/gdb/testsuite/gdb.guile/types-module.exp b/gdb/testsuite/gdb.guile/types-module.exp index 5a631dca8e8..8ced6fbffb4 100644 --- a/gdb/testsuite/gdb.guile/types-module.exp +++ b/gdb/testsuite/gdb.guile/types-module.exp @@ -44,7 +44,7 @@ gdb_test "guile (print (type-has-field-deep? d \"base_member\"))" \ "= #t" "type-has-field-deep? member in baseclass" gdb_test "guile (print (type-has-field-deep? (lookup-type \"int\") \"base_member\"))" \ - "ERROR: .*Wrong type argument in position 1 \\(expecting struct or union\\): #.*" \ + "Wrong type argument in position 1 \\(expecting struct or union\\): #.*" \ "type-has-field-deep? from int" gdb_scm_test_silent_cmd "guile (define enum-htab (make-enum-hashtable (lookup-type \"enum_type\")))" \ @@ -54,9 +54,9 @@ gdb_test "guile (print (hash-ref enum-htab \"B\"))" \ "= 1" "verify make-enum-hashtable" gdb_test "guile (define bad-enum-htab (make-enum-hashtable #f))" \ - "ERROR: .*Wrong type argument in position 1 \\(expecting gdb:type\\): #f.*" \ + "Wrong type argument in position 1 \\(expecting gdb:type\\): #f.*" \ "make-enum-hashtable from #f" gdb_test "guile (define bad-enum-htab (make-enum-hashtable (lookup-type \"int\")))" \ - "ERROR: .*Wrong type argument in position 1 \\(expecting enum\\): #.*" \ + "Wrong type argument in position 1 \\(expecting enum\\): #.*" \ "make-enum-hashtable from int" -- 2.30.2