From: Arkadiusz Miśkiewicz Date: Tue, 23 Aug 2016 16:15:22 +0000 (+0200) Subject: - up to 7.11.1 X-Git-Tag: auto/th/gdb-7.11.1-1 X-Git-Url: http://git.pld-linux.org/gitweb.cgi?a=commitdiff_plain;h=28b292e952388eec0990d7070bc4aca626243069;p=packages%2Fgdb.git - up to 7.11.1 --- diff --git a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch index b3750cd..64fe1d0 100644 --- a/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch @@ -15,10 +15,10 @@ Comments by Sergio Durigan Junior : NULL after it is free'd, otherwise the code below thinks that it is still valid and doesn't print the necessary warning ("Try: yum install ..."). -Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2015-07-09 22:22:26.278304653 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp 2016-02-15 23:31:06.327941085 +0100 @@ -0,0 +1,97 @@ +# Copyright (C) 2014 Free Software Foundation, Inc. + @@ -51,9 +51,9 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-inst +} + +# We first need to generate a corefile -+set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test] ++set escapedfilename [string_to_regexp [standard_output_file gcore.test]] +set core_supported 0 -+gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \ ++gdb_test_multiple "gcore [standard_output_file gcore.test]" \ + "save a corefile" \ +{ + -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" { @@ -84,19 +84,19 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-inst + gdb_test "set build-id-verbose 1" "" \ + "set build-id-verbose" + -+ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ + "set debug-file-directory" + -+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ -+ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $objdir/$subdir/$build_id_without_debug\r\n.*" \ ++ gdb_test "core-file [standard_output_file gcore.test]" \ ++ "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install [standard_output_file $build_id_without_debug]\r\n.*" \ + "test first yum/dnf warning" +} + +# Now we define and create our .build-id -+file mkdir [file dirname ${objdir}/${subdir}/${build_id_without_debug}] ++file mkdir [file dirname [standard_output_file ${build_id_without_debug}]] +# Cannot use "file link" (from TCL) because it requires the target file to +# exist. -+remote_exec build "ln -s $binfile ${objdir}/${subdir}/${build_id_without_debug}" ++remote_exec build "ln -s $binfile [standard_output_file ${build_id_without_debug}]" + +# Reinitialize GDB to get the second yum/dnf warning +gdb_exit @@ -107,21 +107,21 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-inst + gdb_test "set build-id-verbose 1" "" \ + "set build-id-verbose" + -+ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ gdb_test "set debug-file-directory [file dirname [standard_output_file gcore.test]]" "" \ + "set debug-file-directory" + -+ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ ++ gdb_test "core-file [standard_output_file gcore.test]" \ + "Missing separate debuginfo for the main executable file\r\nTry: (yum|dnf) --enablerepo='\\*debug\\*' install $binfile\r\n.*" \ + "test second yum/dnf warning" +} + +# Leaving the link there will cause breakage in the next run. -+remote_exec build "rm -f ${objdir}/${subdir}/${build_id_without_debug}" -Index: gdb-7.9.90.20150709/gdb/build-id.c ++remote_exec build "rm -f [standard_output_file ${build_id_without_debug}]" +Index: gdb-7.10.90.20160211/gdb/build-id.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:22:26.278304653 +0200 -+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:22:51.398502329 +0200 -@@ -589,7 +589,10 @@ build_id_to_debug_bfd (size_t build_id_l +--- gdb-7.10.90.20160211.orig/gdb/build-id.c 2016-02-15 23:30:55.389863424 +0100 ++++ gdb-7.10.90.20160211/gdb/build-id.c 2016-02-15 23:30:55.778866186 +0100 +@@ -589,7 +589,10 @@ do_cleanups (inner); if (abfd == NULL) diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 9e850dd..5efcc5a 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,7 +1,7 @@ -Index: gdb-7.9.90.20150717/gdb/event-top.c +Index: gdb-7.10.50.20160106/gdb/event-top.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/event-top.c 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/event-top.c 2015-08-01 20:07:15.822993674 +0200 +--- gdb-7.10.50.20160106.orig/gdb/event-top.c ++++ gdb-7.10.50.20160106/gdb/event-top.c @@ -37,6 +37,7 @@ #include "gdbcmd.h" /* for dont_repeat() */ #include "annotate.h" @@ -28,10 +28,10 @@ Index: gdb-7.9.90.20150717/gdb/event-top.c old_chain = make_cleanup (free_current_contents, &actual_gdb_prompt); /* Do not call the python hook on an explicit prompt change as -Index: gdb-7.9.90.20150717/gdb/symfile.h +Index: gdb-7.10.50.20160106/gdb/symfile.h =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/symfile.h 2015-08-01 20:07:15.787993404 +0200 -+++ gdb-7.9.90.20150717/gdb/symfile.h 2015-08-01 20:07:15.822993674 +0200 +--- gdb-7.10.50.20160106.orig/gdb/symfile.h ++++ gdb-7.10.50.20160106/gdb/symfile.h @@ -587,6 +587,8 @@ void map_symbol_filenames (symbol_filena /* build-id support. */ extern struct bfd_build_id *build_id_addr_get (CORE_ADDR addr); @@ -41,11 +41,11 @@ Index: gdb-7.9.90.20150717/gdb/symfile.h /* From dwarf2read.c */ -Index: gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp +Index: gdb-7.10.50.20160106/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.789993420 +0200 -+++ gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp 2015-08-01 20:07:15.824993689 +0200 -@@ -1573,7 +1573,7 @@ proc default_gdb_start { } { +--- gdb-7.10.50.20160106.orig/gdb/testsuite/lib/gdb.exp ++++ gdb-7.10.50.20160106/gdb/testsuite/lib/gdb.exp +@@ -1642,7 +1642,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -54,11 +54,11 @@ Index: gdb-7.9.90.20150717/gdb/testsuite/lib/gdb.exp send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.10.50.20160106/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.789993420 +0200 -+++ gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp 2015-08-01 20:07:15.824993689 +0200 -@@ -214,7 +214,7 @@ proc default_mi_gdb_start { args } { +--- gdb-7.10.50.20160106.orig/gdb/testsuite/lib/mi-support.exp ++++ gdb-7.10.50.20160106/gdb/testsuite/lib/mi-support.exp +@@ -204,7 +204,7 @@ proc default_mi_gdb_start { args } { warning "Couldn't set the width to 0." } } @@ -67,10 +67,10 @@ Index: gdb-7.9.90.20150717/gdb/testsuite/lib/mi-support.exp send_gdb "190-gdb-set build-id-verbose 0\n" gdb_expect 10 { -re ".*190-gdb-set build-id-verbose 0\r\n190\\\^done\r\n$mi_gdb_prompt$" { -Index: gdb-7.9.90.20150717/gdb/tui/tui-interp.c +Index: gdb-7.10.50.20160106/gdb/tui/tui-interp.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/tui/tui-interp.c 2015-07-17 03:59:13.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/tui/tui-interp.c 2015-08-01 20:07:15.825993697 +0200 +--- gdb-7.10.50.20160106.orig/gdb/tui/tui-interp.c ++++ gdb-7.10.50.20160106/gdb/tui/tui-interp.c @@ -31,6 +31,7 @@ #include "tui/tui-io.h" #include "infrun.h" @@ -79,10 +79,10 @@ Index: gdb-7.9.90.20150717/gdb/tui/tui-interp.c static struct ui_out *tui_ui_out (struct interp *self); -Index: gdb-7.9.90.20150717/gdb/aclocal.m4 +Index: gdb-7.10.50.20160106/gdb/aclocal.m4 =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/aclocal.m4 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/aclocal.m4 2015-08-01 20:07:15.825993697 +0200 +--- gdb-7.10.50.20160106.orig/gdb/aclocal.m4 ++++ gdb-7.10.50.20160106/gdb/aclocal.m4 @@ -11,6 +11,221 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -305,10 +305,10 @@ Index: gdb-7.9.90.20150717/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -Index: gdb-7.9.90.20150717/gdb/config.in +Index: gdb-7.10.50.20160106/gdb/config.in =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/config.in 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/config.in 2015-08-01 20:07:15.826993704 +0200 +--- gdb-7.10.50.20160106.orig/gdb/config.in ++++ gdb-7.10.50.20160106/gdb/config.in @@ -33,6 +33,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -329,11 +329,11 @@ Index: gdb-7.9.90.20150717/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -Index: gdb-7.9.90.20150717/gdb/configure +Index: gdb-7.10.50.20160106/gdb/configure =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/configure 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/configure 2015-08-01 20:07:15.830993735 +0200 -@@ -703,6 +703,11 @@ PKGVERSION +--- gdb-7.10.50.20160106.orig/gdb/configure ++++ gdb-7.10.50.20160106/gdb/configure +@@ -705,6 +705,11 @@ PKGVERSION HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -345,7 +345,7 @@ Index: gdb-7.9.90.20150717/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -811,6 +816,7 @@ with_gdb_datadir +@@ -813,6 +818,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -353,7 +353,7 @@ Index: gdb-7.9.90.20150717/gdb/configure enable_targets enable_64_bit_bfd enable_gdbcli -@@ -867,6 +873,11 @@ CCC +@@ -869,6 +875,11 @@ CCC CPP MAKEINFO MAKEINFOFLAGS @@ -365,7 +365,7 @@ Index: gdb-7.9.90.20150717/gdb/configure YACC YFLAGS XMKMF' -@@ -1538,6 +1549,8 @@ Optional Packages: +@@ -1540,6 +1551,8 @@ Optional Packages: [--with-auto-load-dir] --without-auto-load-safe-path do not restrict auto-loaded files locations @@ -374,7 +374,7 @@ Index: gdb-7.9.90.20150717/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1592,6 +1605,13 @@ Some influential environment variables: +@@ -1595,6 +1608,13 @@ Some influential environment variables: MAKEINFO Parent configure detects if it is of sufficient version. MAKEINFOFLAGS Parameters for MAKEINFO. @@ -388,7 +388,7 @@ Index: gdb-7.9.90.20150717/gdb/configure YACC The `Yet Another C Compiler' implementation to use. Defaults to the first program found out of: `bison -y', `byacc', `yacc'. YFLAGS The list of arguments that will be passed by default to $YACC. -@@ -5608,6 +5628,491 @@ _ACEOF +@@ -5655,6 +5675,494 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -623,6 +623,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + + + ++ +if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. @@ -751,6 +752,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPM_CFLAGS=`$PKG_CONFIG --cflags "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi @@ -767,6 +769,7 @@ Index: gdb-7.9.90.20150717/gdb/configure + $as_echo "$as_me:${as_lineno-$LINENO}: \$? = $ac_status" >&5 + test $ac_status = 0; }; then + pkg_cv_RPM_LIBS=`$PKG_CONFIG --libs "rpm" 2>/dev/null` ++ test "x$?" != "x0" && pkg_failed=yes +else + pkg_failed=yes +fi @@ -786,9 +789,9 @@ Index: gdb-7.9.90.20150717/gdb/configure + _pkg_short_errors_supported=no +fi + if test $_pkg_short_errors_supported = yes; then -+ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors "rpm" 2>&1` ++ RPM_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "rpm" 2>&1` + else -+ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors "rpm" 2>&1` ++ RPM_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "rpm" 2>&1` + fi + # Put the nasty error message in config.log where it belongs + echo "$RPM_PKG_ERRORS" >&5 @@ -880,10 +883,10 @@ Index: gdb-7.9.90.20150717/gdb/configure subdirs="$subdirs testsuite" -Index: gdb-7.9.90.20150717/gdb/configure.ac +Index: gdb-7.10.50.20160106/gdb/configure.ac =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/configure.ac 2015-07-17 03:59:12.000000000 +0200 -+++ gdb-7.9.90.20150717/gdb/configure.ac 2015-08-01 20:07:15.831993743 +0200 +--- gdb-7.10.50.20160106.orig/gdb/configure.ac ++++ gdb-7.10.50.20160106/gdb/configure.ac @@ -177,6 +177,199 @@ AC_DEFINE_DIR(AUTO_LOAD_SAFE_PATH, escap [Directories safe to hold auto-loaded files.]) AC_MSG_RESULT([$with_auto_load_safe_path]) @@ -1084,10 +1087,10 @@ Index: gdb-7.9.90.20150717/gdb/configure.ac AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.9.90.20150717/gdb/corelow.c +Index: gdb-7.10.50.20160106/gdb/corelow.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/corelow.c 2015-08-01 20:07:15.775993312 +0200 -+++ gdb-7.9.90.20150717/gdb/corelow.c 2015-08-01 20:07:15.831993743 +0200 +--- gdb-7.10.50.20160106.orig/gdb/corelow.c ++++ gdb-7.10.50.20160106/gdb/corelow.c @@ -310,7 +310,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } @@ -1097,10 +1100,10 @@ Index: gdb-7.9.90.20150717/gdb/corelow.c do_cleanups (back_to); -Index: gdb-7.9.90.20150717/gdb/build-id.c +Index: gdb-7.10.50.20160106/gdb/build-id.c =================================================================== ---- gdb-7.9.90.20150717.orig/gdb/build-id.c 2015-08-01 20:07:15.791993435 +0200 -+++ gdb-7.9.90.20150717/gdb/build-id.c 2015-08-01 20:08:27.735546630 +0200 +--- gdb-7.10.50.20160106.orig/gdb/build-id.c ++++ gdb-7.10.50.20160106/gdb/build-id.c @@ -35,6 +35,7 @@ #include "elf/common.h" #include "elf-bfd.h" @@ -1109,7 +1112,7 @@ Index: gdb-7.9.90.20150717/gdb/build-id.c #define BUILD_ID_VERBOSE_NONE 0 #define BUILD_ID_VERBOSE_FILENAMES 1 -@@ -665,8 +666,363 @@ build_id_to_filename (const struct bfd_b +@@ -665,8 +666,366 @@ build_id_to_filename (const struct bfd_b return result; } @@ -1187,6 +1190,9 @@ Index: gdb-7.9.90.20150717/gdb/build-id.c + if (strcmp (filename, BUILD_ID_MAIN_EXECUTABLE_FILENAME) == 0) + return 0; + ++ if (is_target_filename (filename)) ++ return 0; ++ + if (filename[0] != '/') + { + warning (_("Ignoring non-absolute filename: <%s>"), filename); @@ -1474,7 +1480,7 @@ Index: gdb-7.9.90.20150717/gdb/build-id.c avoidance. */ struct missing_filepair -@@ -720,11 +1076,17 @@ missing_filepair_change (void) +@@ -720,11 +1079,17 @@ missing_filepair_change (void) /* All their memory came just from missing_filepair_OBSTACK. */ missing_filepair_hash = NULL; } @@ -1492,7 +1498,7 @@ Index: gdb-7.9.90.20150717/gdb/build-id.c missing_filepair_change (); } -@@ -791,14 +1153,39 @@ debug_print_missing (const char *binary, +@@ -791,14 +1156,39 @@ debug_print_missing (const char *binary, *slot = missing_filepair; diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index dc05c39..b25ad8e 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1,7 +1,7 @@ -Index: gdb-7.9.90.20150709/gdb/corelow.c +Index: gdb-7.10.90.20160211/gdb/corelow.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/corelow.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/corelow.c 2015-07-09 22:05:42.057222722 +0200 +--- gdb-7.10.90.20160211.orig/gdb/corelow.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/corelow.c 2016-02-15 23:26:46.516096395 +0100 @@ -45,6 +45,10 @@ #include "gdb_bfd.h" #include "completer.h" @@ -13,7 +13,7 @@ Index: gdb-7.9.90.20150709/gdb/corelow.c #ifndef O_LARGEFILE #define O_LARGEFILE 0 -@@ -266,6 +270,53 @@ add_to_thread_list (bfd *abfd, asection +@@ -266,6 +270,53 @@ inferior_ptid = ptid; /* Yes, make it current. */ } @@ -67,7 +67,7 @@ Index: gdb-7.9.90.20150709/gdb/corelow.c /* This routine opens and sets up the core file bfd. */ static void -@@ -404,6 +455,14 @@ core_open (const char *arg, int from_tty +@@ -404,6 +455,14 @@ switch_to_thread (thread->ptid); } @@ -82,7 +82,7 @@ Index: gdb-7.9.90.20150709/gdb/corelow.c post_create_inferior (&core_ops, from_tty); /* Now go through the target stack looking for threads since there -@@ -1058,4 +1117,11 @@ _initialize_corelow (void) +@@ -1068,4 +1127,11 @@ init_core_ops (); add_target_with_completer (&core_ops, filename_completer); @@ -94,11 +94,11 @@ Index: gdb-7.9.90.20150709/gdb/corelow.c + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-7.9.90.20150709/gdb/doc/gdb.texinfo +Index: gdb-7.10.90.20160211/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/doc/gdb.texinfo 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/doc/gdb.texinfo 2015-07-09 22:05:42.067222806 +0200 -@@ -18304,6 +18304,27 @@ information files. +--- gdb-7.10.90.20160211.orig/gdb/doc/gdb.texinfo 2016-02-15 23:25:36.455598958 +0100 ++++ gdb-7.10.90.20160211/gdb/doc/gdb.texinfo 2016-02-15 23:26:06.362811302 +0100 +@@ -18684,6 +18684,27 @@ @end table @@ -126,10 +126,10 @@ Index: gdb-7.9.90.20150709/gdb/doc/gdb.texinfo @cindex @code{.gnu_debuglink} sections @cindex debug link sections A debug link is a special section of the executable file named -Index: gdb-7.9.90.20150709/gdb/solib-svr4.c +Index: gdb-7.10.90.20160211/gdb/solib-svr4.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/solib-svr4.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/solib-svr4.c 2015-07-09 22:05:42.068222815 +0200 +--- gdb-7.10.90.20160211.orig/gdb/solib-svr4.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/solib-svr4.c 2016-02-15 23:26:46.613097083 +0100 @@ -45,6 +45,7 @@ #include "auxv.h" #include "gdb_bfd.h" @@ -138,7 +138,7 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c static struct link_map_offsets *svr4_fetch_link_map_offsets (void); static int svr4_have_link_map_offsets (void); -@@ -1379,9 +1380,52 @@ svr4_read_so_list (CORE_ADDR lm, CORE_AD +@@ -1416,9 +1417,52 @@ continue; } @@ -194,11 +194,11 @@ Index: gdb-7.9.90.20150709/gdb/solib-svr4.c xfree (buffer); /* If this entry has no name, or its name matches the name -Index: gdb-7.9.90.20150709/gdb/elfread.c +Index: gdb-7.10.90.20160211/gdb/elfread.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/elfread.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/elfread.c 2015-07-09 22:05:42.068222815 +0200 -@@ -1250,9 +1250,10 @@ elf_symfile_read (struct objfile *objfil +--- gdb-7.10.90.20160211.orig/gdb/elfread.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/elfread.c 2016-02-15 23:26:06.364811316 +0100 +@@ -1259,9 +1259,10 @@ && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { @@ -211,7 +211,7 @@ Index: gdb-7.9.90.20150709/gdb/elfread.c if (debugfile == NULL) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1266,6 +1267,12 @@ elf_symfile_read (struct objfile *objfil +@@ -1275,6 +1276,12 @@ symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile); do_cleanups (cleanup); } @@ -224,11 +224,11 @@ Index: gdb-7.9.90.20150709/gdb/elfread.c } } -Index: gdb-7.9.90.20150709/gdb/symfile.h +Index: gdb-7.10.90.20160211/gdb/symfile.h =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/symfile.h 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/symfile.h 2015-07-09 22:05:42.068222815 +0200 -@@ -584,6 +584,10 @@ void expand_symtabs_matching (expand_sym +--- gdb-7.10.90.20160211.orig/gdb/symfile.h 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/symfile.h 2016-02-15 23:26:46.516096395 +0100 +@@ -584,6 +584,10 @@ void map_symbol_filenames (symbol_filename_ftype *fun, void *data, int need_fullname); @@ -239,11 +239,11 @@ Index: gdb-7.9.90.20150709/gdb/symfile.h /* From dwarf2read.c */ /* Names for a dwarf2 debugging section. The field NORMAL is the normal -Index: gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp 2015-07-09 22:05:42.070222832 +0200 -@@ -1573,6 +1573,16 @@ proc default_gdb_start { } { +--- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/gdb.exp 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp 2016-02-15 23:26:46.516096395 +0100 +@@ -1640,6 +1640,16 @@ warning "Couldn't set the width to 0." } } @@ -260,11 +260,11 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/lib/gdb.exp return 0 } -Index: gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp 2015-07-09 22:05:42.070222832 +0200 -@@ -214,6 +214,16 @@ proc default_mi_gdb_start { args } { +--- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/mi-support.exp 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/lib/mi-support.exp 2016-02-15 23:26:46.516096395 +0100 +@@ -204,6 +204,16 @@ warning "Couldn't set the width to 0." } } @@ -278,14 +278,14 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/lib/mi-support.exp + warning "Could not disable the missing debug infos warnings.." + } + } - # If allowing the inferior to have its own PTY then assign the inferior - # its own terminal device here. + + # Create the new PTY for the inferior process. if { $separate_inferior_pty } { -Index: gdb-7.9.90.20150709/gdb/objfiles.h +Index: gdb-7.10.90.20160211/gdb/objfiles.h =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/objfiles.h 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/objfiles.h 2015-07-09 22:05:42.071222840 +0200 -@@ -459,6 +459,10 @@ struct objfile +--- gdb-7.10.90.20160211.orig/gdb/objfiles.h 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/objfiles.h 2016-02-15 23:26:06.366811330 +0100 +@@ -489,6 +489,10 @@ #define OBJF_NOT_FILENAME (1 << 6) @@ -296,11 +296,11 @@ Index: gdb-7.9.90.20150709/gdb/objfiles.h /* Declarations for functions defined in objfiles.c */ extern struct objfile *allocate_objfile (bfd *, const char *name, int); -Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/corefile.exp =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp 2015-07-09 22:05:42.071222840 +0200 -@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile" +--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/corefile.exp 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/corefile.exp 2016-02-15 23:26:55.178157896 +0100 +@@ -293,3 +293,33 @@ pass $test } } @@ -316,7 +316,7 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp + gdb_start + + regsub {\.debug$} $buildid {} buildid -+ set debugdir ${objdir}/${subdir}/${testfile}-debugdir ++ set debugdir [standard_output_file ${testfile}-debugdir] + file delete -force -- $debugdir + file mkdir $debugdir/[file dirname $buildid] + file copy $binfile $debugdir/$buildid @@ -334,10 +334,10 @@ Index: gdb-7.9.90.20150709/gdb/testsuite/gdb.base/corefile.exp + gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*" + pass $wholetest +} -Index: gdb-7.9.90.20150709/gdb/build-id.c +Index: gdb-7.10.90.20160211/gdb/build-id.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/build-id.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/build-id.c 2015-07-09 22:19:35.022957009 +0200 +--- gdb-7.10.90.20160211.orig/gdb/build-id.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/build-id.c 2016-02-15 23:26:46.516096395 +0100 @@ -26,11 +26,67 @@ #include "objfiles.h" #include "filenames.h" @@ -407,7 +407,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c { if (!bfd_check_format (abfd, bfd_object)) return NULL; -@@ -42,6 +98,348 @@ build_id_bfd_get (bfd *abfd) +@@ -42,6 +98,348 @@ return NULL; } @@ -756,7 +756,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c /* See build-id.h. */ int -@@ -50,7 +448,7 @@ build_id_verify (bfd *abfd, size_t check +@@ -50,7 +448,7 @@ const struct bfd_build_id *found; int retval = 0; @@ -765,7 +765,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c if (found == NULL) warning (_("File \"%s\" has no build-id, file skipped"), -@@ -65,20 +463,56 @@ build_id_verify (bfd *abfd, size_t check +@@ -65,23 +463,56 @@ return retval; } @@ -818,15 +818,18 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c struct cleanup *back_to; int ix; bfd *abfd = NULL; +- int alloc_len; /* DEBUG_FILE_DIRECTORY/.build-id/ab/cdef */ -- link = alloca (strlen (debug_file_directory) + (sizeof "/.build-id/" - 1) + 1 -- + 2 * build_id_len + (sizeof ".debug" - 1) + 1); +- alloc_len = (strlen (debug_file_directory) +- + (sizeof "/.build-id/" - 1) + 1 +- + 2 * build_id_len + (sizeof ".debug" - 1) + 1); +- link = (char *) alloca (alloc_len); + link = xmalloc (strlen (debug_file_directory) + 2 * build_id_len + 50); /* Keep backward compatibility so that DEBUG_FILE_DIRECTORY being "" will cause "/.build-id/..." lookups. */ -@@ -91,9 +525,12 @@ build_id_to_debug_bfd (size_t build_id_l +@@ -94,9 +525,12 @@ size_t debugdir_len = strlen (debugdir); const gdb_byte *data = build_id; size_t size = build_id_len; @@ -840,7 +843,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c memcpy (link, debugdir, debugdir_len); s = &link[debugdir_len]; -@@ -107,47 +544,281 @@ build_id_to_debug_bfd (size_t build_id_l +@@ -110,47 +544,281 @@ *s++ = '/'; while (size-- > 0) s += sprintf (s, "%02x", (unsigned) *data++); @@ -1141,7 +1144,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c /* Prevent looping on a stripped .debug file. */ if (abfd != NULL && filename_cmp (bfd_get_filename (abfd), -@@ -167,3 +838,21 @@ find_separate_debug_file_by_buildid (str +@@ -170,3 +838,21 @@ } return NULL; } @@ -1163,10 +1166,10 @@ Index: gdb-7.9.90.20150709/gdb/build-id.c + + observer_attach_executable_changed (debug_print_executable_changed); +} -Index: gdb-7.9.90.20150709/gdb/build-id.h +Index: gdb-7.10.90.20160211/gdb/build-id.h =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/build-id.h 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/build-id.h 2015-07-09 22:05:42.072222849 +0200 +--- gdb-7.10.90.20160211.orig/gdb/build-id.h 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/build-id.h 2016-02-15 23:26:06.368811345 +0100 @@ -20,9 +20,10 @@ #ifndef BUILD_ID_H #define BUILD_ID_H @@ -1180,7 +1183,7 @@ Index: gdb-7.9.90.20150709/gdb/build-id.h /* Return true if ABFD has NT_GNU_BUILD_ID matching the CHECK value. Otherwise, issue a warning and return false. */ -@@ -36,13 +37,18 @@ extern int build_id_verify (bfd *abfd, +@@ -36,13 +37,18 @@ the caller. */ extern bfd *build_id_to_debug_bfd (size_t build_id_len, @@ -1201,11 +1204,11 @@ Index: gdb-7.9.90.20150709/gdb/build-id.h + char **build_id_filename_return); #endif /* BUILD_ID_H */ -Index: gdb-7.9.90.20150709/gdb/dwarf2read.c +Index: gdb-7.10.90.20160211/gdb/dwarf2read.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/dwarf2read.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/dwarf2read.c 2015-07-09 22:05:42.077222891 +0200 -@@ -2507,7 +2507,7 @@ dwarf2_get_dwz_file (void) +--- gdb-7.10.90.20160211.orig/gdb/dwarf2read.c 2016-02-15 23:25:36.461599001 +0100 ++++ gdb-7.10.90.20160211/gdb/dwarf2read.c 2016-02-15 23:26:06.373811380 +0100 +@@ -2516,7 +2516,7 @@ } if (dwz_bfd == NULL) @@ -1214,11 +1217,11 @@ Index: gdb-7.9.90.20150709/gdb/dwarf2read.c if (dwz_bfd == NULL) error (_("could not find '.gnu_debugaltlink' file for %s"), -Index: gdb-7.9.90.20150709/gdb/python/py-objfile.c +Index: gdb-7.10.90.20160211/gdb/python/py-objfile.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/python/py-objfile.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/python/py-objfile.c 2015-07-09 22:05:42.077222891 +0200 -@@ -139,7 +139,7 @@ objfpy_get_build_id (PyObject *self, voi +--- gdb-7.10.90.20160211.orig/gdb/python/py-objfile.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/python/py-objfile.c 2016-02-15 23:26:06.373811380 +0100 +@@ -139,7 +139,7 @@ TRY { @@ -1227,7 +1230,7 @@ Index: gdb-7.9.90.20150709/gdb/python/py-objfile.c } CATCH (except, RETURN_MASK_ALL) { -@@ -548,7 +548,7 @@ objfpy_lookup_objfile_by_build_id (const +@@ -548,7 +548,7 @@ /* Don't return separate debug files. */ if (objfile->separate_debug_objfile_backlink != NULL) continue; @@ -1236,11 +1239,11 @@ Index: gdb-7.9.90.20150709/gdb/python/py-objfile.c if (obfd_build_id == NULL) continue; if (objfpy_build_id_matches (obfd_build_id, build_id)) -Index: gdb-7.9.90.20150709/gdb/coffread.c +Index: gdb-7.10.90.20160211/gdb/coffread.c =================================================================== ---- gdb-7.9.90.20150709.orig/gdb/coffread.c 2015-07-09 22:05:20.988044312 +0200 -+++ gdb-7.9.90.20150709/gdb/coffread.c 2015-07-09 22:05:42.078222899 +0200 -@@ -739,7 +739,7 @@ coff_symfile_read (struct objfile *objfi +--- gdb-7.10.90.20160211.orig/gdb/coffread.c 2016-02-15 23:25:00.859346221 +0100 ++++ gdb-7.10.90.20160211/gdb/coffread.c 2016-02-15 23:26:06.374811387 +0100 +@@ -739,7 +739,7 @@ { char *debugfile; diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch index d0fd183..fa60380 100644 --- a/gdb-archer-vla-tests.patch +++ b/gdb-archer-vla-tests.patch @@ -1,8 +1,8 @@ -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.ada/packed_array.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.ada/packed_array.exp =================================================================== ---- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.ada/packed_array.exp 2014-06-13 03:59:37.000000000 +0200 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.ada/packed_array.exp 2014-06-16 23:30:30.107940483 +0200 -@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { +--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.ada/packed_array.exp 2016-02-15 23:33:29.830959972 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.ada/packed_array.exp 2016-02-15 23:35:56.289999846 +0100 +@@ -56,5 +56,11 @@ # are. Observed with (FSF GNU Ada 4.5.3 20110124). xfail $test } @@ -14,10 +14,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.ada/packed_array.exp + } } -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2014-06-16 23:30:30.108940484 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S 2016-02-15 23:35:56.290999853 +0100 @@ -0,0 +1,455 @@ + .file "x86_64-vla-typedef.c" + .section .debug_abbrev,"",@progbits @@ -474,11 +474,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S + .string "GNU C 4.3.2 20081105 (Red Hat 4.3.2-7)" + .ident "GCC: (GNU) 4.3.2 20081105 (Red Hat 4.3.2-7)" + .section .note.GNU-stack,"",@progbits -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2014-06-16 23:30:30.109940484 +0200 -@@ -0,0 +1,43 @@ ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c 2016-02-15 23:35:56.290999853 +0100 +@@ -0,0 +1,45 @@ +/* This testcase is part of GDB, the GNU debugger. + + Copyright 2008 Free Software Foundation, Inc. @@ -513,6 +513,8 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c + +#else + ++void foo (int size); ++ +int +main (void) +{ @@ -522,10 +524,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c +} + +#endif -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2014-06-16 23:30:30.109940484 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp 2016-02-15 23:35:56.290999853 +0100 @@ -0,0 +1,64 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -552,8 +554,8 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +set testfile x86_64-vla-typedef +set srcasmfile ${testfile}-foo.S +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set binobjfile ${objdir}/${subdir}/${testfile}-foo.o ++set binfile [standard_output_file ${testfile}] ++set binobjfile [standard_output_file ${testfile}-foo.o] +if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { + untested "Couldn't compile test program" + return -1 @@ -591,10 +593,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp +gdb_test "whatis array" "type = array_t" "second: whatis array" + +gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.c =================================================================== ---- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.base/arrayidx.c 2014-06-13 03:59:37.000000000 +0200 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.c 2014-06-16 23:30:30.109940484 +0200 +--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/arrayidx.c 2016-02-15 23:33:29.830959972 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.c 2016-02-15 23:35:56.290999853 +0100 @@ -17,6 +17,13 @@ int array[] = {1, 2, 3, 4}; @@ -609,11 +611,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.c int main (void) { -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.exp =================================================================== ---- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.base/arrayidx.exp 2014-06-13 03:59:37.000000000 +0200 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.exp 2014-06-16 23:30:30.109940484 +0200 -@@ -49,4 +49,12 @@ gdb_test "print array" \ +--- gdb-7.10.90.20160211.orig/gdb/testsuite/gdb.base/arrayidx.exp 2016-02-15 23:33:29.830959972 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/arrayidx.exp 2016-02-15 23:35:56.291999860 +0100 +@@ -49,4 +49,12 @@ "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ "Print array with array-indexes on" @@ -627,10 +629,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/arrayidx.exp + unsupported "$test (no GCC)" + } +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.c 2014-06-16 23:30:30.109940484 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.c 2016-02-15 23:35:56.291999860 +0100 @@ -0,0 +1,20 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -652,10 +654,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.c +struct { + int field; +} staticstruct = { 1 }; -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.exp 2014-06-16 23:30:30.109940484 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/internal-var-field-address.exp 2016-02-15 23:35:56.291999860 +0100 @@ -0,0 +1,26 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -683,10 +685,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/internal-var-field-address.exp + +gdb_test {set $varstruct = staticstruct} +gdb_test {p $varstruct.field} " = 1" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.c 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.c 2016-02-15 23:35:56.291999860 +0100 @@ -0,0 +1,31 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -719,10 +721,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.c + f (s); + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.exp 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-frame.exp 2016-02-15 23:35:56.291999860 +0100 @@ -0,0 +1,38 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -762,10 +764,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-frame.exp +} + +gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.c 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.c 2016-02-15 23:35:56.291999860 +0100 @@ -0,0 +1,30 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -797,10 +799,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.c + + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla-overflow.exp 2016-02-15 23:35:56.292999867 +0100 @@ -0,0 +1,109 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -832,9 +834,9 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp +# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273 + +set testfile vla-overflow -+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh ++set shfile [standard_output_file ${testfile}-gdb.sh] +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + untested "Couldn't compile test program" + return -1 @@ -911,10 +913,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla-overflow.exp +gdb_test "bt" "in \[^ \]*abort \\(.* in main \\(.*" "Backtrace after abort()" + +verbose -log "kb_found in bt after abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.c 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.c 2016-02-15 23:35:56.292999867 +0100 @@ -0,0 +1,55 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -971,10 +973,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.c + foo (78); + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp 2014-06-16 23:30:30.110940485 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.base/vla.exp 2016-02-15 23:35:56.292999867 +0100 @@ -0,0 +1,62 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -993,7 +995,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp + +set testfile vla +set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { + untested "Couldn't compile test program" + return -1 @@ -1038,10 +1040,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/vla.exp +gdb_test "p temp1" " = '1' " "second: print temp1" +gdb_test "p temp2" " = '2' " "second: print temp2" +gdb_test "p temp3" " = '3' " "second: print temp3" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2014-06-16 23:30:30.111940487 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S 2016-02-15 23:35:56.292999867 +0100 @@ -0,0 +1,246 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1289,11 +1291,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S + .string "char" +.Luint_str: + .string "unsigned int" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2014-06-16 23:30:30.111940487 +0200 -@@ -0,0 +1,63 @@ ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp 2016-02-15 23:35:56.292999867 +0100 +@@ -0,0 +1,66 @@ +# Copyright 2010 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1332,17 +1334,20 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + +# Verify it behaves at least as an unbound array without inferior. + -+set test "p a_string" -+gdb_test_multiple $test $test { -+ -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "No registers\\.\r\n$gdb_prompt $" { -+ kfail "vlaregression" $test -+ } -+} -+ -+gdb_test "ptype a_string" {type = char \[variable length\]} ++# FIXME: FSF GDB crashes due to !has_stack_frames (). ++# But in practice that should not happen. ++# https://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762 ++#set test "p a_string" ++#gdb_test_multiple $test $test { ++# -re " = 0x\[0-9a-f\]+ \"seennotseen\"\r\n$gdb_prompt $" { ++# pass $test ++# } ++# -re "No registers\\.\r\n$gdb_prompt $" { ++# kfail "vlaregression" $test ++# } ++#} ++# ++#gdb_test "ptype a_string" {type = char \[variable length\]} + +# Not runto_main as dw2-bound-loclist.S handles only the first byte of main. +if ![runto "*main"] { @@ -1357,10 +1362,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp + +# The register contains unpredictable value - the array size. +gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2014-06-16 23:30:30.111940487 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.c 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,42 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1404,10 +1409,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.c + func1 (1, 2); + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2014-06-16 23:30:30.111940487 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,79 @@ +# Copyright 2006 Free Software Foundation, Inc. + @@ -1488,10 +1493,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp +gdb_test "step" \ + "func.* \\(.*\\) at .*" \ + "step" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,83 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1576,10 +1581,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-locat + + .byte 0x0 /* Terminator */ + .byte 0x0 /* Terminator */ -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,37 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1618,10 +1623,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-locat +clean_restart $binfile + +gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,121 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -1744,10 +1749,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S + .byte 0x0 /* Terminator */ + + .byte 0x0 /* Terminator */ -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp 2016-02-15 23:35:56.293999874 +0100 @@ -0,0 +1,39 @@ +# Copyright 2012 Free Software Foundation, Inc. + @@ -1788,10 +1793,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp + +gdb_test "ptype notype_string" {type = char \[129\]} +gdb_test "p notype_string" " = 'x' " -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.exp 2016-02-15 23:35:56.294999881 +0100 @@ -0,0 +1,42 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -1835,10 +1840,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.exp +gdb_continue_to_breakpoint "break-here" ".*break-here.*" +gdb_test "p c40pt(1)" " = '0-hello.*" +gdb_test "p c40pt(2)" " = '1-hello.*" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90 +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2014-06-16 23:30:30.112940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dwarf-stride.f90 2016-02-15 23:35:56.294999881 +0100 @@ -0,0 +1,40 @@ +! Copyright 2009 Free Software Foundation, Inc. +! @@ -1880,10 +1885,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90 + print *, c40pt ! break-here + +end program repro -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp 2014-06-16 23:37:45.568362563 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.exp 2016-02-15 23:36:39.358305635 +0100 @@ -0,0 +1,151 @@ +# Copyright 2007 Free Software Foundation, Inc. + @@ -1910,7 +1915,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp + +set testfile "dynamic" +set srcfile ${testfile}.f90 -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { + untested "Couldn't compile ${srcfile}" @@ -1931,9 +1936,9 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_continue_to_breakpoint "varx-init" +gdb_test "p varx" "\\$\[0-9\]* = " "p varx unallocated" +gdb_test "ptype varx" "type = " "ptype varx unallocated" -+gdb_test "p varx(1,5,17)" "no such vector element because not allocated" "p varx(1,5,17) unallocated" -+gdb_test "p varx(1,5,17)=1" "no such vector element because not allocated" "p varx(1,5,17)=1 unallocated" -+gdb_test "ptype varx(1,5,17)" "no such vector element because not allocated" "ptype varx(1,5,17) unallocated" ++gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) unallocated" ++gdb_test "p varx(1,5,17)=1" {no such vector element \(vector not allocated\)} "p varx(1,5,17)=1 unallocated" ++gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) unallocated" + +gdb_breakpoint [gdb_get_line_number "varx-allocated"] +gdb_continue_to_breakpoint "varx-allocated" @@ -1979,16 +1984,16 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p varv" "\\$\[0-9\]* = (|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated" +gdb_test "ptype varv" "type = (|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv deassociated" +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varv deassociated" -+gdb_test "p varv(1,5,17)" "no such vector element because not associated" -+gdb_test "ptype varv(1,5,17)" "no such vector element because not associated" ++gdb_test "p varv(1,5,17)" {no such vector element \(vector not associated\)} ++gdb_test "ptype varv(1,5,17)" {no such vector element \(vector not associated\)} + +gdb_breakpoint [gdb_get_line_number "varx-deallocated"] +gdb_continue_to_breakpoint "varx-deallocated" +gdb_test "p varx" "\\$\[0-9\]* = " "p varx deallocated" +gdb_test "ptype varx" "type = " "ptype varx deallocated" +gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated" -+gdb_test "p varx(1,5,17)" "no such vector element because not allocated" "p varx(1,5,17) deallocated" -+gdb_test "ptype varx(1,5,17)" "no such vector element because not allocated" "ptype varx(1,5,17) deallocated" ++gdb_test "p varx(1,5,17)" {no such vector element \(vector not allocated\)} "p varx(1,5,17) deallocated" ++gdb_test "ptype varx(1,5,17)" {no such vector element \(vector not allocated\)} "ptype varx(1,5,17) deallocated" + +gdb_breakpoint [gdb_get_line_number "vary-passed"] +gdb_continue_to_breakpoint "vary-passed" @@ -2036,10 +2041,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp +gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" +# maps to foo::vary(1,3) +gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.f90 +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.f90 2014-06-16 23:30:30.113940488 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/dynamic.f90 2016-02-15 23:35:56.294999881 +0100 @@ -0,0 +1,98 @@ +! Copyright 2007 Free Software Foundation, Inc. +! @@ -2139,10 +2144,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.f90 + if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort + if (x (3, 1) .ne. 10) call abort +end -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.exp 2016-02-15 23:36:39.359305642 +0100 @@ -0,0 +1,59 @@ +# Copyright 2008 Free Software Foundation, Inc. + @@ -2167,7 +2172,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp + +set testfile "string" +set srcfile ${testfile}.f90 -+set binfile ${objdir}/${subdir}/${testfile} ++set binfile [standard_output_file ${testfile}] + +if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { + untested "Couldn't compile ${srcfile}" @@ -2203,10 +2208,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.exp +gdb_continue_to_breakpoint "var-finish" +gdb_test "p e" "\\$\[0-9\]* = 'e '" "p e re-set" +gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f2 ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\( 'f ', 'f ', 'f ', 'f ', 'f ', 'f ', 'f '\\) \\)" "p *f re-set" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.f90 +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.f90 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/string.f90 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,37 @@ +! Copyright 2008 Free Software Foundation, Inc. +! @@ -2245,10 +2250,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/string.f90 + h = 'h' + call foo (g, h) +end -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.exp 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.exp 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,72 @@ +# Copyright 2011 Free Software Foundation, Inc. + @@ -2322,10 +2327,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.exp +gdb_unload +setup_kfail "*-*-*" "vlaregression/9999" +gdb_test {p $a (3, 2:2)} { = \(23\)} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.f90 +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.f90 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.fortran/subrange.f90 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,28 @@ +! Copyright 2011 Free Software Foundation, Inc. +! @@ -2355,10 +2360,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/subrange.f90 + ptr => a + write (*,*) a ! break-static +end -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.c 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,26 @@ +/* Copyright 2011 Free Software Foundation, Inc. + @@ -2386,10 +2391,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.c + + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2014-06-16 23:30:30.114940489 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,57 @@ +# Copyright 2011 Free Software Foundation, Inc. +# @@ -2448,10 +2453,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp +mi_create_varobj "vla" "vla" "create local variable vla" + +mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register-func.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register-func.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register-func.c 2014-06-16 23:30:30.115940490 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register-func.c 2016-02-15 23:35:56.295999888 +0100 @@ -0,0 +1,22 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2475,10 +2480,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register-func.c +{ + return arr[0]; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.c +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.c 2014-06-16 23:30:30.115940490 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.c 2016-02-15 23:35:56.296999895 +0100 @@ -0,0 +1,28 @@ +/* This file is part of GDB, the GNU debugger. + @@ -2508,10 +2513,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.c + + return 0; +} -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.exp 2014-06-16 23:30:30.115940490 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.opt/array-from-register.exp 2016-02-15 23:35:56.296999895 +0100 @@ -0,0 +1,33 @@ +# Copyright 2009 Free Software Foundation, Inc. +# @@ -2546,10 +2551,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.opt/array-from-register.exp +# Seen regression: +# Address requested for identifier "arr" which is in register $rdi +gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp 2014-06-16 23:30:30.115940490 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.exp 2016-02-15 23:36:39.359305642 +0100 @@ -0,0 +1,104 @@ +# Copyright 2008, 2009 Free Software Foundation, Inc. +# @@ -2574,7 +2579,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp + +set testfile "arrays" +set srcfile ${testfile}.pas -+set binfile ${objdir}/${subdir}/${testfile}$EXEEXT ++set binfile [standard_output_file ${testfile}$EXEEXT] + +# These tests only work with fpc, using the -gw3 compile-option +pascal_init @@ -2655,10 +2660,10 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.exp +} +gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" + -Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.pas +Index: gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.pas =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.pas 2014-06-16 23:30:30.115940490 +0200 ++++ gdb-7.10.90.20160211/gdb/testsuite/gdb.pascal/arrays.pas 2016-02-15 23:35:56.296999895 +0100 @@ -0,0 +1,82 @@ +{ + Copyright 2008, 2009 Free Software Foundation, Inc. @@ -2742,11 +2747,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.pascal/arrays.pas + s := 'test'#0'string'; + writeln(s); { set breakpoint 2 here } +end. -Index: gdb-7.7.90.20140613/gdb/testsuite/lib/gdb.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.7.90.20140613.orig/gdb/testsuite/lib/gdb.exp 2014-06-16 23:30:29.278939700 +0200 -+++ gdb-7.7.90.20140613/gdb/testsuite/lib/gdb.exp 2014-06-16 23:30:30.117940492 +0200 -@@ -159,6 +159,11 @@ proc gdb_unload {} { +--- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/gdb.exp 2016-02-15 23:35:55.326993008 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/lib/gdb.exp 2016-02-15 23:35:56.297999903 +0100 +@@ -173,6 +173,11 @@ send_gdb "y\n" exp_continue } @@ -2758,11 +2763,11 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/lib/gdb.exp -re "Discard symbol table from .*y or n.*$" { send_gdb "y\n" exp_continue -Index: gdb-7.7.90.20140613/gdb/testsuite/lib/pascal.exp +Index: gdb-7.10.90.20160211/gdb/testsuite/lib/pascal.exp =================================================================== ---- gdb-7.7.90.20140613.orig/gdb/testsuite/lib/pascal.exp 2014-06-13 03:59:37.000000000 +0200 -+++ gdb-7.7.90.20140613/gdb/testsuite/lib/pascal.exp 2014-06-16 23:30:30.117940492 +0200 -@@ -37,6 +37,9 @@ proc pascal_init {} { +--- gdb-7.10.90.20160211.orig/gdb/testsuite/lib/pascal.exp 2016-02-15 23:33:29.830959972 +0100 ++++ gdb-7.10.90.20160211/gdb/testsuite/lib/pascal.exp 2016-02-15 23:35:56.298999910 +0100 +@@ -37,6 +37,9 @@ global pascal_compiler_is_fpc global gpc_compiler global fpc_compiler @@ -2772,7 +2777,7 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/lib/pascal.exp global env if { $pascal_init_done == 1 } { -@@ -64,6 +67,20 @@ proc pascal_init {} { +@@ -64,6 +67,20 @@ set pascal_compiler_is_fpc 1 verbose -log "Free Pascal compiler found" } diff --git a/gdb-readline.patch b/gdb-readline.patch index fc53c7c..42a1e76 100644 --- a/gdb-readline.patch +++ b/gdb-readline.patch @@ -17,10 +17,10 @@ # Where is expat? This will be empty if expat was not available. LIBEXPAT = @LIBEXPAT@ -@@ -416,7 +416,7 @@ - $(XM_CLIBS) $(NAT_CLIBS) $(GDBTKLIBS) @LIBS@ \ - $(LIBICONV) $(LIBEXPAT) \ - $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) +@@ -598,7 +598,7 @@ CLIBS = $(SIM) $(READLINE) $(OPCODES) $( + @LIBS@ @GUILE_LIBS@ @PYTHON_LIBS@ \ + $(LIBEXPAT) $(LIBLZMA) $(LIBBABELTRACE) $(LIBIPT) \ + $(LIBIBERTY) $(WIN32LIBS) $(LIBGNU) $(LIBICONV) -CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) $(READLINE_DEPS) \ +CDEPS = $(XM_CDEPS) $(NAT_CDEPS) $(SIM) $(BFD) \ $(OPCODES) $(INTL_DEPS) $(LIBIBERTY) $(CONFIG_DEPS) $(LIBGNU) diff --git a/gdb-vla-intel-04of23-fix.patch b/gdb-vla-intel-04of23-fix.patch index ad239b5..3b8d77a 100644 --- a/gdb-vla-intel-04of23-fix.patch +++ b/gdb-vla-intel-04of23-fix.patch @@ -1,38 +1,38 @@ Re: [PATCH 04/23] vla: make dynamic fortran arrays functional. https://sourceware.org/ml/gdb-patches/2014-06/msg00570.html -Index: gdb-7.7.90.20140627/gdb/valarith.c +Index: gdb-7.10.50.20151027/gdb/valarith.c =================================================================== ---- gdb-7.7.90.20140627.orig/gdb/valarith.c 2014-07-07 20:44:03.136394525 +0200 -+++ gdb-7.7.90.20140627/gdb/valarith.c 2014-07-07 20:45:41.588536459 +0200 -@@ -195,10 +195,17 @@ value_subscripted_rvalue (struct value * +--- gdb-7.10.50.20151027.orig/gdb/valarith.c 2015-11-03 20:41:48.543504999 +0100 ++++ gdb-7.10.50.20151027/gdb/valarith.c 2015-11-03 20:46:36.995238888 +0100 +@@ -193,10 +193,17 @@ value_subscripted_rvalue (struct value * struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - unsigned int elt_size = TYPE_LENGTH (elt_type); + unsigned int elt_size = type_length_units (elt_type); - unsigned int elt_offs = longest_to_int (index - lowerbound); + unsigned int elt_offs; LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)); struct value *v; + if (TYPE_NOT_ASSOCIATED (array_type)) -+ error (_("no such vector element because not associated")); ++ error (_("no such vector element (vector not associated)")); + if (TYPE_NOT_ALLOCATED (array_type)) -+ error (_("no such vector element because not allocated")); ++ error (_("no such vector element (vector not allocated)")); + + elt_offs = longest_to_int (index - lowerbound); + if (elt_stride > 0) elt_offs *= elt_stride; else if (elt_stride < 0) -@@ -212,14 +219,7 @@ value_subscripted_rvalue (struct value * +@@ -210,14 +217,7 @@ value_subscripted_rvalue (struct value * if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) - && elt_offs >= TYPE_LENGTH (array_type))) + && elt_offs >= type_length_units (array_type))) - { -- if (TYPE_NOT_ASSOCIATED (array_type)) -- error (_("no such vector element because not associated")); -- else if (TYPE_NOT_ALLOCATED (array_type)) -- error (_("no such vector element because not allocated")); +- if (type_not_associated (array_type)) +- error (_("no such vector element (vector not associated)")); +- else if (type_not_allocated (array_type)) +- error (_("no such vector element (vector not allocated)")); - else - error (_("no such vector element")); - } diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch index 56ceff2..f6197f2 100644 --- a/gdb-vla-intel-stringbt-fix.patch +++ b/gdb-vla-intel-stringbt-fix.patch @@ -165,17 +165,3 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 + end interface + call foo ('hello') +end -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp -=================================================================== ---- gdb-7.9.50.20150520.orig/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-31 16:14:04.167533854 +0200 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-31 16:14:31.073718201 +0200 -@@ -33,9 +33,6 @@ gdb_continue_to_breakpoint "var_char-all - gdb_test "print var_char" \ - " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \ - "print var_char after allocated first time" --gdb_test "print *var_char" \ -- " = '\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000'" \ -- "print *var_char after allocated first time" - gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \ - "whatis var_char first time" - gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \ diff --git a/gdb-vla-intel.patch b/gdb-vla-intel.patch index 85c0364..edf6b23 100644 --- a/gdb-vla-intel.patch +++ b/gdb-vla-intel.patch @@ -6,11 +6,11 @@ GIT snapshot: commit 511bff520372ffc10fa2ff569c176bdf1e6e475d -Index: gdb-7.9.50.20150520/gdb/c-valprint.c +Index: gdb-7.10.50.20160106/gdb/c-valprint.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/c-valprint.c 2015-05-29 08:27:02.657717326 +0200 -+++ gdb-7.9.50.20150520/gdb/c-valprint.c 2015-05-29 08:27:06.253740209 +0200 -@@ -537,7 +537,16 @@ c_value_print (struct value *val, struct +--- gdb-7.10.50.20160106.orig/gdb/c-valprint.c 2016-01-08 19:15:35.065582359 +0100 ++++ gdb-7.10.50.20160106/gdb/c-valprint.c 2016-01-08 19:15:44.974637630 +0100 +@@ -642,7 +642,16 @@ { /* normal case */ fprintf_filtered (stream, "("); @@ -28,11 +28,11 @@ Index: gdb-7.9.50.20150520/gdb/c-valprint.c fprintf_filtered (stream, ") "); } } -Index: gdb-7.9.50.20150520/gdb/dwarf2loc.h +Index: gdb-7.10.50.20160106/gdb/dwarf2loc.h =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/dwarf2loc.h 2015-05-29 08:27:02.658717333 +0200 -+++ gdb-7.9.50.20150520/gdb/dwarf2loc.h 2015-05-29 08:27:06.253740209 +0200 -@@ -131,6 +131,11 @@ int dwarf2_evaluate_property (const stru +--- gdb-7.10.50.20160106.orig/gdb/dwarf2loc.h 2016-01-08 19:15:35.066582365 +0100 ++++ gdb-7.10.50.20160106/gdb/dwarf2loc.h 2016-01-08 19:15:44.974637630 +0100 +@@ -138,6 +138,11 @@ struct property_addr_info *addr_stack, CORE_ADDR *value); @@ -44,24 +44,31 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2loc.h /* A helper for the compiler interface that compiles a single dynamic property to C code. -Index: gdb-7.9.50.20150520/gdb/dwarf2read.c +Index: gdb-7.10.50.20160106/gdb/dwarf2read.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/dwarf2read.c 2015-05-29 08:27:02.676717447 +0200 -+++ gdb-7.9.50.20150520/gdb/dwarf2read.c 2015-05-29 10:04:52.272600212 +0200 -@@ -1868,6 +1868,12 @@ static void process_cu_includes (void); - static void check_producer (struct dwarf2_cu *cu); +--- gdb-7.10.50.20160106.orig/gdb/dwarf2read.c 2016-01-08 19:15:35.078582432 +0100 ++++ gdb-7.10.50.20160106/gdb/dwarf2read.c 2016-01-08 19:15:44.980637663 +0100 +@@ -1745,7 +1745,9 @@ - static void free_line_header_voidp (void *arg); -+ -+static int -+attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, -+ struct dwarf2_cu *cu, struct dynamic_prop *prop, -+ const gdb_byte *additional_data, int additional_data_size); -+ - - /* Various complaints about symbol reading that don't abort the process. */ + static int attr_to_dynamic_prop (const struct attribute *attr, + struct die_info *die, struct dwarf2_cu *cu, +- struct dynamic_prop *prop); ++ struct dynamic_prop *prop, ++ const gdb_byte *additional_data, ++ int additional_data_size); + + /* memory allocation interface */ + +@@ -11420,7 +11422,7 @@ + { + newobj->static_link + = XOBNEW (&objfile->objfile_obstack, struct dynamic_prop); +- attr_to_dynamic_prop (attr, die, cu, newobj->static_link); ++ attr_to_dynamic_prop (attr, die, cu, newobj->static_link, NULL, 0); + } -@@ -14431,29 +14437,92 @@ read_tag_string_type (struct die_info *d + cu->list_in_scope = &local_symbols; +@@ -14471,29 +14473,92 @@ struct gdbarch *gdbarch = get_objfile_arch (objfile); struct type *type, *range_type, *index_type, *char_type; struct attribute *attr; @@ -161,7 +168,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c char_type = language_string_char_type (cu->language_defn, gdbarch); type = create_string_type (NULL, char_type, range_type); -@@ -14776,13 +14845,15 @@ read_base_type (struct die_info *die, st +@@ -14816,13 +14881,15 @@ return set_die_type (die, type, cu); } @@ -178,8 +185,8 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c { struct dwarf2_property_baton *baton; struct obstack *obstack = &cu->objfile->objfile_obstack; -@@ -14795,8 +14866,25 @@ attr_to_dynamic_prop (const struct attri - baton = obstack_alloc (obstack, sizeof (*baton)); +@@ -14835,8 +14902,25 @@ + baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = NULL; baton->locexpr.per_cu = cu->per_cu; - baton->locexpr.size = DW_BLOCK (attr)->size; @@ -206,8 +213,8 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -14832,8 +14920,28 @@ attr_to_dynamic_prop (const struct attri - baton = obstack_alloc (obstack, sizeof (*baton)); +@@ -14872,8 +14956,28 @@ + baton = XOBNEW (obstack, struct dwarf2_property_baton); baton->referenced_type = die_type (target_die, target_cu); baton->locexpr.per_cu = cu->per_cu; - baton->locexpr.size = DW_BLOCK (target_attr)->size; @@ -237,7 +244,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c prop->data.baton = baton; prop->kind = PROP_LOCEXPR; gdb_assert (prop->data.baton != NULL); -@@ -14887,7 +14995,7 @@ read_subrange_type (struct die_info *die +@@ -14927,7 +15031,7 @@ struct type *base_type, *orig_base_type; struct type *range_type; struct attribute *attr; @@ -246,7 +253,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c int low_default_is_valid; int high_bound_is_count = 0; const char *name; -@@ -14907,7 +15015,9 @@ read_subrange_type (struct die_info *die +@@ -14947,7 +15051,9 @@ low.kind = PROP_CONST; high.kind = PROP_CONST; @@ -256,7 +263,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow omitting DW_AT_lower_bound. */ -@@ -14940,19 +15050,26 @@ read_subrange_type (struct die_info *die +@@ -14980,19 +15086,26 @@ break; } @@ -286,7 +293,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c { /* If bounds are constant do the final calculation here. */ if (low.kind == PROP_CONST && high.kind == PROP_CONST) -@@ -15016,7 +15133,7 @@ read_subrange_type (struct die_info *die +@@ -15056,7 +15169,7 @@ && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) high.data.const_val |= negative_mask; @@ -295,38 +302,26 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c if (high_bound_is_count) TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1; -@@ -22128,9 +22245,37 @@ set_die_type (struct die_info *die, stru - && !HAVE_GNAT_AUX_INFO (type)) - INIT_GNAT_SPECIFIC (type); - -+ /* Read DW_AT_allocated and set in type. */ -+ attr = dwarf2_attr (die, DW_AT_allocated, cu); -+ if (attr_form_is_block (attr)) -+ { -+ struct dynamic_prop prop; -+ +@@ -22360,7 +22473,7 @@ + attr = dwarf2_attr (die, DW_AT_allocated, cu); + if (attr_form_is_block (attr)) + { +- if (attr_to_dynamic_prop (attr, die, cu, &prop)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) -+ { -+ TYPE_ALLOCATED_PROP (type) -+ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop)); -+ *TYPE_ALLOCATED_PROP (type) = prop; -+ } -+ } -+ -+ /* Read DW_AT_associated and set in type. */ -+ attr = dwarf2_attr (die, DW_AT_associated, cu); -+ if (attr_form_is_block (attr)) -+ { -+ struct dynamic_prop prop; -+ + add_dyn_prop (DYN_PROP_ALLOCATED, prop, type, objfile); + } + else if (attr != NULL) +@@ -22375,7 +22488,7 @@ + attr = dwarf2_attr (die, DW_AT_associated, cu); + if (attr_form_is_block (attr)) + { +- if (attr_to_dynamic_prop (attr, die, cu, &prop)) + if (attr_to_dynamic_prop (attr, die, cu, &prop, NULL, 0)) -+ { -+ TYPE_ASSOCIATED_PROP (type) -+ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop)); -+ *TYPE_ASSOCIATED_PROP (type) = prop; -+ } -+ } -+ + add_dyn_prop (DYN_PROP_ASSOCIATED, prop, type, objfile); + } + else if (attr != NULL) +@@ -22388,7 +22501,7 @@ + /* Read DW_AT_data_location and set in type. */ attr = dwarf2_attr (die, DW_AT_data_location, cu); - if (attr_to_dynamic_prop (attr, die, cu, &prop)) @@ -334,22 +329,24 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2read.c add_dyn_prop (DYN_PROP_DATA_LOCATION, prop, type, objfile); if (dwarf2_per_objfile->die_type_hash == NULL) -Index: gdb-7.9.50.20150520/gdb/f-typeprint.c +Index: gdb-7.10.50.20160106/gdb/f-typeprint.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/f-typeprint.c 2015-05-29 08:27:02.678717460 +0200 -+++ gdb-7.9.50.20150520/gdb/f-typeprint.c 2015-05-29 08:27:06.261740260 +0200 -@@ -30,6 +30,7 @@ - #include "gdbcore.h" +--- gdb-7.10.50.20160106.orig/gdb/f-typeprint.c 2016-01-08 19:15:35.080582443 +0100 ++++ gdb-7.10.50.20160106/gdb/f-typeprint.c 2016-01-08 19:15:44.980637663 +0100 +@@ -31,6 +31,7 @@ #include "target.h" #include "f-lang.h" + #include "typeprint.h" +#include "valprint.h" #if 0 /* Currently unused. */ static void f_type_print_args (struct type *, struct ui_file *); -@@ -53,6 +54,17 @@ f_print_type (struct type *type, const c - enum type_code code; - int demangled_args; - +@@ -64,6 +65,17 @@ + { + val_print_not_allocated (stream); + return; ++ } ++ + if (TYPE_NOT_ASSOCIATED (type)) + { + val_print_not_associated (stream); @@ -359,73 +356,13 @@ Index: gdb-7.9.50.20150520/gdb/f-typeprint.c + { + val_print_not_allocated (stream); + return; -+ } -+ + } + f_type_print_base (type, stream, show, level); - code = TYPE_CODE (type); - if ((varstring != NULL && *varstring != '\0') -@@ -167,28 +179,36 @@ f_type_print_varspec_suffix (struct type - if (arrayprint_recurse_level == 1) - fprintf_filtered (stream, "("); - -- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -- arrayprint_recurse_level); -- -- lower_bound = f77_get_lowerbound (type); -- if (lower_bound != 1) /* Not the default. */ -- fprintf_filtered (stream, "%d:", lower_bound); -- -- /* Make sure that, if we have an assumed size array, we -- print out a warning and print the upperbound as '*'. */ -- -- if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) -- fprintf_filtered (stream, "*"); -+ if (TYPE_NOT_ASSOCIATED (type)) -+ val_print_not_associated (stream); -+ else if (TYPE_NOT_ALLOCATED (type)) -+ val_print_not_allocated (stream); - else -- { -- upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "%d", upper_bound); -- } -- -- if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -- f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -- arrayprint_recurse_level); -+ { -+ -+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_ARRAY) -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -+ arrayprint_recurse_level); -+ -+ lower_bound = f77_get_lowerbound (type); -+ if (lower_bound != 1) /* Not the default. */ -+ fprintf_filtered (stream, "%d:", lower_bound); -+ -+ /* Make sure that, if we have an assumed size array, we -+ print out a warning and print the upperbound as '*'. */ -+ -+ if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) -+ fprintf_filtered (stream, "*"); -+ else -+ { -+ upper_bound = f77_get_upperbound (type); -+ fprintf_filtered (stream, "%d", upper_bound); -+ } -+ -+ if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -+ f_type_print_varspec_suffix (TYPE_TARGET_TYPE (type), stream, 0, 0, 0, -+ arrayprint_recurse_level); -+ } - if (arrayprint_recurse_level == 1) - fprintf_filtered (stream, ")"); - else -Index: gdb-7.9.50.20150520/gdb/f-valprint.c +Index: gdb-7.10.50.20160106/gdb/f-valprint.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/f-valprint.c 2015-05-29 08:26:49.567634019 +0200 -+++ gdb-7.9.50.20150520/gdb/f-valprint.c 2015-05-29 08:27:06.262740266 +0200 +--- gdb-7.10.50.20160106.orig/gdb/f-valprint.c 2016-01-08 19:15:35.081582448 +0100 ++++ gdb-7.10.50.20160106/gdb/f-valprint.c 2016-01-08 19:15:44.981637669 +0100 @@ -36,8 +36,6 @@ extern void _initialize_f_valprint (void); @@ -435,7 +372,7 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c static void f77_get_dynamic_length_of_aggregate (struct type *); int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; -@@ -45,15 +43,6 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIM +@@ -45,15 +43,6 @@ /* Array which holds offsets to be applied to get a row's elements for a given array. Array also holds the size of each subarray. */ @@ -451,7 +388,7 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c int f77_get_lowerbound (struct type *type) { -@@ -111,47 +100,6 @@ f77_get_dynamic_length_of_aggregate (str +@@ -111,47 +100,6 @@ * TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type))); } @@ -499,7 +436,7 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c /* Actual function which prints out F77 arrays, Valaddr == address in the superior. Address == the address in the inferior. */ -@@ -164,41 +112,62 @@ f77_print_array_1 (int nss, int ndimensi +@@ -164,41 +112,62 @@ const struct value_print_options *options, int *elts) { @@ -578,7 +515,7 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c fprintf_filtered (stream, "..."); } } -@@ -225,12 +194,6 @@ f77_print_array (struct type *type, cons +@@ -225,12 +194,6 @@ Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"), ndimensions, MAX_FORTRAN_DIMS); @@ -591,7 +528,7 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c f77_print_array_1 (1, ndimensions, type, valaddr, embedded_offset, address, stream, recurse, val, options, &elts); } -@@ -375,12 +338,15 @@ f_val_print (struct type *type, const gd +@@ -375,12 +338,15 @@ fprintf_filtered (stream, "( "); for (index = 0; index < TYPE_NFIELDS (type); index++) { @@ -612,11 +549,11 @@ Index: gdb-7.9.50.20150520/gdb/f-valprint.c if (index != TYPE_NFIELDS (type) - 1) fputs_filtered (", ", stream); } -Index: gdb-7.9.50.20150520/gdb/gdbtypes.c +Index: gdb-7.10.50.20160106/gdb/gdbtypes.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/gdbtypes.c 2015-05-29 08:27:02.683717492 +0200 -+++ gdb-7.9.50.20150520/gdb/gdbtypes.c 2015-05-29 10:54:36.236498749 +0200 -@@ -824,7 +824,8 @@ allocate_stub_method (struct type *type) +--- gdb-7.10.50.20160106.orig/gdb/gdbtypes.c 2016-01-08 19:15:35.083582459 +0100 ++++ gdb-7.10.50.20160106/gdb/gdbtypes.c 2016-01-08 19:15:44.982637674 +0100 +@@ -836,7 +836,8 @@ struct type * create_range_type (struct type *result_type, struct type *index_type, const struct dynamic_prop *low_bound, @@ -626,7 +563,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c { if (result_type == NULL) result_type = alloc_type_copy (index_type); -@@ -839,6 +840,7 @@ create_range_type (struct type *result_t +@@ -851,6 +852,7 @@ TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); TYPE_RANGE_DATA (result_type)->low = *low_bound; TYPE_RANGE_DATA (result_type)->high = *high_bound; @@ -634,7 +571,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) TYPE_UNSIGNED (result_type) = 1; -@@ -867,7 +869,7 @@ struct type * +@@ -879,7 +881,7 @@ create_static_range_type (struct type *result_type, struct type *index_type, LONGEST low_bound, LONGEST high_bound) { @@ -643,7 +580,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c low.kind = PROP_CONST; low.data.const_val = low_bound; -@@ -875,7 +877,11 @@ create_static_range_type (struct type *r +@@ -887,7 +889,11 @@ high.kind = PROP_CONST; high.data.const_val = high_bound; @@ -656,20 +593,16 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c return result_type; } -@@ -1068,18 +1074,24 @@ create_array_type_with_stride (struct ty - - TYPE_CODE (result_type) = TYPE_CODE_ARRAY; - TYPE_TARGET_TYPE (result_type) = element_type; -- if (has_static_range (TYPE_RANGE_DATA (range_type))) -+ if (has_static_range (TYPE_RANGE_DATA (range_type)) -+ && dwarf2_address_data_valid (result_type)) +@@ -1084,16 +1090,21 @@ + && (!type_not_associated (result_type) + && !type_not_allocated (result_type))) { - LONGEST low_bound, high_bound; + LONGEST low_bound, high_bound, byte_stride; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) low_bound = high_bound = 0; - CHECK_TYPEDEF (element_type); + element_type = check_typedef (element_type); + + byte_stride = abs (TYPE_BYTE_STRIDE (range_type)); + @@ -683,7 +616,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c else if (bit_stride > 0) TYPE_LENGTH (result_type) = (bit_stride * (high_bound - low_bound + 1) + 7) / 8; -@@ -1789,12 +1801,31 @@ stub_noname_complaint (void) +@@ -1804,12 +1815,31 @@ static int is_dynamic_type_internal (struct type *type, int top_level) { @@ -715,7 +648,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c /* Types that have a dynamic TYPE_DATA_LOCATION are considered dynamic, even if the type itself is statically defined. From a user's point of view, this may appear counter-intuitive; -@@ -1823,11 +1854,19 @@ is_dynamic_type_internal (struct type *t +@@ -1844,11 +1874,19 @@ { gdb_assert (TYPE_NFIELDS (type) == 1); @@ -738,7 +671,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c } case TYPE_CODE_STRUCT: -@@ -1840,6 +1879,18 @@ is_dynamic_type_internal (struct type *t +@@ -1861,6 +1899,18 @@ && is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i), 0)) return 1; } @@ -757,7 +690,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c break; } -@@ -1869,7 +1920,8 @@ resolve_dynamic_range (struct type *dyn_ +@@ -1890,7 +1940,8 @@ struct type *static_range_type, *static_target_type; const struct dynamic_prop *prop; const struct dwarf2_locexpr_baton *baton; @@ -767,12 +700,12 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE); -@@ -1901,12 +1953,19 @@ resolve_dynamic_range (struct type *dyn_ +@@ -1922,12 +1973,19 @@ high_bound.data.const_val = 0; } + prop = &TYPE_RANGE_DATA (dyn_range_type)->stride; -+ if (dwarf2_evaluate_property (prop, addr_stack, &value)) ++ if (dwarf2_evaluate_property (prop, NULL, addr_stack, &value)) + { + stride.kind = PROP_CONST; + stride.data.const_val = value; @@ -790,137 +723,43 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.c TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1; return static_range_type; } -@@ -1923,23 +1982,47 @@ resolve_dynamic_array (struct type *type - struct type *elt_type; - struct type *range_type; +@@ -1946,7 +2004,8 @@ struct type *ary_dim; -+ struct dynamic_prop *prop; -+ struct type *copy = copy_type (type); + struct dynamic_prop *prop; - gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY); + gdb_assert (TYPE_CODE (type) == TYPE_CODE_ARRAY + || TYPE_CODE (type) == TYPE_CODE_STRING); - elt_type = type; - range_type = check_typedef (TYPE_INDEX_TYPE (elt_type)); - range_type = resolve_dynamic_range (range_type, addr_stack); + type = copy_type (type); + +@@ -1971,13 +2030,18 @@ -+ prop = TYPE_ALLOCATED_PROP (type); -+ if (dwarf2_evaluate_property (prop, addr_stack, &value)) -+ { -+ TYPE_ALLOCATED_PROP (copy)->kind = PROP_CONST; -+ TYPE_ALLOCATED_PROP (copy)->data.const_val = value; -+ } -+ -+ prop = TYPE_ASSOCIATED_PROP (type); -+ if (dwarf2_evaluate_property (prop, addr_stack, &value)) -+ { -+ TYPE_ASSOCIATED_PROP (copy)->kind = PROP_CONST; -+ TYPE_ASSOCIATED_PROP (copy)->data.const_val = value; -+ } -+ ary_dim = check_typedef (TYPE_TARGET_TYPE (elt_type)); - if (ary_dim != NULL && TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY) -- elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (type), addr_stack); + if (ary_dim != NULL && (TYPE_CODE (ary_dim) == TYPE_CODE_ARRAY -+ || TYPE_CODE (ary_dim) == TYPE_CODE_STRING)) -+ elt_type = resolve_dynamic_array (TYPE_TARGET_TYPE (copy), addr_stack); ++ || TYPE_CODE (ary_dim) == TYPE_CODE_STRING)) + elt_type = resolve_dynamic_array (ary_dim, addr_stack); else elt_type = TYPE_TARGET_TYPE (type); -- return create_array_type_with_stride (copy_type (type), -- elt_type, range_type, -- TYPE_FIELD_BITSIZE (type, 0)); +- return create_array_type_with_stride (type, elt_type, range_type, +- TYPE_FIELD_BITSIZE (type, 0)); + if (TYPE_CODE (type) == TYPE_CODE_STRING + && TYPE_FIELD_BITSIZE (type, 0) == 0) -+ return create_string_type (copy, -+ elt_type, -+ range_type); ++ return create_string_type (type, elt_type, range_type); + else -+ return create_array_type_with_stride (copy, -+ elt_type, -+ range_type, TYPE_FIELD_BITSIZE (type, 0)); ++ return create_array_type_with_stride (type, elt_type, range_type, ++ TYPE_FIELD_BITSIZE (type, 0)); } /* Resolve dynamic bounds of members of the union TYPE to static -@@ -4453,6 +4536,20 @@ copy_type_recursive (struct objfile *obj - TYPE_DYN_PROP_LIST (type)); - - -+ /* Copy allocated information. */ -+ if (TYPE_ALLOCATED_PROP (type) != NULL) -+ { -+ TYPE_ALLOCATED_PROP (new_type) = xmalloc (sizeof (struct dynamic_prop)); -+ *TYPE_ALLOCATED_PROP (new_type) = *TYPE_ALLOCATED_PROP (type); -+ } -+ -+ /* Copy associated information. */ -+ if (TYPE_ASSOCIATED_PROP (type) != NULL) -+ { -+ TYPE_ASSOCIATED_PROP (new_type) = xmalloc (sizeof (struct dynamic_prop)); -+ *TYPE_ASSOCIATED_PROP (new_type) = *TYPE_ASSOCIATED_PROP (type); -+ } -+ - /* Copy pointers to other types. */ - if (TYPE_TARGET_TYPE (type)) - TYPE_TARGET_TYPE (new_type) = -@@ -4494,6 +4591,35 @@ copy_type_recursive (struct objfile *obj - gdb_assert_not_reached ("bad type_specific_kind"); - } - -+ if (TYPE_ALLOCATED_PROP (type)) -+ { -+ TYPE_ALLOCATED_PROP (new_type) -+ = OBSTACK_ZALLOC (&TYPE_OWNER (type).objfile->objfile_obstack, -+ struct dynamic_prop); -+ memcpy (TYPE_ALLOCATED_PROP (new_type), TYPE_ALLOCATED_PROP (type), -+ sizeof (struct dynamic_prop)); -+ } -+ -+ if (TYPE_ASSOCIATED_PROP (type)) -+ { -+ TYPE_ASSOCIATED_PROP (new_type) -+ = OBSTACK_ZALLOC (&TYPE_OWNER (type).objfile->objfile_obstack, -+ struct dynamic_prop); -+ memcpy (TYPE_ASSOCIATED_PROP (new_type), TYPE_ASSOCIATED_PROP (type), -+ sizeof (struct dynamic_prop)); -+ } -+ -+ if (TYPE_NFIELDS (type)) -+ { -+ int nfields = TYPE_NFIELDS (type); -+ -+ TYPE_FIELDS (new_type) -+ = OBSTACK_CALLOC (&TYPE_OWNER (type).objfile->objfile_obstack, -+ nfields, struct field); -+ memcpy (TYPE_FIELDS (new_type), TYPE_FIELDS (type), -+ nfields * sizeof (struct field)); -+ } -+ - return new_type; - } - -@@ -4519,6 +4645,14 @@ copy_type (const struct type *type) - TYPE_DYN_PROP_LIST (new_type) - = copy_dynamic_prop_list (&TYPE_OBJFILE (type) -> objfile_obstack, - TYPE_DYN_PROP_LIST (type)); -+ if (TYPE_ALLOCATED_PROP (type) != NULL) -+ TYPE_ALLOCATED_PROP (new_type) = obstack_copy -+ (&TYPE_OBJFILE (type)->objfile_obstack, TYPE_ALLOCATED_PROP (type), -+ sizeof (*TYPE_ALLOCATED_PROP (type))); -+ if (TYPE_ASSOCIATED_PROP (type) != NULL) -+ TYPE_ASSOCIATED_PROP (new_type) = obstack_copy -+ (&TYPE_OBJFILE (type)->objfile_obstack, TYPE_ASSOCIATED_PROP (type), -+ sizeof (*TYPE_ASSOCIATED_PROP (type))); - - return new_type; - } -Index: gdb-7.9.50.20150520/gdb/gdbtypes.h +Index: gdb-7.10.50.20160106/gdb/gdbtypes.h =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/gdbtypes.h 2015-05-29 08:27:02.685717504 +0200 -+++ gdb-7.9.50.20150520/gdb/gdbtypes.h 2015-05-29 08:46:08.862924052 +0200 -@@ -569,6 +569,10 @@ struct range_bounds +--- gdb-7.10.50.20160106.orig/gdb/gdbtypes.h 2016-01-08 19:15:35.085582471 +0100 ++++ gdb-7.10.50.20160106/gdb/gdbtypes.h 2016-01-08 19:15:44.983637680 +0100 +@@ -577,6 +577,10 @@ struct dynamic_prop high; @@ -931,7 +770,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h /* True if HIGH range bound contains the number of elements in the subrange. This affects how the final hight bound is computed. */ -@@ -741,6 +745,18 @@ struct main_type +@@ -749,6 +753,18 @@ /* * Contains all dynamic type properties. */ struct dynamic_prop_list *dyn_prop_list; @@ -950,7 +789,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h }; /* * A ``struct type'' describes a particular instance of a type, with -@@ -1255,6 +1271,15 @@ extern void allocate_gnat_aux_type (stru +@@ -1255,6 +1271,15 @@ TYPE_RANGE_DATA(range_type)->high.kind #define TYPE_LOW_BOUND_KIND(range_type) \ TYPE_RANGE_DATA(range_type)->low.kind @@ -966,13 +805,10 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h /* Property accessors for the type data location. */ #define TYPE_DATA_LOCATION(thistype) \ -@@ -1265,6 +1290,20 @@ extern void allocate_gnat_aux_type (stru - TYPE_DATA_LOCATION (thistype)->data.const_val +@@ -1266,6 +1291,18 @@ #define TYPE_DATA_LOCATION_KIND(thistype) \ TYPE_DATA_LOCATION (thistype)->kind -+#define TYPE_ALLOCATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->allocated -+#define TYPE_ASSOCIATED_PROP(thistype) TYPE_MAIN_TYPE(thistype)->associated -+ + +/* Allocated status of type object. If set to non-zero it means the object + is allocated. A zero value means it is not allocated. */ +#define TYPE_NOT_ALLOCATED(t) (TYPE_ALLOCATED_PROP (t) \ @@ -984,10 +820,11 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h +#define TYPE_NOT_ASSOCIATED(t) (TYPE_ASSOCIATED_PROP (t) \ + && TYPE_ASSOCIATED_PROP (t)->kind == PROP_CONST \ + && !TYPE_ASSOCIATED_PROP (t)->data.const_val) - - /* Attribute accessors for dynamic properties. */ - #define TYPE_DYN_PROP_LIST(thistype) \ -@@ -1283,6 +1322,9 @@ extern void allocate_gnat_aux_type (stru ++ + /* Property accessors for the type allocated/associated. */ + #define TYPE_ALLOCATED_PROP(thistype) \ + get_dyn_prop (DYN_PROP_ALLOCATED, thistype) +@@ -1289,6 +1326,9 @@ TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) @@ -997,7 +834,7 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) -@@ -1764,6 +1806,7 @@ extern struct type *create_array_type_wi +@@ -1775,6 +1815,7 @@ extern struct type *create_range_type (struct type *, struct type *, const struct dynamic_prop *, @@ -1005,223 +842,10 @@ Index: gdb-7.9.50.20150520/gdb/gdbtypes.h const struct dynamic_prop *); extern struct type *create_array_type (struct type *, struct type *, -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp 2015-05-29 08:27:06.266740292 +0200 -@@ -0,0 +1,65 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# Check the association status of various types of VLA's -+# and pointer to VLA's. -+gdb_breakpoint [gdb_get_line_number "vla1-allocated"] -+gdb_continue_to_breakpoint "vla1-allocated" -+gdb_test "print l" " = \\.TRUE\\." \ -+ "print vla1 allocation status (allocated)" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "print l" " = \\.TRUE\\." \ -+ "print vla2 allocation status (allocated)" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-associated"] -+gdb_continue_to_breakpoint "pvla-associated" -+gdb_test "print l" " = \\.TRUE\\." \ -+ "print pvla associated status (associated)" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-re-associated"] -+gdb_continue_to_breakpoint "pvla-re-associated" -+gdb_test "print l" " = \\.TRUE\\." \ -+ "print pvla associated status (re-associated)" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] -+gdb_continue_to_breakpoint "pvla-deassociated" -+gdb_test "print l" " = \\.FALSE\\." \ -+ "print pvla allocation status (deassociated)" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-deallocated"] -+gdb_continue_to_breakpoint "vla1-deallocated" -+gdb_test "print l" " = \\.FALSE\\." \ -+ "print vla1 allocation status (deallocated)" -+gdb_test "print vla1" " = " \ -+ "print deallocated vla1" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-deallocated"] -+gdb_continue_to_breakpoint "vla2-deallocated" -+gdb_test "print l" " = \\.FALSE\\." "print vla2 deallocated" -+gdb_test "print vla2" " = " "print deallocated vla2" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.exp 2015-05-29 08:27:06.266740292 +0200 -@@ -0,0 +1,82 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile ".f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+# check that all fortran standard datatypes will be -+# handled correctly when using as VLA's -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "vlas-allocated"] -+gdb_continue_to_breakpoint "vlas-allocated" -+gdb_test "next" " = allocated\\\(realvla\\\)" \ -+ "next to allocation status of intvla" -+gdb_test "print l" " = \\.TRUE\\." "intvla allocated" -+gdb_test "next" " = allocated\\\(complexvla\\\)" \ -+ "next to allocation status of realvla" -+gdb_test "print l" " = \\.TRUE\\." "realvla allocated" -+gdb_test "next" " = allocated\\\(logicalvla\\\)" \ -+ "next to allocation status of complexvla" -+gdb_test "print l" " = \\.TRUE\\." "complexvla allocated" -+gdb_test "next" " = allocated\\\(charactervla\\\)" \ -+ "next to allocation status of logicalvla" -+gdb_test "print l" " = \\.TRUE\\." "logicalvla allocated" -+gdb_test "next" "intvla\\\(:,:,:\\\) = 1" \ -+ "next to allocation status of charactervla" -+gdb_test "print l" " = \\.TRUE\\." "charactervla allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vlas-initialized"] -+gdb_continue_to_breakpoint "vlas-initialized" -+gdb_test "ptype intvla" "type = integer\\\(kind=4\\\) \\\(11,22,33\\\)" \ -+ "ptype intvla" -+gdb_test "ptype realvla" "type = real\\\(kind=4\\\) \\\(11,22,33\\\)" \ -+ "ptype realvla" -+gdb_test "ptype complexvla" "type = complex\\\(kind=4\\\) \\\(11,22,33\\\)" \ -+ "ptype complexvla" -+gdb_test "ptype logicalvla" "type = logical\\\(kind=4\\\) \\\(11,22,33\\\)" \ -+ "ptype logicalvla" -+gdb_test "ptype charactervla" "type = character\\\*1 \\\(11,22,33\\\)" \ -+ "ptype charactervla" -+ -+gdb_test "print intvla(5,5,5)" " = 1" "print intvla(5,5,5) (1st)" -+gdb_test "print realvla(5,5,5)" " = 3.14\\d+" \ -+ "print realvla(5,5,5) (1st)" -+gdb_test "print complexvla(5,5,5)" " = \\\(2,-3\\\)" \ -+ "print complexvla(5,5,5) (1st)" -+gdb_test "print logicalvla(5,5,5)" " = \\.TRUE\\." \ -+ "print logicalvla(5,5,5) (1st)" -+gdb_test "print charactervla(5,5,5)" " = 'K'" \ -+ "print charactervla(5,5,5) (1st)" -+ -+gdb_breakpoint [gdb_get_line_number "vlas-modified"] -+gdb_continue_to_breakpoint "vlas-modified" -+gdb_test "print intvla(5,5,5)" " = 42" "print intvla(5,5,5) (2nd)" -+gdb_test "print realvla(5,5,5)" " = 4.13\\d+" \ -+ "print realvla(5,5,5) (2nd)" -+gdb_test "print complexvla(5,5,5)" " = \\\(-3,2\\\)" \ -+ "print complexvla(5,5,5) (2nd)" -+gdb_test "print logicalvla(5,5,5)" " = \\.FALSE\\." \ -+ "print logicalvla(5,5,5) (2nd)" -+gdb_test "print charactervla(5,5,5)" " = 'X'" \ -+ "print charactervla(5,5,5) (2nd)" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-datatypes.f90 2015-05-29 08:27:06.266740292 +0200 -@@ -0,0 +1,51 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 2 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program; if not, write to the Free Software -+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+program vla_primitives -+ integer, allocatable :: intvla(:, :, :) -+ real, allocatable :: realvla(:, :, :) -+ complex, allocatable :: complexvla(:, :, :) -+ logical, allocatable :: logicalvla(:, :, :) -+ character, allocatable :: charactervla(:, :, :) -+ logical :: l -+ -+ allocate (intvla (11,22,33)) -+ allocate (realvla (11,22,33)) -+ allocate (complexvla (11,22,33)) -+ allocate (logicalvla (11,22,33)) -+ allocate (charactervla (11,22,33)) -+ -+ l = allocated(intvla) ! vlas-allocated -+ l = allocated(realvla) -+ l = allocated(complexvla) -+ l = allocated(logicalvla) -+ l = allocated(charactervla) -+ -+ intvla(:,:,:) = 1 -+ realvla(:,:,:) = 3.14 -+ complexvla(:,:,:) = cmplx(2.0,-3.0) -+ logicalvla(:,:,:) = .TRUE. -+ charactervla(:,:,:) = char(75) -+ -+ intvla(5,5,5) = 42 ! vlas-initialized -+ realvla(5,5,5) = 4.13 -+ complexvla(5,5,5) = cmplx(-3.0,2.0) -+ logicalvla(5,5,5) = .FALSE. -+ charactervla(5,5,5) = 'X' -+ -+ ! dummy statement for bp -+ l = .FALSE. ! vlas-modified -+end program vla_primitives -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.exp +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.exp 2015-05-29 08:27:06.266740292 +0200 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.exp 2016-01-08 19:15:44.983637680 +0100 @@ -0,0 +1,61 @@ +# Copyright 2014 Free Software Foundation, Inc. + @@ -1284,10 +908,10 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.exp + "print vla3 (after func2)" +gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ + "ptype vla3 (after func2)" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.f90 +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.f90 2015-05-29 08:27:06.267740298 +0200 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-func.f90 2016-01-08 19:15:44.983637680 +0100 @@ -0,0 +1,71 @@ +! Copyright 2014 Free Software Foundation, Inc. +! @@ -1360,11 +984,11 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-func.f90 + + ret = .TRUE. ! func2-returned +end program vla_func -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stride.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp 2015-05-29 08:27:06.267740298 +0200 -@@ -0,0 +1,62 @@ ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stride.exp 2016-01-08 19:15:44.984637686 +0100 +@@ -0,0 +1,44 @@ +# Copyright 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1380,7 +1004,7 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+standard_testfile "vla.f90" ++standard_testfile ".f90" + +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + {debug f90 quiet}] } { @@ -1392,138 +1016,63 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-history.exp + continue +} + -+# Set some breakpoints and print complete vla. -+gdb_breakpoint [gdb_get_line_number "vla1-init"] -+gdb_continue_to_breakpoint "vla1-init" -+gdb_test "print vla1" " = " "print non-allocated vla1" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "print vla1" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ -+ "print vla1 allocated" -+gdb_test "print vla2" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ -+ "print vla2 allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-filled"] -+gdb_continue_to_breakpoint "vla1-filled" -+gdb_test "print vla1" \ -+ " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" \ -+ "print vla1 filled" -+ -+# Try to access history values for full vla prints. -+gdb_test "print \$1" " = " "print \$1" -+gdb_test "print \$2" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ -+ "print \$2" -+gdb_test "print \$3" " = \\( *\\( *\\( *0, *0, *0,\[()0, .\]*\\)" \ -+ "print \$3" -+gdb_test "print \$4" \ -+ " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" "print \$4" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-filled"] -+gdb_continue_to_breakpoint "vla2-filled" -+gdb_test "print vla2(1,43,20)" " = 1311" "print vla2(1,43,20)" -+gdb_test "print vla1(1,3,8)" " = 1001" "print vla2(1,3,8)" -+ -+# Try to access history values for vla values. -+gdb_test "print \$9" " = 1311" "print \$9" -+gdb_test "print \$10" " = 1001" "print \$10" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp ++gdb_breakpoint [gdb_get_line_number "re-reverse-elements"] ++gdb_continue_to_breakpoint "re-reverse-elements" ++gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \ ++ "print re-reverse-elements" ++gdb_test "print pvla(1)" " = 1" "print first re-reverse-element" ++gdb_test "print pvla(10)" " = 10" "print last re-reverse-element" ++ ++gdb_breakpoint [gdb_get_line_number "odd-elements"] ++gdb_continue_to_breakpoint "odd-elements" ++gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements" ++gdb_test "print pvla(1)" " = 1" "print first odd-element" ++gdb_test "print pvla(5)" " = 9" "print last odd-element" ++ ++gdb_breakpoint [gdb_get_line_number "single-element"] ++gdb_continue_to_breakpoint "single-element" ++gdb_test "print pvla" " = \\\(5\\\)" "print single-element" ++gdb_test "print pvla(1)" " = 5" "print one single-element" +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stride.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp 2015-05-29 08:27:06.267740298 +0200 -@@ -0,0 +1,87 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-stride.f90 2016-01-08 19:15:44.984637686 +0100 +@@ -0,0 +1,30 @@ ++! Copyright 2014 Free Software Foundation, Inc. ++! ++! This program is free software; you can redistribute it and/or modify ++! it under the terms of the GNU General Public License as published by ++! the Free Software Foundation; either version 2 of the License, or ++! (at your option) any later version. ++! ++! This program is distributed in the hope that it will be useful, ++! but WITHOUT ANY WARRANTY; without even the implied warranty of ++! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the ++! GNU General Public License for more details. ++! ++! You should have received a copy of the GNU General Public License ++! along with this program; if not, write to the Free Software ++! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. + -+standard_testfile "vla-sub.f90" ++program vla_stride ++ integer, target, allocatable :: vla (:) ++ integer, pointer :: pvla (:) + -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} ++ allocate(vla(10)) ++ vla = (/ (I, I = 1,10) /) + -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} ++ pvla => vla(10:1:-1) ++ pvla => pvla(10:1:-1) ++ pvla => vla(1:10:2) ! re-reverse-elements ++ pvla => vla(5:4:-2) ! odd-elements + -+# Pass fixed array to function and handle them as vla in function. -+gdb_breakpoint [gdb_get_line_number "not-filled"] -+gdb_continue_to_breakpoint "not-filled (1st)" -+gdb_test "ptype array1" "type = integer\\\(kind=4\\\) \\\(42,42\\\)" \ -+ "ptype array1 (passed fixed)" -+gdb_test "ptype array2" "type = real\\\(kind=4\\\) \\\(42,42,42\\\)" \ -+ "ptype array2 (passed fixed)" -+gdb_test "ptype array1(40, 10)" "type = integer\\\(kind=4\\\)" \ -+ "ptype array1(40, 10) (passed fixed)" -+gdb_test "ptype array2(13, 11, 5)" "type = real\\\(kind=4\\\)" \ -+ "ptype array2(13, 11, 5) (passed fixed)" -+ -+# Pass sub arrays to function and handle them as vla in function. -+gdb_continue_to_breakpoint "not-filled (2nd)" -+gdb_test "ptype array1" "type = integer\\\(kind=4\\\) \\\(6,6\\\)" \ -+ "ptype array1 (passed sub-array)" -+gdb_test "ptype array2" "type = real\\\(kind=4\\\) \\\(6,6,6\\\)" \ -+ "ptype array2 (passed sub-array)" -+gdb_test "ptype array1(3, 3)" "type = integer\\\(kind=4\\\)" \ -+ "ptype array1(3, 3) (passed sub-array)" -+gdb_test "ptype array2(4, 4, 4)" "type = real\\\(kind=4\\\)" \ -+ "ptype array2(4, 4, 4) (passed sub-array)" -+ -+# Check ptype outside of bounds. This should not crash GDB. -+gdb_test "ptype array1(100, 100)" "no such vector element" \ -+ "ptype array1(100, 100) subarray do not crash (passed sub-array)" -+gdb_test "ptype array2(100, 100, 100)" "no such vector element" \ -+ "ptype array2(100, 100, 100) subarray do not crash (passed sub-array)" -+ -+# Pass vla to function. -+gdb_continue_to_breakpoint "not-filled (3rd)" -+gdb_test "ptype array1" "type = integer\\\(kind=4\\\) \\\(20,20\\\)" \ -+ "ptype array1 (passed vla)" -+gdb_test "ptype array2" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \ -+ "ptype array2 (passed vla)" -+gdb_test "ptype array1(3, 3)" "type = integer\\\(kind=4\\\)" \ -+ "ptype array1(3, 3) (passed vla)" -+gdb_test "ptype array2(4, 4, 4)" "type = real\\\(kind=4\\\)" \ -+ "ptype array2(4, 4, 4) (passed vla)" -+ -+# Check ptype outside of bounds. This should not crash GDB. -+gdb_test "ptype array1(100, 100)" "no such vector element" \ -+ "ptype array1(100, 100) VLA do not crash (passed vla)" -+gdb_test "ptype array2(100, 100, 100)" "no such vector element" \ -+ "ptype array2(100, 100, 100) VLA do not crash (passed vla)" -+ -+# Pass fixed array to function and handle it as VLA of arbitrary length in -+# function. -+gdb_breakpoint [gdb_get_line_number "end-of-bar"] -+gdb_continue_to_breakpoint "end-of-bar" -+gdb_test "ptype array1" \ -+ "type = (PTR TO -> \\( )?integer(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?" \ -+ "ptype array1 (arbitrary length)" -+gdb_test "ptype array2" \ -+ "type = (PTR TO -> \\( )?integer(\\(kind=4\\)|\\*4) \\(4:9,10:\\*\\)\\)?" \ -+ "ptype array2 (arbitrary length)" -+gdb_test "ptype array1(100)" "type = integer\\\(kind=4\\\)" \ -+ "ptype array1(100) (arbitrary length)" -+gdb_test "ptype array2(4,100)" "type = integer\\\(kind=4\\\)" \ -+ "ptype array2(4,100) (arbitrary length)" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype.exp ++ pvla => null() ! single-element ++end program vla_stride +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-strings.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype.exp 2015-05-29 08:27:06.267740298 +0200 -@@ -0,0 +1,96 @@ ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-strings.exp 2016-01-08 19:15:44.984637686 +0100 +@@ -0,0 +1,101 @@ +# Copyright 2014 Free Software Foundation, Inc. + +# This program is free software; you can redistribute it and/or modify @@ -1539,272 +1088,33 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-ptype.exp +# You should have received a copy of the GNU General Public License +# along with this program. If not, see . + -+standard_testfile "vla.f90" ++standard_testfile ".f90" + +if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ + {debug f90 quiet}] } { + return -1 +} + ++# check that all fortran standard datatypes will be ++# handled correctly when using as VLA's ++ +if ![runto MAIN__] then { + perror "couldn't run to breakpoint MAIN__" + continue +} + -+# Check the ptype of various VLA states and pointer to VLA's. -+gdb_breakpoint [gdb_get_line_number "vla1-init"] -+gdb_continue_to_breakpoint "vla1-init" -+gdb_test "ptype vla1" "type = " "ptype vla1 not initialized" -+gdb_test "ptype vla2" "type = " "ptype vla2 not initialized" -+gdb_test "ptype pvla" "type = " "ptype pvla not initialized" -+gdb_test "ptype vla1(3, 6, 9)" "no such vector element because not allocated" \ -+ "ptype vla1(3, 6, 9) not initialized" -+gdb_test "ptype vla2(5, 45, 20)" \ -+ "no such vector element because not allocated" \ -+ "ptype vla1(5, 45, 20) not initialized" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-allocated"] -+gdb_continue_to_breakpoint "vla1-allocated" -+gdb_test "ptype vla1" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \ -+ "ptype vla1 allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "ptype vla2" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \ -+ "ptype vla2 allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-filled"] -+gdb_continue_to_breakpoint "vla1-filled" -+gdb_test "ptype vla1" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \ -+ "ptype vla1 filled" -+gdb_test "ptype vla1(3, 6, 9)" "type = real\\\(kind=4\\\)" \ -+ "ptype vla1(3, 6, 9)" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-filled"] -+gdb_continue_to_breakpoint "vla2-filled" -+gdb_test "ptype vla2" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \ -+ "ptype vla2 filled" -+gdb_test "ptype vla2(5, 45, 20)" "type = real\\\(kind=4\\\)" \ -+ "ptype vla1(5, 45, 20) filled" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-associated"] -+gdb_continue_to_breakpoint "pvla-associated" -+gdb_test "ptype pvla" "type = real\\\(kind=4\\\) \\\(10,10,10\\\)" \ -+ "ptype pvla associated" -+gdb_test "ptype pvla(3, 6, 9)" "type = real\\\(kind=4\\\)" \ -+ "ptype pvla(3, 6, 9)" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-re-associated"] -+gdb_continue_to_breakpoint "pvla-re-associated" -+gdb_test "ptype pvla" "type = real\\\(kind=4\\\) \\\(7,42:50,13:35\\\)" \ -+ "ptype pvla re-associated" -+gdb_test "ptype vla2(5, 45, 20)" "type = real\\\(kind=4\\\)" \ -+ "ptype vla1(5, 45, 20) re-associated" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] -+gdb_continue_to_breakpoint "pvla-deassociated" -+gdb_test "ptype pvla" "type = " "ptype pvla deassociated" -+gdb_test "ptype pvla(5, 45, 20)" \ -+ "no such vector element because not associated" \ -+ "ptype pvla(5, 45, 20) not associated" -+ -+gdb_breakpoint [gdb_get_line_number "vla1-deallocated"] -+gdb_continue_to_breakpoint "vla1-deallocated" -+gdb_test "ptype vla1" "type = " "ptype vla1 not allocated" -+gdb_test "ptype vla1(3, 6, 9)" "no such vector element because not allocated" \ -+ "ptype vla1(3, 6, 9) not allocated" -+ -+gdb_breakpoint [gdb_get_line_number "vla2-deallocated"] -+gdb_continue_to_breakpoint "vla2-deallocated" -+gdb_test "ptype vla2" "type = " "ptype vla2 not allocated" -+gdb_test "ptype vla2(5, 45, 20)" \ -+ "no such vector element because not allocated" \ -+ "ptype vla2(5, 45, 20) not allocated" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sizeof.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sizeof.exp 2015-05-29 08:27:06.267740298 +0200 -@@ -0,0 +1,46 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# Try to access values in non allocated VLA -+gdb_breakpoint [gdb_get_line_number "vla1-init"] -+gdb_continue_to_breakpoint "vla1-init" -+gdb_test "print sizeof(vla1)" " = 0" "print sizeof non-allocated vla1" -+ -+# Try to access value in allocated VLA -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "print sizeof(vla1)" " = 4000" "print sizeof allocated vla1" -+ -+# Try to access values in undefined pointer to VLA (dangling) -+gdb_breakpoint [gdb_get_line_number "vla1-filled"] -+gdb_continue_to_breakpoint "vla1-filled" -+gdb_test "print sizeof(pvla)" " = 0" "print sizeof non-associated pvla" -+ -+# Try to access values in pointer to VLA and compare them -+gdb_breakpoint [gdb_get_line_number "pvla-associated"] -+gdb_continue_to_breakpoint "pvla-associated" -+gdb_test "print sizeof(pvla)" " = 4000" "print sizeof associated pvla" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.exp 2015-05-29 08:27:06.267740298 +0200 -@@ -0,0 +1,44 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile ".f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "re-reverse-elements"] -+gdb_continue_to_breakpoint "re-reverse-elements" -+gdb_test "print pvla" " = \\\(1, 2, 3, 4, 5, 6, 7, 8, 9, 10\\\)" \ -+ "print re-reverse-elements" -+gdb_test "print pvla(1)" " = 1" "print first re-reverse-element" -+gdb_test "print pvla(10)" " = 10" "print last re-reverse-element" -+ -+gdb_breakpoint [gdb_get_line_number "odd-elements"] -+gdb_continue_to_breakpoint "odd-elements" -+gdb_test "print pvla" " = \\\(1, 3, 5, 7, 9\\\)" "print odd-elements" -+gdb_test "print pvla(1)" " = 1" "print first odd-element" -+gdb_test "print pvla(5)" " = 9" "print last odd-element" -+ -+gdb_breakpoint [gdb_get_line_number "single-element"] -+gdb_continue_to_breakpoint "single-element" -+gdb_test "print pvla" " = \\\(5\\\)" "print single-element" -+gdb_test "print pvla(1)" " = 5" "print one single-element" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-stride.f90 2015-05-29 08:27:06.268740305 +0200 -@@ -0,0 +1,30 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 2 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program; if not, write to the Free Software -+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+ -+program vla_stride -+ integer, target, allocatable :: vla (:) -+ integer, pointer :: pvla (:) -+ -+ allocate(vla(10)) -+ vla = (/ (I, I = 1,10) /) -+ -+ pvla => vla(10:1:-1) -+ pvla => pvla(10:1:-1) -+ pvla => vla(1:10:2) ! re-reverse-elements -+ pvla => vla(5:4:-2) ! odd-elements -+ -+ pvla => null() ! single-element -+end program vla_stride -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp 2015-05-29 08:27:06.268740305 +0200 -@@ -0,0 +1,104 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile ".f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+# check that all fortran standard datatypes will be -+# handled correctly when using as VLA's -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] -+gdb_continue_to_breakpoint "var_char-allocated-1" -+gdb_test "print var_char" \ -+ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \ -+ "print var_char after allocated first time" -+gdb_test "print *var_char" \ -+ " = '\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000\\\\000'" \ -+ "print *var_char after allocated first time" -+gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \ -+ "whatis var_char first time" -+gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \ -+ "ptype var_char first time" -+gdb_test "next" "\\d+.*var_char = 'foo'.*" \ -+ "next to allocation status of var_char" -+gdb_test "print l" " = .TRUE." "print allocation status first time" ++gdb_breakpoint [gdb_get_line_number "var_char-allocated-1"] ++gdb_continue_to_breakpoint "var_char-allocated-1" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*10 \\)\\) ${hex}" \ ++ "print var_char after allocated first time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++ "whatis var_char first time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*10 \\)" \ ++ "ptype var_char first time" ++gdb_test "next" "\\d+.*var_char = 'foo'.*" \ ++ "next to allocation status of var_char" ++gdb_test "print l" " = .TRUE." "print allocation status first time" + +gdb_breakpoint [gdb_get_line_number "var_char-filled-1"] +gdb_continue_to_breakpoint "var_char-filled-1" @@ -1864,10 +1174,10 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.exp + "whatis var_char_p after associated" +gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ + "ptype var_char_p after associated" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.f90 +Index: gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-strings.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.f90 2015-05-31 15:25:01.305615755 +0200 ++++ gdb-7.10.50.20160106/gdb/testsuite/gdb.fortran/vla-strings.f90 2016-01-08 19:15:44.984637686 +0100 @@ -0,0 +1,40 @@ +! Copyright 2014 Free Software Foundation, Inc. +! @@ -1909,734 +1219,11 @@ Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-strings.f90 + var_char_p => null() + l = associated(var_char_p) ! var_char_p-not-associated +end program vla_strings -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sub.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-sub.f90 2015-05-29 08:27:06.268740305 +0200 -@@ -0,0 +1,82 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 2 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program; if not, write to the Free Software -+! Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -+! -+! Original file written by Jakub Jelinek and -+! Jan Kratochvil . -+! Modified for the GDB testcases by Keven Boell . -+ -+subroutine foo (array1, array2) -+ integer :: array1 (:, :) -+ real :: array2 (:, :, :) -+ -+ array1(:,:) = 5 ! not-filled -+ array1(1, 1) = 30 -+ -+ array2(:,:,:) = 6 ! array1-filled -+ array2(:,:,:) = 3 -+ array2(1,1,1) = 30 -+ array2(3,3,3) = 90 ! array2-almost-filled -+end subroutine -+ -+subroutine bar (array1, array2) -+ integer :: array1 (*) -+ integer :: array2 (4:9, 10:*) -+ -+ array1(5:10) = 1311 -+ array1(7) = 1 -+ array1(100) = 100 -+ array2(4,10) = array1(7) -+ array2(4,100) = array1(7) -+ return ! end-of-bar -+end subroutine -+ -+program vla_sub -+ interface -+ subroutine foo (array1, array2) -+ integer :: array1 (:, :) -+ real :: array2 (:, :, :) -+ end subroutine -+ end interface -+ interface -+ subroutine bar (array1, array2) -+ integer :: array1 (*) -+ integer :: array2 (4:9, 10:*) -+ end subroutine -+ end interface -+ -+ real, allocatable :: vla1 (:, :, :) -+ integer, allocatable :: vla2 (:, :) -+ -+ ! used for subroutine -+ integer :: sub_arr1(42, 42) -+ real :: sub_arr2(42, 42, 42) -+ integer :: sub_arr3(42) -+ -+ sub_arr1(:,:) = 1 ! vla2-deallocated -+ sub_arr2(:,:,:) = 2 -+ sub_arr3(:) = 3 -+ -+ call foo(sub_arr1, sub_arr2) -+ call foo(sub_arr1(5:10, 5:10), sub_arr2(10:15,10:15,10:15)) -+ -+ allocate (vla1 (10,10,10)) -+ allocate (vla2 (20,20)) -+ vla1(:,:,:) = 1311 -+ vla2(:,:) = 42 -+ call foo(vla2, vla1) -+ -+ call bar(sub_arr3, sub_arr1) -+end program vla_sub -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp 2015-05-29 08:27:06.268740305 +0200 -@@ -0,0 +1,35 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla-sub.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# Check VLA with arbitary length and check that elements outside of -+# bounds of the passed VLA can be accessed correctly. -+gdb_breakpoint [gdb_get_line_number "end-of-bar"] -+gdb_continue_to_breakpoint "end-of-bar" -+gdb_test "p array1(42)" " = 3" "print arbitary array1(42)" -+gdb_test "p array1(100)" " = 100" "print arbitary array1(100)" -+gdb_test "p array2(4,10)" " = 1" "print arbitary array2(4,10)" -+gdb_test "p array2(4,100)" " = 1" "print arbitary array2(4,100)" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp 2015-05-29 08:27:06.268740305 +0200 -@@ -0,0 +1,49 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla-sub.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# "up" works with GCC but other Fortran compilers may copy the values into the -+# outer function only on the exit of the inner function. -+# We need both variants as depending on the arch we optionally may still be -+# executing the caller line or not after `finish'. -+ -+gdb_breakpoint [gdb_get_line_number "array2-almost-filled"] -+gdb_continue_to_breakpoint "array2-almost-filled" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was filled" -+gdb_test "print array2(2,1,1)=20" " = 20" \ -+ "set array(2,2,2) to 20 in subroutine" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was mofified in debugger" -+ -+gdb_test "finish" \ -+ ".*foo\\\(sub_arr1\\\(5:10, 5:10\\\), sub_arr2\\\(10:15,10:15,10:15\\\)\\\)" \ -+ "finish function" -+gdb_test "p sub_arr1(5, 7)" " = 5" "sub_arr1(5, 7) after finish" -+gdb_test "p sub_arr1(1, 1)" " = 30" "sub_arr1(1, 1) after finish" -+gdb_test "p sub_arr2(1, 1, 1)" " = 30" "sub_arr2(1, 1, 1) after finish" -+gdb_test "p sub_arr2(2, 1, 1)" " = 20" "sub_arr2(2, 1, 1) after finish" -+ -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value-sub.exp 2015-05-29 08:27:06.269740311 +0200 -@@ -0,0 +1,90 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla-sub.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# Check the values of VLA's in subroutine can be evaluated correctly -+ -+# Try to access values from a fixed array handled as VLA in subroutine. -+gdb_breakpoint [gdb_get_line_number "not-filled"] -+gdb_continue_to_breakpoint "not-filled (1st)" -+gdb_test "print array1" " = \\(\[()1, .\]*\\)" \ -+ "print passed array1 in foo (passed fixed array)" -+ -+gdb_breakpoint [gdb_get_line_number "array1-filled"] -+gdb_continue_to_breakpoint "array1-filled (1st)" -+gdb_test "print array1(5, 7)" " = 5" \ -+ "print array1(5, 7) after filled in foo (passed fixed array)" -+gdb_test "print array1(1, 1)" " = 30" \ -+ "print array1(1, 1) after filled in foo (passed fixed array)" -+ -+gdb_breakpoint [gdb_get_line_number "array2-almost-filled"] -+gdb_continue_to_breakpoint "array2-almost-filled (1st)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was filled (passed fixed array)" -+gdb_test "print array2(2,1,1)=20" " = 20" \ -+ "set array(2,2,2) to 20 in subroutine (passed fixed array)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was mofified in debugger (passed fixed array)" -+ -+ -+# Try to access values from a fixed sub-array handled as VLA in subroutine. -+gdb_continue_to_breakpoint "not-filled (2nd)" -+gdb_test "print array1" " = \\(\[()5, .\]*\\)" \ -+ "print passed array1 in foo (passed sub-array)" -+ -+gdb_continue_to_breakpoint "array1-filled (2nd)" -+gdb_test "print array1(5, 5)" " = 5" \ -+ "print array1(5, 5) after filled in foo (passed sub-array)" -+gdb_test "print array1(1, 1)" " = 30" \ -+ "print array1(1, 1) after filled in foo (passed sub-array)" -+ -+gdb_continue_to_breakpoint "array2-almost-filled (2nd)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was filled (passed sub-array)" -+gdb_test "print array2(2,1,1)=20" " = 20" \ -+ "set array(2,2,2) to 20 in subroutine (passed sub-array)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was mofified in debugger (passed sub-array)" -+ -+ -+# Try to access values from a VLA passed to subroutine. -+gdb_continue_to_breakpoint "not-filled (3rd)" -+gdb_test "print array1" " = \\(\[()42, .\]*\\)" \ -+ "print passed array1 in foo (passed vla)" -+ -+gdb_continue_to_breakpoint "array1-filled (3rd)" -+gdb_test "print array1(5, 5)" " = 5" \ -+ "print array1(5, 5) after filled in foo (passed vla)" -+gdb_test "print array1(1, 1)" " = 30" \ -+ "print array1(1, 1) after filled in foo (passed vla)" -+ -+gdb_continue_to_breakpoint "array2-almost-filled (3rd)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *3, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was filled (passed vla)" -+gdb_test "print array2(2,1,1)=20" " = 20" \ -+ "set array(2,2,2) to 20 in subroutine (passed vla)" -+gdb_test "print array2" " = \\( *\\( *\\( *30, *20, *3,\[()3, .\]*\\)" \ -+ "print array2 in foo after it was mofified in debugger (passed vla)" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value.exp -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla-value.exp 2015-05-29 08:27:06.269740311 +0200 -@@ -0,0 +1,148 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+standard_testfile "vla.f90" -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} \ -+ {debug f90 quiet}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+# Try to access values in non allocated VLA -+gdb_breakpoint [gdb_get_line_number "vla1-init"] -+gdb_continue_to_breakpoint "vla1-init" -+gdb_test "print vla1" " = " "print non-allocated vla1" -+gdb_test "print &vla1" \ -+ " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ -+ "print non-allocated &vla1" -+gdb_test "print vla1(1,1,1)" "no such vector element because not allocated" \ -+ "print member in non-allocated vla1 (1)" -+gdb_test "print vla1(101,202,303)" \ -+ "no such vector element because not allocated" \ -+ "print member in non-allocated vla1 (2)" -+gdb_test "print vla1(5,2,18)=1" "no such vector element because not allocated" \ -+ "set member in non-allocated vla1" -+ -+# Try to access value in allocated VLA -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "next" "\\d+(\\t|\\s)+vla1\\\(3, 6, 9\\\) = 42" \ -+ "step over value assignment of vla1" -+gdb_test "print &vla1" \ -+ " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ -+ "print allocated &vla1" -+gdb_test "print vla1(3, 6, 9)" " = 1311" "print allocated vla1(3,6,9)" -+gdb_test "print vla1(1, 3, 8)" " = 1311" "print allocated vla1(1,3,8)" -+gdb_test "print vla1(9, 9, 9) = 999" " = 999" \ -+ "print allocated vla1(9,9,9)=1" -+ -+# Try to access values in allocated VLA after specific assignment -+gdb_breakpoint [gdb_get_line_number "vla1-filled"] -+gdb_continue_to_breakpoint "vla1-filled" -+gdb_test "print vla1(3, 6, 9)" " = 42" \ -+ "print allocated vla1(3,6,9) after specific assignment (filled)" -+gdb_test "print vla1(1, 3, 8)" " = 1001" \ -+ "print allocated vla1(1,3,8) after specific assignment (filled)" -+gdb_test "print vla1(9, 9, 9)" " = 999" \ -+ "print allocated vla1(9,9,9) after assignment in debugger (filled)" -+ -+# Try to access values in undefined pointer to VLA (dangling) -+gdb_test "print pvla" " = " "print undefined pvla" -+gdb_test "print &pvla" \ -+ " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(\\\)\\\)\\\) $hex" \ -+ "print non-associated &pvla" -+gdb_test "print pvla(1, 3, 8)" "no such vector element because not associated" \ -+ "print undefined pvla(1,3,8)" -+ -+# Try to access values in pointer to VLA and compare them -+gdb_breakpoint [gdb_get_line_number "pvla-associated"] -+gdb_continue_to_breakpoint "pvla-associated" -+gdb_test "print &pvla" \ -+ " = \\\(PTR TO -> \\\( real\\\(kind=4\\\) \\\(10,10,10\\\)\\\)\\\) $hex" \ -+ "print associated &pvla" -+gdb_test "print pvla(3, 6, 9)" " = 42" "print associated pvla(3,6,9)" -+gdb_test "print pvla(1, 3, 8)" " = 1001" "print associated pvla(1,3,8)" -+gdb_test "print pvla(9, 9, 9)" " = 999" "print associated pvla(9,9,9)" -+ -+# Fill values to VLA using pointer and check -+gdb_breakpoint [gdb_get_line_number "pvla-re-associated"] -+gdb_continue_to_breakpoint "pvla-re-associated" -+gdb_test "print pvla(5, 45, 20)" \ -+ " = 1" "print pvla(5, 45, 20) after filled using pointer" -+gdb_test "print vla2(5, 45, 20)" \ -+ " = 1" "print vla2(5, 45, 20) after filled using pointer" -+gdb_test "print pvla(7, 45, 14)" " = 2" \ -+ "print pvla(7, 45, 14) after filled using pointer" -+gdb_test "print vla2(7, 45, 14)" " = 2" \ -+ "print vla2(7, 45, 14) after filled using pointer" -+ -+# Try to access values of deassociated VLA pointer -+gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] -+gdb_continue_to_breakpoint "pvla-deassociated" -+gdb_test "print pvla(5, 45, 20)" \ -+ "no such vector element because not associated" \ -+ "print pvla(5, 45, 20) after deassociated" -+gdb_test "print pvla(7, 45, 14)" \ -+ "no such vector element because not associated" \ -+ "print pvla(7, 45, 14) after dissasociated" -+gdb_test "print pvla" " = " \ -+ "print vla1 after deassociated" -+ -+# Try to access values of deallocated VLA -+gdb_breakpoint [gdb_get_line_number "vla1-deallocated"] -+gdb_continue_to_breakpoint "vla1-deallocated" -+gdb_test "print vla1(3, 6, 9)" "no such vector element because not allocated" \ -+ "print allocated vla1(3,6,9) after specific assignment (deallocated)" -+gdb_test "print vla1(1, 3, 8)" "no such vector element because not allocated" \ -+ "print allocated vla1(1,3,8) after specific assignment (deallocated)" -+gdb_test "print vla1(9, 9, 9)" "no such vector element because not allocated" \ -+ "print allocated vla1(9,9,9) after assignment in debugger (deallocated)" -+ -+ -+# Try to assign VLA to user variable -+clean_restart ${testfile} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+gdb_breakpoint [gdb_get_line_number "vla2-allocated"] -+gdb_continue_to_breakpoint "vla2-allocated" -+gdb_test "next" "\\d+.*vla1\\(3, 6, 9\\) = 42" "next (1)" -+ -+gdb_test_no_output "set \$myvar = vla1" "set \$myvar = vla1" -+gdb_test "print \$myvar" \ -+ " = \\( *\\( *\\( *1311, *1311, *1311,\[()1311, .\]*\\)" \ -+ "print \$myvar set to vla1" -+ -+gdb_test "next" "\\d+.*vla1\\(1, 3, 8\\) = 1001" "next (2)" -+gdb_test "print \$myvar(3,6,9)" " = 1311" "print \$myvar(3,6,9)" -+ -+gdb_breakpoint [gdb_get_line_number "pvla-associated"] -+gdb_continue_to_breakpoint "pvla-associated" -+gdb_test_no_output "set \$mypvar = pvla" "set \$mypvar = pvla" -+gdb_test "print \$mypvar(1,3,8)" " = 1001" "print \$mypvar(1,3,8)" -+ -+# deallocate pointer and make sure user defined variable still has the -+# right value. -+gdb_breakpoint [gdb_get_line_number "pvla-deassociated"] -+gdb_continue_to_breakpoint "pvla-deassociated" -+gdb_test "print \$mypvar(1,3,8)" " = 1001" \ -+ "print \$mypvar(1,3,8) after deallocated" -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.fortran/vla.f90 2015-05-29 08:27:06.269740311 +0200 -@@ -0,0 +1,56 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 3 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program. If not, see . -+ -+program vla -+ real, target, allocatable :: vla1 (:, :, :) -+ real, target, allocatable :: vla2 (:, :, :) -+ real, target, allocatable :: vla3 (:, :) -+ real, pointer :: pvla (:, :, :) -+ logical :: l -+ -+ allocate (vla1 (10,10,10)) ! vla1-init -+ l = allocated(vla1) -+ -+ allocate (vla2 (1:7,42:50,13:35)) ! vla1-allocated -+ l = allocated(vla2) -+ -+ vla1(:, :, :) = 1311 ! vla2-allocated -+ vla1(3, 6, 9) = 42 -+ vla1(1, 3, 8) = 1001 -+ vla1(6, 2, 7) = 13 -+ -+ vla2(:, :, :) = 1311 ! vla1-filled -+ vla2(5, 45, 20) = 42 -+ -+ pvla => vla1 ! vla2-filled -+ l = associated(pvla) -+ -+ pvla => vla2 ! pvla-associated -+ l = associated(pvla) -+ pvla(5, 45, 20) = 1 -+ pvla(7, 45, 14) = 2 -+ -+ pvla => null() ! pvla-re-associated -+ l = associated(pvla) -+ -+ deallocate (vla1) ! pvla-deassociated -+ l = allocated(vla1) -+ -+ deallocate (vla2) ! vla1-deallocated -+ l = allocated(vla2) -+ -+ allocate (vla3 (2,2)) ! vla2-deallocated -+ vla3(:,:) = 13 -+end program vla -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +Index: gdb-7.10.50.20160106/gdb/typeprint.c =================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/mi-vla-fortran.exp 2015-05-29 11:13:53.951656591 +0200 -@@ -0,0 +1,181 @@ -+# Copyright 2014 Free Software Foundation, Inc. -+ -+# This program is free software; you can redistribute it and/or modify -+# it under the terms of the GNU General Public License as published by -+# the Free Software Foundation; either version 3 of the License, or -+# (at your option) any later version. -+# -+# This program is distributed in the hope that it will be useful, -+# but WITHOUT ANY WARRANTY; without even the implied warranty of -+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+# GNU General Public License for more details. -+# -+# You should have received a copy of the GNU General Public License -+# along with this program. If not, see . -+ -+# Verify that, using the MI, we can evaluate a simple C Variable Length -+# Array (VLA). -+ -+load_lib mi-support.exp -+set MIFLAGS "-i=mi" -+ -+gdb_exit -+if [mi_gdb_start] { -+ continue -+} -+ -+standard_testfile vla.f90 -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable \ -+ {debug f90}] != "" } { -+ untested mi-vla-fortran.exp -+ return -1 -+} -+ -+mi_delete_breakpoints -+mi_gdb_reinitialize_dir $srcdir/$subdir -+mi_gdb_load ${binfile} -+ -+set bp_lineno [gdb_get_line_number "vla1-not-allocated"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 1 "del" "vla" \ -+ ".*vla.f90" $bp_lineno $hex \ -+ "insert breakpoint at line $bp_lineno (vla not allocated)" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "500-data-evaluate-expression vla1" \ -+ "500\\^done,value=\"\"" "evaluate not allocated vla" -+ -+mi_create_varobj_checked vla1_not_allocated vla1 "" \ -+ "create local variable vla1_not_allocated" -+mi_gdb_test "501-var-info-type vla1_not_allocated" \ -+ "501\\^done,type=\"\"" \ -+ "info type variable vla1_not_allocated" -+mi_gdb_test "502-var-show-format vla1_not_allocated" \ -+ "502\\^done,format=\"natural\"" \ -+ "show format variable vla1_not_allocated" -+mi_gdb_test "503-var-evaluate-expression vla1_not_allocated" \ -+ "503\\^done,value=\"\\\[0\\\]\"" \ -+ "eval variable vla1_not_allocated" -+mi_list_array_varobj_children_with_index "vla1_not_allocated" "0" "1" \ -+ "real\\\(kind=4\\\)" "get children of vla1_not_allocated" -+ -+ -+ -+set bp_lineno [gdb_get_line_number "vla1-allocated"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 2 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno (vla allocated)" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+# Content of 'vla1' is uninitialized here. -+ -+mi_create_varobj_checked vla1_allocated vla1 "real\\\(kind=4\\\) \\\(5\\\)" \ -+ "create local variable vla1_allocated" -+mi_gdb_test "511-var-info-type vla1_allocated" \ -+ "511\\^done,type=\"real\\\(kind=4\\\) \\\(5\\\)\"" \ -+ "info type variable vla1_allocated" -+mi_gdb_test "512-var-show-format vla1_allocated" \ -+ "512\\^done,format=\"natural\"" \ -+ "show format variable vla1_allocated" -+mi_gdb_test "513-var-evaluate-expression vla1_allocated" \ -+ "513\\^done,value=\"\\\[5\\\]\"" \ -+ "eval variable vla1_allocated" -+mi_list_array_varobj_children_with_index "vla1_allocated" "5" "1" \ -+ "real\\\(kind=4\\\)" "get children of vla1_allocated" -+ -+ -+set bp_lineno [gdb_get_line_number "vla1-filled"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 3 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "520-data-evaluate-expression vla1" \ -+ "520\\^done,value=\"\\(1, 1, 1, 1, 1\\)\"" "evaluate filled vla" -+ -+ -+set bp_lineno [gdb_get_line_number "vla1-modified"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 4 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "530-data-evaluate-expression vla1" \ -+ "530\\^done,value=\"\\(1, 42, 1, 24, 1\\)\"" "evaluate filled vla" -+mi_gdb_test "540-data-evaluate-expression vla1(1)" \ -+ "540\\^done,value=\"1\"" "evaluate filled vla" -+mi_gdb_test "550-data-evaluate-expression vla1(2)" \ -+ "550\\^done,value=\"42\"" "evaluate filled vla" -+mi_gdb_test "560-data-evaluate-expression vla1(4)" \ -+ "560\\^done,value=\"24\"" "evaluate filled vla" -+ -+ -+set bp_lineno [gdb_get_line_number "vla1-deallocated"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 5 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "570-data-evaluate-expression vla1" \ -+ "570\\^done,value=\"\"" "evaluate not allocated vla" -+ -+ -+set bp_lineno [gdb_get_line_number "pvla2-not-associated"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 6 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "580-data-evaluate-expression pvla2" \ -+ "580\\^done,value=\"\"" "evaluate not associated vla" -+ -+mi_create_varobj_checked pvla2_not_associated pvla2 "" \ -+ "create local variable pvla2_not_associated" -+mi_gdb_test "581-var-info-type pvla2_not_associated" \ -+ "581\\^done,type=\"\"" \ -+ "info type variable pvla2_not_associated" -+mi_gdb_test "582-var-show-format pvla2_not_associated" \ -+ "582\\^done,format=\"natural\"" \ -+ "show format variable pvla2_not_associated" -+mi_gdb_test "583-var-evaluate-expression pvla2_not_associated" \ -+ "583\\^done,value=\"\\\[0\\\]\"" \ -+ "eval variable pvla2_not_associated" -+mi_list_array_varobj_children_with_index "pvla2_not_associated" "0" "1" \ -+ "real\\\(kind=4\\\)" "get children of pvla2_not_associated" -+ -+ -+set bp_lineno [gdb_get_line_number "pvla2-associated"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 7 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "590-data-evaluate-expression pvla2" \ -+ "590\\^done,value=\"\\(\\( 2, 2, 2, 2, 2\\) \\( 2, 2, 2, 2, 2\\) \\)\"" \ -+ "evaluate associated vla" -+ -+mi_create_varobj_checked pvla2_associated pvla2 \ -+ "real\\\(kind=4\\\) \\\(5,2\\\)" "create local variable pvla2_associated" -+mi_gdb_test "591-var-info-type pvla2_associated" \ -+ "591\\^done,type=\"real\\\(kind=4\\\) \\\(5,2\\\)\"" \ -+ "info type variable pvla2_associated" -+mi_gdb_test "592-var-show-format pvla2_associated" \ -+ "592\\^done,format=\"natural\"" \ -+ "show format variable pvla2_associated" -+mi_gdb_test "593-var-evaluate-expression pvla2_associated" \ -+ "593\\^done,value=\"\\\[2\\\]\"" \ -+ "eval variable pvla2_associated" -+ -+ -+set bp_lineno [gdb_get_line_number "pvla2-set-to-null"] -+mi_create_breakpoint "-t vla.f90:$bp_lineno" 8 "del" "vla" ".*vla.f90" \ -+ $bp_lineno $hex "insert breakpoint at line $bp_lineno" -+mi_run_cmd -+mi_expect_stop "breakpoint-hit" "vla" "" ".*vla.f90" "$bp_lineno" \ -+ { "" "disp=\"del\"" } "run to breakpoint at line $bp_lineno" -+mi_gdb_test "600-data-evaluate-expression pvla2" \ -+ "600\\^done,value=\"\"" "evaluate vla pointer set to null" -+ -+mi_gdb_exit -+return 0 -Index: gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/vla.f90 -=================================================================== ---- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.9.50.20150520/gdb/testsuite/gdb.mi/vla.f90 2015-05-29 08:27:06.270740317 +0200 -@@ -0,0 +1,42 @@ -+! Copyright 2014 Free Software Foundation, Inc. -+! -+! This program is free software; you can redistribute it and/or modify -+! it under the terms of the GNU General Public License as published by -+! the Free Software Foundation; either version 3 of the License, or -+! (at your option) any later version. -+! -+! This program is distributed in the hope that it will be useful, -+! but WITHOUT ANY WARRANTY; without even the implied warranty of -+! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -+! GNU General Public License for more details. -+! -+! You should have received a copy of the GNU General Public License -+! along with this program. If not, see . -+ -+program vla -+ real, allocatable :: vla1 (:) -+ real, target, allocatable :: vla2(:, :) -+ real, pointer :: pvla2 (:, :) -+ logical :: l -+ -+ allocate (vla1 (5)) ! vla1-not-allocated -+ l = allocated(vla1) ! vla1-allocated -+ -+ vla1(:) = 1 -+ vla1(2) = 42 ! vla1-filled -+ vla1(4) = 24 -+ -+ deallocate (vla1) ! vla1-modified -+ l = allocated(vla1) ! vla1-deallocated -+ -+ allocate (vla2 (5, 2)) -+ vla2(:, :) = 2 -+ -+ pvla2 => vla2 ! pvla2-not-associated -+ l = associated(pvla2) ! pvla2-associated -+ -+ pvla2(2, 1) = 42 -+ -+ pvla2 => null() -+ l = associated(pvla2) ! pvla2-set-to-null -+end program vla -Index: gdb-7.9.50.20150520/gdb/typeprint.c -=================================================================== ---- gdb-7.9.50.20150520.orig/gdb/typeprint.c 2015-05-29 08:27:02.688717523 +0200 -+++ gdb-7.9.50.20150520/gdb/typeprint.c 2015-05-29 08:27:06.270740317 +0200 -@@ -458,6 +458,13 @@ whatis_exp (char *exp, int show) +--- gdb-7.10.50.20160106.orig/gdb/typeprint.c 2016-01-08 19:15:35.086582476 +0100 ++++ gdb-7.10.50.20160106/gdb/typeprint.c 2016-01-08 19:15:44.984637686 +0100 +@@ -460,6 +460,13 @@ type = value_type (val); @@ -2650,14 +1237,14 @@ Index: gdb-7.9.50.20150520/gdb/typeprint.c get_user_print_options (&opts); if (opts.objectprint) { -Index: gdb-7.9.50.20150520/gdb/valarith.c +Index: gdb-7.10.50.20160106/gdb/valarith.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/valarith.c 2015-05-29 08:27:02.689717530 +0200 -+++ gdb-7.9.50.20150520/gdb/valarith.c 2015-05-29 08:27:06.271740324 +0200 -@@ -193,12 +193,31 @@ value_subscripted_rvalue (struct value * +--- gdb-7.10.50.20160106.orig/gdb/valarith.c 2016-01-08 19:15:35.087582482 +0100 ++++ gdb-7.10.50.20160106/gdb/valarith.c 2016-01-08 19:15:44.985637691 +0100 +@@ -193,9 +193,21 @@ struct type *array_type = check_typedef (value_type (array)); struct type *elt_type = check_typedef (TYPE_TARGET_TYPE (array_type)); - unsigned int elt_size = TYPE_LENGTH (elt_type); + unsigned int elt_size = type_length_units (elt_type); - unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound); + unsigned int elt_offs = longest_to_int (index - lowerbound); + LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)); @@ -2675,26 +1262,15 @@ Index: gdb-7.9.50.20150520/gdb/valarith.c + elt_offs *= elt_size; + if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) - && elt_offs >= TYPE_LENGTH (array_type))) -- error (_("no such vector element")); -+ { -+ if (TYPE_NOT_ASSOCIATED (array_type)) -+ error (_("no such vector element because not associated")); -+ else if (TYPE_NOT_ALLOCATED (array_type)) -+ error (_("no such vector element because not allocated")); -+ else -+ error (_("no such vector element")); -+ } - - if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) - v = allocate_value_lazy (elt_type); -Index: gdb-7.9.50.20150520/gdb/valprint.c + && elt_offs >= type_length_units (array_type))) + { +Index: gdb-7.10.50.20160106/gdb/valprint.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/valprint.c 2015-05-29 08:27:02.690717536 +0200 -+++ gdb-7.9.50.20150520/gdb/valprint.c 2015-05-29 08:27:06.271740324 +0200 -@@ -303,6 +303,18 @@ valprint_check_validity (struct ui_file - { - CHECK_TYPEDEF (type); +--- gdb-7.10.50.20160106.orig/gdb/valprint.c 2016-01-08 19:15:35.088582487 +0100 ++++ gdb-7.10.50.20160106/gdb/valprint.c 2016-01-08 19:15:44.986637697 +0100 +@@ -316,6 +316,18 @@ + return 0; + } + if (TYPE_NOT_ASSOCIATED (type)) + { @@ -2711,26 +1287,7 @@ Index: gdb-7.9.50.20150520/gdb/valprint.c if (TYPE_CODE (type) != TYPE_CODE_UNION && TYPE_CODE (type) != TYPE_CODE_STRUCT && TYPE_CODE (type) != TYPE_CODE_ARRAY) -@@ -359,6 +371,18 @@ val_print_invalid_address (struct ui_fil - fprintf_filtered (stream, _("")); - } - -+void -+val_print_not_allocated (struct ui_file *stream) -+{ -+ fprintf_filtered (stream, _("")); -+} -+ -+void -+val_print_not_associated (struct ui_file *stream) -+{ -+ fprintf_filtered (stream, _("")); -+} -+ - /* A generic val_print that is suitable for use by language - implementations of the la_val_print method. This function can - handle most type codes, though not all, notably exception -@@ -802,12 +826,16 @@ static int +@@ -1025,12 +1037,16 @@ value_check_printable (struct value *val, struct ui_file *stream, const struct value_print_options *options) { @@ -2747,10 +1304,12 @@ Index: gdb-7.9.50.20150520/gdb/valprint.c if (value_entirely_optimized_out (val)) { if (options->summary && !val_print_scalar_type_p (value_type (val))) -@@ -833,6 +861,18 @@ value_check_printable (struct value *val +@@ -1066,6 +1082,18 @@ + { + val_print_not_allocated (stream); return 0; - } - ++ } ++ + if (TYPE_NOT_ASSOCIATED (type)) + { + val_print_not_associated (stream); @@ -2761,16 +1320,14 @@ Index: gdb-7.9.50.20150520/gdb/valprint.c + { + val_print_not_allocated (stream); + return 0; -+ } -+ - return 1; - } + } -Index: gdb-7.9.50.20150520/gdb/valprint.h + return 1; +Index: gdb-7.10.50.20160106/gdb/valprint.h =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/valprint.h 2015-05-29 08:27:02.691717543 +0200 -+++ gdb-7.9.50.20150520/gdb/valprint.h 2015-05-29 08:27:06.272740330 +0200 -@@ -232,4 +232,8 @@ extern void print_command_parse_format ( +--- gdb-7.10.50.20160106.orig/gdb/valprint.h 2016-01-08 19:15:35.088582487 +0100 ++++ gdb-7.10.50.20160106/gdb/valprint.h 2016-01-08 19:15:44.986637697 +0100 +@@ -232,4 +232,8 @@ struct format_data *fmtp); extern void print_value (struct value *val, const struct format_data *fmtp); @@ -2779,10 +1336,10 @@ Index: gdb-7.9.50.20150520/gdb/valprint.h +extern void val_print_not_associated (struct ui_file *stream); + #endif -Index: gdb-7.9.50.20150520/gdb/value.c +Index: gdb-7.10.50.20160106/gdb/value.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/value.c 2015-05-29 08:27:02.693717555 +0200 -+++ gdb-7.9.50.20150520/gdb/value.c 2015-05-29 08:27:06.273740337 +0200 +--- gdb-7.10.50.20160106.orig/gdb/value.c 2016-01-08 19:15:35.090582499 +0100 ++++ gdb-7.10.50.20160106/gdb/value.c 2016-01-08 19:15:44.987637702 +0100 @@ -40,6 +40,7 @@ #include "tracepoint.h" #include "cp-abi.h" @@ -2791,7 +1348,7 @@ Index: gdb-7.9.50.20150520/gdb/value.c /* Prototypes for exported functions. */ -@@ -1776,6 +1777,25 @@ set_value_component_location (struct val +@@ -1788,6 +1789,25 @@ if (funcs->copy_closure) component->location.computed.closure = funcs->copy_closure (whole); } @@ -2817,14 +1374,14 @@ Index: gdb-7.9.50.20150520/gdb/value.c } -@@ -3080,13 +3100,22 @@ value_primitive_field (struct value *arg +@@ -3095,13 +3115,22 @@ v = allocate_value_lazy (type); else { - v = allocate_value (type); - value_contents_copy_raw (v, value_embedded_offset (v), - arg1, value_embedded_offset (arg1) + offset, -- TYPE_LENGTH (type)); +- type_length_units (type)); + if (TYPE_DATA_LOCATION (type) + && TYPE_DATA_LOCATION_KIND (type) == PROP_CONST) + v = value_at_lazy (type, value_address (arg1) + offset); @@ -2833,7 +1390,7 @@ Index: gdb-7.9.50.20150520/gdb/value.c + v = allocate_value (type); + value_contents_copy_raw (v, value_embedded_offset (v), + arg1, value_embedded_offset (arg1) + offset, -+ TYPE_LENGTH (type)); ++ type_length_units (type)); + } } - v->offset = (value_offset (arg1) + offset @@ -2846,7 +1403,7 @@ Index: gdb-7.9.50.20150520/gdb/value.c } set_value_component_location (v, arg1); VALUE_REGNUM (v) = VALUE_REGNUM (arg1); -@@ -3674,7 +3703,8 @@ readjust_indirect_value_type (struct val +@@ -3689,7 +3718,8 @@ struct value *original_value) { /* Re-adjust type. */ @@ -2856,7 +1413,7 @@ Index: gdb-7.9.50.20150520/gdb/value.c /* Add embedding info. */ set_value_enclosing_type (value, enc_type); -@@ -3691,6 +3721,12 @@ coerce_ref (struct value *arg) +@@ -3706,6 +3736,12 @@ struct value *retval; struct type *enc_type; @@ -2869,7 +1426,7 @@ Index: gdb-7.9.50.20150520/gdb/value.c retval = coerce_ref_if_computed (arg); if (retval) return retval; -@@ -3825,8 +3861,14 @@ value_fetch_lazy (struct value *val) +@@ -3834,8 +3870,14 @@ } else if (VALUE_LVAL (val) == lval_memory) { @@ -2885,12 +1442,12 @@ Index: gdb-7.9.50.20150520/gdb/value.c if (TYPE_LENGTH (type)) read_value_memory (val, 0, value_stack (val), -Index: gdb-7.9.50.20150520/gdb/dwarf2loc.c +Index: gdb-7.10.50.20160106/gdb/dwarf2loc.c =================================================================== ---- gdb-7.9.50.20150520.orig/gdb/dwarf2loc.c 2015-05-29 08:27:02.694717562 +0200 -+++ gdb-7.9.50.20150520/gdb/dwarf2loc.c 2015-05-29 08:27:06.274740343 +0200 -@@ -2294,6 +2294,11 @@ dwarf2_evaluate_loc_desc_full (struct ty - int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); +--- gdb-7.10.50.20160106.orig/gdb/dwarf2loc.c 2016-01-08 19:15:35.091582504 +0100 ++++ gdb-7.10.50.20160106/gdb/dwarf2loc.c 2016-01-08 19:15:44.988637708 +0100 +@@ -2368,6 +2368,11 @@ + address = value_as_address (value_from_pointer (ptr_type, address)); do_cleanups (value_chain); + @@ -2901,7 +1458,7 @@ Index: gdb-7.9.50.20150520/gdb/dwarf2loc.c retval = value_at_lazy (type, address + byte_offset); if (in_stack_memory) set_value_stack (retval, 1); -@@ -2577,6 +2582,19 @@ dwarf2_compile_property_to_c (struct ui_ +@@ -2660,6 +2665,19 @@ data, data + size, per_cu); } diff --git a/gdb.spec b/gdb.spec index 046fbd3..946cc41 100644 --- a/gdb.spec +++ b/gdb.spec @@ -20,12 +20,12 @@ Summary(zh_CN.UTF-8): [开发]C和其他语言的调试器 Summary(zh_TW.UTF-8): [.-A開發]C和.$)B其.-A他語.$)B言的調試器 %define snap 20120926 Name: gdb -Version: 7.10 +Version: 7.11.1 Release: 1 License: GPL v3+ Group: Development/Debuggers Source0: http://ftp.gnu.org/gnu/gdb/%{name}-%{version}.tar.xz -# Source0-md5: 2a35bac41fa8e10bf04f3a0dd7f7f363 +# Source0-md5: 5aa71522e488e358243917967db87476 Source1: http://www.mif.pg.gda.pl/homepages/ankry/man-PLD/%{name}-non-english-man-pages.tar.bz2 # Source1-md5: 2e8a48939ae282c12bbacdd54e398247 Source3: %{name}-gstack.man