From e1333f9f573445fda26e9820094c41e89c6d67718a879d30eef74b5ae40daa21 Mon Sep 17 00:00:00 2001 From: Richard Biener Date: Mon, 11 Aug 2014 14:08:48 +0000 Subject: [PATCH] - Use patchlist.pl to merge with gdb-7.8-16.fc22, a rebase to FSF GDB 4.8. The GDB 4.8 features are: * Guile scripting support. * Python scripting enhancements. * New commands: ** guile ** guile-repl ** info auto-load guile-scripts [REGEXP] * New options: ** maint ada set ignore-descriptive-types (on|off) ** maint set target-async (on|off) ** set|show auto-load guile-scripts (on|off) ** set|show auto-connect-native-target ** set|show guile print-stack (none|message|full) ** set|show mi-async (on|off) ** set|show print symbol-loading (off|brief|full) ** set|show record btrace replay-memory-access (read-only|read-write) * Remote Protocol: ** The qXfer:btrace:read packet supports a new annex 'delta'. * GDB/MI: ** A new option "-gdb-set mi-async" replaces "-gdb-set target-async". * New target configurations: ** PowerPC64 GNU/Linux little-endian * btrace enhancements: ** The btrace record target now supports the 'record goto' command. ** The btrace record target supports limited reverse execution and replay. * ISO C99 variable length automatic arrays support. * It is no longer required to "set target-async on" in order to use background execution commands (e.g., "c&", "s&", etc.). OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=102 --- gdb-6.3-test-pie-20050107.patch | 58 +- ...379-solib-trampoline-lookup-lock-fix.patch | 14 +- gdb-6.6-buildid-locate-core-as-arg.patch | 36 +- ...warning-missing-debuginfo-rhbz981154.patch | 131 + gdb-6.6-buildid-locate-rpm.patch | 108 +- gdb-6.6-buildid-locate.patch | 102 +- ....6-scheduler_locking-step-is-default.patch | 30 +- ...heduler_locking-step-sw-watchpoints2.patch | 156 +- gdb-6.8-attach-signalled-detach-stopped.patch | 32 +- gdb-6.8-quit-never-aborts.patch | 64 +- gdb-7.7-bnc877566.patch | 26 - gdb-7.7.tar.bz2 | 3 - gdb-7.8.tar.bz2 | 3 + gdb-archer-pie-addons-keep-disabled.patch | 28 +- gdb-archer-pie-addons.patch | 48 +- gdb-archer-vla-tests.patch | 2795 ++++++ gdb-archer.patch | 7731 +---------------- gdb-attach-fail-reasons-5of5.patch | 110 +- gdb-babeltrace-configure.patch | 85 + gdb-btrobust.patch | 82 + gdb-bz533176-fortran-omp-step.patch | 20 +- gdb-bz541866-rwatch-before-run.patch | 35 +- gdb-dts-rhel6-python-compat.patch | 308 + gdb-fix-s390-build.patch | 13 - gdb-fortran-frame-string.patch | 104 + gdb-glibc-strstr-workaround.patch | 19 +- gdb-gnat-dwarf-crash-3of3.patch | 58 + gdb-ia64-tdep.patch | 39 - gdb-ppc64le.patch | 1198 --- gdb-python-completer-1of2.patch | 747 ++ gdb-python-completer-2of2.patch | 72 + gdb-readline-6.3.5.patch | 90 + gdb-rhbz795424-bitpos-20of25.patch | 1214 +-- gdb-rhbz795424-bitpos-21of25.patch | 82 +- gdb-rhbz795424-bitpos-22of25.patch | 621 +- gdb-rhbz795424-bitpos-23of25.patch | 256 +- gdb-rhbz795424-bitpos-25of25.patch | 88 +- gdb-upstream.patch | 97 +- gdb-vla-intel-04of23-fix.patch | 42 + gdb-vla-intel-stringbt-fix.patch | 165 + gdb-vla-intel.patch | 3235 +++++++ gdb.changes | 66 + gdb.spec | 261 +- 43 files changed, 9703 insertions(+), 10769 deletions(-) create mode 100644 gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch delete mode 100644 gdb-7.7-bnc877566.patch delete mode 100644 gdb-7.7.tar.bz2 create mode 100644 gdb-7.8.tar.bz2 create mode 100644 gdb-archer-vla-tests.patch create mode 100644 gdb-babeltrace-configure.patch create mode 100644 gdb-btrobust.patch create mode 100644 gdb-dts-rhel6-python-compat.patch delete mode 100644 gdb-fix-s390-build.patch create mode 100644 gdb-fortran-frame-string.patch create mode 100644 gdb-gnat-dwarf-crash-3of3.patch delete mode 100644 gdb-ia64-tdep.patch delete mode 100644 gdb-ppc64le.patch create mode 100644 gdb-python-completer-1of2.patch create mode 100644 gdb-python-completer-2of2.patch create mode 100644 gdb-readline-6.3.5.patch create mode 100644 gdb-vla-intel-04of23-fix.patch create mode 100644 gdb-vla-intel-stringbt-fix.patch create mode 100644 gdb-vla-intel.patch diff --git a/gdb-6.3-test-pie-20050107.patch b/gdb-6.3-test-pie-20050107.patch index 6e9d562..8f3d392 100644 --- a/gdb-6.3-test-pie-20050107.patch +++ b/gdb-6.3-test-pie-20050107.patch @@ -1,29 +1,29 @@ -Index: gdb-7.6.90.20140127/gdb/testsuite/configure.ac +Index: gdb-7.7.50.20140609/gdb/testsuite/configure.ac =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/configure.ac 2014-01-27 22:41:19.281501688 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/configure.ac 2014-01-27 22:41:39.736517360 +0100 -@@ -96,6 +96,6 @@ AC_OUTPUT([Makefile \ +--- gdb-7.7.50.20140609.orig/gdb/testsuite/configure.ac 2014-06-13 20:05:33.058506817 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/configure.ac 2014-06-13 20:05:59.991532595 +0200 +@@ -97,6 +97,6 @@ AC_OUTPUT([Makefile \ gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile \ - gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile \ + gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile \ gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile \ - gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile \ + gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile \ gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile \ gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile]) -Index: gdb-7.6.90.20140127/gdb/testsuite/configure +Index: gdb-7.7.50.20140609/gdb/testsuite/configure =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/configure 2014-01-27 22:41:19.283501689 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/configure 2014-01-27 22:41:49.933525172 +0100 +--- gdb-7.7.50.20140609.orig/gdb/testsuite/configure 2014-06-13 20:05:29.956503899 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/configure 2014-06-13 20:06:24.492555709 +0200 @@ -3448,7 +3448,7 @@ done --ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" -+ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.fortran/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" +-ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" ++ac_config_files="$ac_config_files Makefile gdb.ada/Makefile gdb.arch/Makefile gdb.asm/Makefile gdb.base/Makefile gdb.btrace/Makefile gdb.cell/Makefile gdb.cp/Makefile gdb.disasm/Makefile gdb.dwarf2/Makefile gdb.dlang/Makefile gdb.fortran/Makefile gdb.gdb/Makefile gdb.go/Makefile gdb.server/Makefile gdb.java/Makefile gdb.hp/Makefile gdb.hp/gdb.objdbg/Makefile gdb.hp/gdb.base-hp/Makefile gdb.hp/gdb.aCC/Makefile gdb.hp/gdb.compat/Makefile gdb.hp/gdb.defects/Makefile gdb.guile/Makefile gdb.linespec/Makefile gdb.mi/Makefile gdb.modula2/Makefile gdb.multi/Makefile gdb.objc/Makefile gdb.opencl/Makefile gdb.opt/Makefile gdb.pascal/Makefile gdb.pie/Makefile gdb.perf/Makefile gdb.python/Makefile gdb.reverse/Makefile gdb.stabs/Makefile gdb.threads/Makefile gdb.trace/Makefile gdb.xml/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure -@@ -4176,6 +4176,7 @@ do +@@ -4179,6 +4179,7 @@ do "gdb.opencl/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opencl/Makefile" ;; "gdb.opt/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.opt/Makefile" ;; "gdb.pascal/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.pascal/Makefile" ;; @@ -31,10 +31,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/configure "gdb.perf/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.perf/Makefile" ;; "gdb.python/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.python/Makefile" ;; "gdb.reverse/Makefile") CONFIG_FILES="$CONFIG_FILES gdb.reverse/Makefile" ;; -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.c +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.c 2014-01-27 22:41:19.284501690 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.c 2014-06-13 20:05:33.060506819 +0200 @@ -0,0 +1,20 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -56,10 +56,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.c + } + return 0; +} -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach2.c +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach2.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach2.c 2014-01-27 22:41:19.284501690 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach2.c 2014-06-13 20:05:33.060506819 +0200 @@ -0,0 +1,24 @@ +/* This program is intended to be started outside of gdb, and then + attached to by gdb. Thus, it simply spins in a loop. The loop @@ -85,10 +85,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach2.c + } + return (0); +} -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.c +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.c 2014-01-27 22:41:19.284501690 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.c 2014-06-13 20:05:33.061506820 +0200 @@ -0,0 +1,146 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -236,10 +236,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.c + } + return 0; +} -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break1.c +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break1.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break1.c 2014-01-27 22:41:19.284501690 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break1.c 2014-06-13 20:05:33.061506820 +0200 @@ -0,0 +1,44 @@ +/* This testcase is part of GDB, the GNU debugger. + @@ -285,10 +285,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break1.c +void marker3 (a, b) char *a, *b; {} /* set breakpoint 18 here */ +void marker4 (d) long d; {} /* set breakpoint 13 here */ +#endif -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/coremaker.c +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/coremaker.c =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/coremaker.c 2014-01-27 22:41:19.284501690 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/coremaker.c 2014-06-13 20:05:33.061506820 +0200 @@ -0,0 +1,142 @@ +/* Copyright 1992, 1993, 1994, 1995, 1996, 1999 + Free Software Foundation, Inc. @@ -432,10 +432,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/coremaker.c + return 0; +} + -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.exp 2014-01-27 22:41:19.285501691 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/attach.exp 2014-06-13 20:05:33.061506820 +0200 @@ -0,0 +1,417 @@ +# Copyright 1997, 1999, 2002 Free Software Foundation, Inc. + @@ -854,10 +854,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/attach.exp +do_call_attach_tests + +return 0 -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.exp 2014-01-27 22:41:19.286501691 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/break.exp 2014-06-13 20:05:33.062506821 +0200 @@ -0,0 +1,962 @@ +# Copyright 1988, 1990, 1991, 1992, 1994, 1995, 1996, 1997, 1998, 1999, +# 2000, 2002, 2003, 2004 @@ -1821,10 +1821,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/break.exp + send_gdb "set args main\n" + gdb_expect -re ".*$gdb_prompt $" {} +} -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/corefile.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/corefile.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/corefile.exp 2014-01-27 22:41:19.286501691 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/corefile.exp 2014-06-13 20:05:33.063506822 +0200 @@ -0,0 +1,233 @@ +# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 +# Free Software Foundation, Inc. @@ -2059,10 +2059,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/corefile.exp +gdb_test "up" "#\[0-9\]* *\[0-9xa-fH'\]* in .* \\(.*\\).*" "up in corefile.exp (reinit)" + +gdb_test "core" "No core file now." -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/Makefile.in +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/Makefile.in =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.pie/Makefile.in 2014-01-27 22:41:19.286501691 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.pie/Makefile.in 2014-06-13 20:05:33.063506822 +0200 @@ -0,0 +1,19 @@ +VPATH = @srcdir@ +srcdir = @srcdir@ diff --git a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch index 6153cec..8b89ea9 100644 --- a/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +++ b/gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch @@ -1,11 +1,11 @@ https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=218379 -Index: gdb-7.6.50.20130731-cvs/gdb/symtab.c +Index: gdb-7.7.90.20140613/gdb/symtab.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/symtab.c 2013-08-02 17:06:19.854663801 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/symtab.c 2013-08-02 17:07:04.317721471 +0200 -@@ -2327,6 +2327,13 @@ find_pc_sect_line (CORE_ADDR pc, struct +--- gdb-7.7.90.20140613.orig/gdb/symtab.c 2014-06-13 21:52:06.219338401 +0200 ++++ gdb-7.7.90.20140613/gdb/symtab.c 2014-06-13 21:55:02.753531885 +0200 +@@ -2394,6 +2394,13 @@ find_pc_sect_line (CORE_ADDR pc, struct SYMBOL_LINKAGE_NAME (msymbol)); */ ; /* fall through */ @@ -13,9 +13,9 @@ Index: gdb-7.6.50.20130731-cvs/gdb/symtab.c + but this text symbol may be the address we were looking for. + Avoid `find_pc_sect_line'<->`find_pc_line' infinite loop. + Red Hat Bug 218379. */ -+ else if (SYMBOL_VALUE (mfunsym) == pc) -+ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", SYMBOL_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), pc)); ++ else if (BMSYMBOL_VALUE_ADDRESS (mfunsym) == pc) ++ warning ("In stub for %s (0x%s); interlocked, please submit the binary to http://bugzilla.redhat.com", MSYMBOL_LINKAGE_NAME (msymbol.minsym), paddress (target_gdbarch (), pc)); + /* fall through */ else - return find_pc_line (SYMBOL_VALUE_ADDRESS (mfunsym), 0); + return find_pc_line (BMSYMBOL_VALUE_ADDRESS (mfunsym), 0); } diff --git a/gdb-6.6-buildid-locate-core-as-arg.patch b/gdb-6.6-buildid-locate-core-as-arg.patch index 2ef4255..3ad5e62 100644 --- a/gdb-6.6-buildid-locate-core-as-arg.patch +++ b/gdb-6.6-buildid-locate-core-as-arg.patch @@ -58,13 +58,13 @@ Http://sourceware.org/ml/gdb-patches/2010-01/msg00517.html * exec.c (exec_file_attach): Print a more useful error message if the user did "gdb core". -Index: gdb-7.6.90.20140127/gdb/exceptions.h +Index: gdb-7.7.50.20140609/gdb/exceptions.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/exceptions.h 2014-02-06 17:31:00.148529736 +0100 -+++ gdb-7.6.90.20140127/gdb/exceptions.h 2014-02-06 17:31:17.560548525 +0100 -@@ -97,6 +97,9 @@ enum errors { - /* An undefined command was executed. */ - UNDEFINED_COMMAND_ERROR, +--- gdb-7.7.50.20140609.orig/gdb/exceptions.h 2014-06-13 20:26:46.988804553 +0200 ++++ gdb-7.7.50.20140609/gdb/exceptions.h 2014-06-13 20:27:01.930820057 +0200 +@@ -100,6 +100,9 @@ enum errors { + /* Requested feature, method, mechanism, etc. is not supported. */ + NOT_SUPPORTED_ERROR, + /* Attempt to load a core file as executable. */ + IS_CORE_ERROR, @@ -72,19 +72,19 @@ Index: gdb-7.6.90.20140127/gdb/exceptions.h /* Add more errors here. */ NR_ERRORS }; -Index: gdb-7.6.90.20140127/gdb/exec.c +Index: gdb-7.7.50.20140609/gdb/exec.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/exec.c 2014-02-06 17:30:58.266527708 +0100 -+++ gdb-7.6.90.20140127/gdb/exec.c 2014-02-06 17:31:00.149529737 +0100 -@@ -34,6 +34,7 @@ - #include "gdbthread.h" +--- gdb-7.7.50.20140609.orig/gdb/exec.c 2014-06-13 20:26:44.831802315 +0200 ++++ gdb-7.7.50.20140609/gdb/exec.c 2014-06-13 20:27:17.282836454 +0200 +@@ -35,6 +35,7 @@ #include "progspace.h" #include "gdb_bfd.h" + #include "gcore.h" +#include "exceptions.h" #include #include "readline/readline.h" -@@ -228,12 +229,27 @@ exec_file_attach (char *filename, int fr +@@ -231,12 +232,27 @@ exec_file_attach (char *filename, int fr if (!bfd_check_format_matches (exec_bfd, bfd_object, &matching)) { @@ -115,11 +115,11 @@ Index: gdb-7.6.90.20140127/gdb/exec.c } if (build_section_table (exec_bfd, §ions, §ions_end)) -Index: gdb-7.6.90.20140127/gdb/main.c +Index: gdb-7.7.50.20140609/gdb/main.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/main.c 2014-02-06 17:30:58.267527709 +0100 -+++ gdb-7.6.90.20140127/gdb/main.c 2014-02-06 17:32:32.232629052 +0100 -@@ -307,6 +307,36 @@ typedef struct cmdarg { +--- gdb-7.7.50.20140609.orig/gdb/main.c 2014-06-13 20:26:44.831802315 +0200 ++++ gdb-7.7.50.20140609/gdb/main.c 2014-06-13 20:26:46.990804555 +0200 +@@ -341,6 +341,36 @@ typedef struct cmdarg { /* Define type VEC (cmdarg_s). */ DEF_VEC_O (cmdarg_s); @@ -156,7 +156,7 @@ Index: gdb-7.6.90.20140127/gdb/main.c static int captured_main (void *data) { -@@ -824,6 +854,8 @@ captured_main (void *data) +@@ -854,6 +884,8 @@ captured_main (void *data) { symarg = argv[optind]; execarg = argv[optind]; @@ -165,7 +165,7 @@ Index: gdb-7.6.90.20140127/gdb/main.c optind++; } -@@ -987,11 +1019,25 @@ captured_main (void *data) +@@ -1017,11 +1049,25 @@ captured_main (void *data) && symarg != NULL && strcmp (execarg, symarg) == 0) { 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 new file mode 100644 index 0000000..dbb0395 --- /dev/null +++ b/gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch @@ -0,0 +1,131 @@ +Comments by Sergio Durigan Junior : + + This is the fix for RH BZ #981154 + + It is mainly a testcase addition, but a minor fix in the gdb/build-id.c + file was also needed. + + gdb/build-id.c was added by: + + commit dc294be54c96414035eed7d53dafdea0a6f31a72 + Author: Tom Tromey + Date: Tue Oct 8 19:56:15 2013 +0000 + + and had a little thinko there. The variable 'filename' needs to be set to + 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.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp +=================================================================== +--- /dev/null ++++ gdb-7.7/gdb/testsuite/gdb.base/rhbz981154-misleading-yum-install-warning.exp +@@ -0,0 +1,97 @@ ++# Copyright (C) 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 "normal.c" ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile}] } { ++ return -1 ++} ++ ++# Get the build-id of the file ++set build_id_debug_file [build_id_debug_filename_get $binfile] ++regsub -all ".debug$" $build_id_debug_file "" build_id_without_debug ++ ++# Run to main ++if { ![runto_main] } { ++ return -1 ++} ++ ++# We first need to generate a corefile ++set escapedfilename [string_to_regexp ${objdir}/${subdir}/gcore.test] ++set core_supported 0 ++gdb_test_multiple "gcore ${objdir}/${subdir}/gcore.test" \ ++ "save a corefile" \ ++{ ++ -re "Saved corefile ${escapedfilename}\[\r\n\]+$gdb_prompt $" { ++ pass "save a corefile" ++ global core_supported ++ set core_supported 1 ++ } ++ -re "Can't create a corefile\[\r\n\]+$gdb_prompt $" { ++ unsupported "save a corefile" ++ global core_supported ++ set core_supported 0 ++ } ++} ++ ++if {!$core_supported} { ++ return -1 ++} ++ ++# Move the binfile to a temporary name ++remote_exec build "mv $binfile ${binfile}.old" ++ ++# Reinitialize GDB and see if we get a yum warning ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++with_test_prefix "first run:" { ++ gdb_test "set build-id-verbose 1" "" \ ++ "set build-id-verbose" ++ ++ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ "set debug-file-directory" ++ ++ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ ++ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $objdir/$subdir/$build_id_without_debug\r\n.*" \ ++ "test first yum warning" ++} ++ ++# Now we define and create our .build-id ++file mkdir [file dirname ${objdir}/${subdir}/${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}" ++ ++# Reinitialize GDB to get the second yum warning ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++ ++with_test_prefix "second run:" { ++ gdb_test "set build-id-verbose 1" "" \ ++ "set build-id-verbose" ++ ++ gdb_test "set debug-file-directory ${objdir}/${subdir}" "" \ ++ "set debug-file-directory" ++ ++ gdb_test "core-file ${objdir}/${subdir}/gcore.test" \ ++ "Missing separate debuginfo for the main executable file\r\nTry: yum --enablerepo='\\*debug\\*' install $binfile\r\n.*" \ ++ "test second yum 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.7/gdb/build-id.c +=================================================================== +--- gdb-7.7.orig/gdb/build-id.c ++++ gdb-7.7/gdb/build-id.c +@@ -588,6 +588,7 @@ build_id_to_debug_bfd (size_t build_id_l + if (abfd == NULL) + { + xfree (filename); ++ filename = NULL; + continue; + } + diff --git a/gdb-6.6-buildid-locate-rpm.patch b/gdb-6.6-buildid-locate-rpm.patch index 1cf789e..f43fbbf 100644 --- a/gdb-6.6-buildid-locate-rpm.patch +++ b/gdb-6.6-buildid-locate-rpm.patch @@ -1,8 +1,8 @@ -Index: gdb-7.6.90.20140127/gdb/event-top.c +Index: gdb-7.7.50.20140609/gdb/event-top.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/event-top.c 2014-02-06 17:18:26.965717210 +0100 -+++ gdb-7.6.90.20140127/gdb/event-top.c 2014-02-06 16:59:23.174474404 +0100 -@@ -37,6 +37,7 @@ +--- gdb-7.7.50.20140609.orig/gdb/event-top.c 2014-06-13 20:10:19.632787642 +0200 ++++ gdb-7.7.50.20140609/gdb/event-top.c 2014-06-13 20:11:49.605878557 +0200 +@@ -38,6 +38,7 @@ #include "gdbcmd.h" /* for dont_repeat() */ #include "annotate.h" #include "maint.h" @@ -10,7 +10,7 @@ Index: gdb-7.6.90.20140127/gdb/event-top.c /* readline include files. */ #include "readline/readline.h" -@@ -173,6 +174,8 @@ rl_callback_read_char_wrapper (gdb_clien +@@ -176,6 +177,8 @@ rl_callback_read_char_wrapper (gdb_clien void cli_command_loop (void *data) { @@ -19,20 +19,20 @@ Index: gdb-7.6.90.20140127/gdb/event-top.c display_gdb_prompt (0); /* Now it's time to start the event loop. */ -@@ -240,6 +243,8 @@ display_gdb_prompt (char *new_prompt) +@@ -243,6 +246,8 @@ display_gdb_prompt (char *new_prompt) /* Reset the nesting depth used when trace-commands is set. */ reset_command_nest_depth (); + debug_flush_missing (); + - /* Each interpreter has its own rules on displaying the command - prompt. */ - if (!current_interp_display_prompt_p ()) -Index: gdb-7.6.90.20140127/gdb/symfile.h + 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.7.50.20140609/gdb/symfile.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/symfile.h 2014-02-06 17:18:33.865724666 +0100 -+++ gdb-7.6.90.20140127/gdb/symfile.h 2014-02-06 17:08:56.282099150 +0100 -@@ -557,6 +557,8 @@ extern struct cleanup *increment_reading +--- gdb-7.7.50.20140609.orig/gdb/symfile.h 2014-06-13 20:10:19.633787643 +0200 ++++ gdb-7.7.50.20140609/gdb/symfile.h 2014-06-13 20:10:31.066799158 +0200 +@@ -573,6 +573,8 @@ void map_symbol_filenames (symbol_filena /* build-id support. */ extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr); extern void debug_print_missing (const char *binary, const char *debug); @@ -41,11 +41,11 @@ Index: gdb-7.6.90.20140127/gdb/symfile.h /* From dwarf2read.c */ -Index: gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/lib/gdb.exp 2014-02-06 17:18:26.969717214 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp 2014-02-06 17:18:33.866724667 +0100 -@@ -1504,7 +1504,7 @@ proc default_gdb_start { } { +--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/gdb.exp 2014-06-13 20:10:19.634787644 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp 2014-06-13 20:10:31.067799159 +0200 +@@ -1492,7 +1492,7 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -54,10 +54,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp send_gdb "set build-id-verbose 0\n" gdb_expect 10 { -re "$gdb_prompt $" { -Index: gdb-7.6.90.20140127/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/lib/mi-support.exp 2014-02-06 17:18:26.970717215 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/lib/mi-support.exp 2014-02-06 17:18:33.867724668 +0100 +--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:10:19.635787645 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:10:31.068799160 +0200 @@ -212,7 +212,7 @@ proc default_mi_gdb_start { args } { warning "Couldn't set the width to 0." } @@ -67,22 +67,22 @@ Index: gdb-7.6.90.20140127/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.6.90.20140127/gdb/tui/tui-interp.c +Index: gdb-7.7.50.20140609/gdb/tui/tui-interp.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/tui/tui-interp.c 2014-02-06 17:18:26.970717215 +0100 -+++ gdb-7.6.90.20140127/gdb/tui/tui-interp.c 2014-02-06 17:18:33.867724668 +0100 -@@ -30,6 +30,7 @@ - #include "tui/tui.h" - #include "tui/tui-io.h" +--- gdb-7.7.50.20140609.orig/gdb/tui/tui-interp.c 2014-06-13 20:10:31.068799160 +0200 ++++ gdb-7.7.50.20140609/gdb/tui/tui-interp.c 2014-06-13 20:10:47.806816542 +0200 +@@ -32,6 +32,7 @@ #include "exceptions.h" + #include "infrun.h" + #include "observer.h" +#include "symfile.h" - /* Set to 1 when the TUI mode must be activated when we first start - gdb. */ -Index: gdb-7.6.90.20140127/gdb/aclocal.m4 + static struct ui_out *tui_ui_out (struct interp *self); + +Index: gdb-7.7.50.20140609/gdb/aclocal.m4 =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/aclocal.m4 2014-02-06 17:18:33.868724669 +0100 -+++ gdb-7.6.90.20140127/gdb/aclocal.m4 2014-02-06 17:09:49.877157405 +0100 +--- gdb-7.7.50.20140609.orig/gdb/aclocal.m4 2014-06-13 20:10:19.636787646 +0200 ++++ gdb-7.7.50.20140609/gdb/aclocal.m4 2014-06-13 20:10:31.069799161 +0200 @@ -11,6 +11,221 @@ # even the implied warranty of MERCHANTABILITY or FITNESS FOR A # PARTICULAR PURPOSE. @@ -305,10 +305,10 @@ Index: gdb-7.6.90.20140127/gdb/aclocal.m4 # AM_AUX_DIR_EXPAND -*- Autoconf -*- # Copyright (C) 2001, 2003, 2005 Free Software Foundation, Inc. -Index: gdb-7.6.90.20140127/gdb/config.in +Index: gdb-7.7.50.20140609/gdb/config.in =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/config.in 2014-02-06 17:18:26.971717216 +0100 -+++ gdb-7.6.90.20140127/gdb/config.in 2014-02-06 17:18:33.868724669 +0100 +--- gdb-7.7.50.20140609.orig/gdb/config.in 2014-06-13 20:10:19.637787647 +0200 ++++ gdb-7.7.50.20140609/gdb/config.in 2014-06-13 20:10:31.069799161 +0200 @@ -33,6 +33,9 @@ /* Define to BFD's default target vector. */ #undef DEFAULT_BFD_VEC @@ -319,7 +319,7 @@ Index: gdb-7.6.90.20140127/gdb/config.in /* Define to 1 if translation of program messages to the user's native language is requested. */ #undef ENABLE_NLS -@@ -207,6 +210,9 @@ +@@ -210,6 +213,9 @@ /* Define if Python 2.7 is being used. */ #undef HAVE_LIBPYTHON2_7 @@ -329,11 +329,11 @@ Index: gdb-7.6.90.20140127/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -Index: gdb-7.6.90.20140127/gdb/configure +Index: gdb-7.7.50.20140609/gdb/configure =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/configure 2014-02-06 17:18:26.976717221 +0100 -+++ gdb-7.6.90.20140127/gdb/configure 2014-02-06 17:18:33.872724673 +0100 -@@ -689,6 +689,11 @@ PKGVERSION +--- gdb-7.7.50.20140609.orig/gdb/configure 2014-06-13 20:10:19.642787652 +0200 ++++ gdb-7.7.50.20140609/gdb/configure 2014-06-13 20:10:31.073799165 +0200 +@@ -692,6 +692,11 @@ PKGVERSION HAVE_NATIVE_GCORE_TARGET TARGET_OBS subdirs @@ -345,7 +345,7 @@ Index: gdb-7.6.90.20140127/gdb/configure GDB_DATADIR DEBUGDIR MAKEINFO_EXTRA_FLAGS -@@ -792,6 +797,7 @@ with_gdb_datadir +@@ -795,6 +800,7 @@ with_gdb_datadir with_relocated_sources with_auto_load_dir with_auto_load_safe_path @@ -353,7 +353,7 @@ Index: gdb-7.6.90.20140127/gdb/configure enable_targets enable_64_bit_bfd enable_gdbcli -@@ -842,6 +848,11 @@ CPPFLAGS +@@ -846,6 +852,11 @@ CPPFLAGS CPP MAKEINFO MAKEINFOFLAGS @@ -365,7 +365,7 @@ Index: gdb-7.6.90.20140127/gdb/configure YACC YFLAGS XMKMF' -@@ -1512,6 +1523,8 @@ Optional Packages: +@@ -1516,6 +1527,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.6.90.20140127/gdb/configure --with-libunwind-ia64 use libunwind frame unwinding for ia64 targets --with-curses use the curses library instead of the termcap library -@@ -1559,6 +1572,13 @@ Some influential environment variables: +@@ -1565,6 +1578,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.6.90.20140127/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. -@@ -5154,6 +5174,491 @@ _ACEOF +@@ -5160,6 +5180,491 @@ _ACEOF { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_auto_load_safe_path" >&5 $as_echo "$with_auto_load_safe_path" >&6; } @@ -880,10 +880,10 @@ Index: gdb-7.6.90.20140127/gdb/configure subdirs="$subdirs testsuite" -Index: gdb-7.6.90.20140127/gdb/configure.ac +Index: gdb-7.7.50.20140609/gdb/configure.ac =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/configure.ac 2014-02-06 17:18:26.977717223 +0100 -+++ gdb-7.6.90.20140127/gdb/configure.ac 2014-02-06 17:18:33.873724674 +0100 +--- gdb-7.7.50.20140609.orig/gdb/configure.ac 2014-06-13 20:10:19.643787653 +0200 ++++ gdb-7.7.50.20140609/gdb/configure.ac 2014-06-13 20:10:31.074799166 +0200 @@ -165,6 +165,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,11 +1084,11 @@ Index: gdb-7.6.90.20140127/gdb/configure.ac AC_CONFIG_SUBDIRS(testsuite) # Check whether to support alternative target configurations -Index: gdb-7.6.90.20140127/gdb/corelow.c +Index: gdb-7.7.50.20140609/gdb/corelow.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/corelow.c 2014-02-06 17:18:26.978717224 +0100 -+++ gdb-7.6.90.20140127/gdb/corelow.c 2014-02-06 17:18:33.873724674 +0100 -@@ -315,7 +315,7 @@ build_id_locate_exec (int from_tty) +--- gdb-7.7.50.20140609.orig/gdb/corelow.c 2014-06-13 20:10:19.644787654 +0200 ++++ gdb-7.7.50.20140609/gdb/corelow.c 2014-06-13 20:10:31.074799166 +0200 +@@ -316,7 +316,7 @@ build_id_locate_exec (int from_tty) symfile_objfile->flags |= OBJF_BUILD_ID_CORE_LOADED; } else @@ -1097,10 +1097,10 @@ Index: gdb-7.6.90.20140127/gdb/corelow.c do_cleanups (back_to); -Index: gdb-7.6.90.20140127/gdb/build-id.c +Index: gdb-7.7.50.20140609/gdb/build-id.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-02-06 17:18:26.842717077 +0100 -+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 17:08:18.341060295 +0100 +--- gdb-7.7.50.20140609.orig/gdb/build-id.c 2014-06-13 20:10:19.644787654 +0200 ++++ gdb-7.7.50.20140609/gdb/build-id.c 2014-06-13 20:10:31.075799167 +0200 @@ -32,6 +32,7 @@ #include "gdbcmd.h" #include "observer.h" diff --git a/gdb-6.6-buildid-locate.patch b/gdb-6.6-buildid-locate.patch index 9177116..95cfd56 100644 --- a/gdb-6.6-buildid-locate.patch +++ b/gdb-6.6-buildid-locate.patch @@ -1,8 +1,8 @@ -Index: gdb-7.6.90.20140127/gdb/corelow.c +Index: gdb-7.7.50.20140609/gdb/corelow.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/corelow.c 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/corelow.c 2014-02-06 16:46:52.261646499 +0100 -@@ -48,6 +48,10 @@ +--- gdb-7.7.50.20140609.orig/gdb/corelow.c 2014-06-13 20:09:37.369745221 +0200 ++++ gdb-7.7.50.20140609/gdb/corelow.c 2014-06-13 20:09:42.407750265 +0200 +@@ -49,6 +49,10 @@ #include "gdb_bfd.h" #include "completer.h" #include "filestuff.h" @@ -13,7 +13,7 @@ Index: gdb-7.6.90.20140127/gdb/corelow.c #ifndef O_LARGEFILE #define O_LARGEFILE 0 -@@ -271,6 +275,53 @@ add_to_thread_list (bfd *abfd, asection +@@ -272,6 +276,53 @@ add_to_thread_list (bfd *abfd, asection inferior_ptid = ptid; /* Yes, make it current. */ } @@ -67,7 +67,7 @@ Index: gdb-7.6.90.20140127/gdb/corelow.c /* This routine opens and sets up the core file bfd. */ static void -@@ -409,6 +460,14 @@ core_open (char *filename, int from_tty) +@@ -410,6 +461,14 @@ core_open (char *filename, int from_tty) switch_to_thread (thread->ptid); } @@ -82,7 +82,7 @@ Index: gdb-7.6.90.20140127/gdb/corelow.c post_create_inferior (&core_ops, from_tty); /* Now go through the target stack looking for threads since there -@@ -980,4 +1039,11 @@ _initialize_corelow (void) +@@ -1029,4 +1088,11 @@ _initialize_corelow (void) init_core_ops (); add_target_with_completer (&core_ops, filename_completer); @@ -94,11 +94,11 @@ Index: gdb-7.6.90.20140127/gdb/corelow.c + NULL, NULL, NULL, + &setlist, &showlist); } -Index: gdb-7.6.90.20140127/gdb/doc/gdb.texinfo +Index: gdb-7.7.50.20140609/gdb/doc/gdb.texinfo =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/doc/gdb.texinfo 2014-02-06 16:46:51.804645989 +0100 -+++ gdb-7.6.90.20140127/gdb/doc/gdb.texinfo 2014-02-06 16:46:52.110646331 +0100 -@@ -17413,6 +17413,27 @@ information files. +--- gdb-7.7.50.20140609.orig/gdb/doc/gdb.texinfo 2014-06-13 20:09:37.380745232 +0200 ++++ gdb-7.7.50.20140609/gdb/doc/gdb.texinfo 2014-06-13 20:09:42.417750275 +0200 +@@ -17547,6 +17547,27 @@ information files. @end table @@ -126,11 +126,11 @@ Index: gdb-7.6.90.20140127/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.6.90.20140127/gdb/solib-svr4.c +Index: gdb-7.7.50.20140609/gdb/solib-svr4.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/solib-svr4.c 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/solib-svr4.c 2014-02-06 16:49:27.508819174 +0100 -@@ -47,6 +47,7 @@ +--- gdb-7.7.50.20140609.orig/gdb/solib-svr4.c 2014-06-13 20:09:37.382745234 +0200 ++++ gdb-7.7.50.20140609/gdb/solib-svr4.c 2014-06-13 20:09:42.418750276 +0200 +@@ -48,6 +48,7 @@ #include "exceptions.h" #include "gdb_bfd.h" #include "probe.h" @@ -194,11 +194,11 @@ Index: gdb-7.6.90.20140127/gdb/solib-svr4.c xfree (buffer); /* If this entry has no name, or its name matches the name -Index: gdb-7.6.90.20140127/gdb/elfread.c +Index: gdb-7.7.50.20140609/gdb/elfread.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/elfread.c 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/elfread.c 2014-02-06 16:46:52.249646486 +0100 -@@ -1316,9 +1316,10 @@ elf_symfile_read (struct objfile *objfil +--- gdb-7.7.50.20140609.orig/gdb/elfread.c 2014-06-13 20:09:37.383745235 +0200 ++++ gdb-7.7.50.20140609/gdb/elfread.c 2014-06-13 20:09:42.418750276 +0200 +@@ -1335,9 +1335,10 @@ elf_symfile_read (struct objfile *objfil && objfile->separate_debug_objfile == NULL && objfile->separate_debug_objfile_backlink == NULL) { @@ -211,7 +211,7 @@ Index: gdb-7.6.90.20140127/gdb/elfread.c if (debugfile == NULL) debugfile = find_separate_debug_file_by_debuglink (objfile); -@@ -1332,6 +1333,12 @@ elf_symfile_read (struct objfile *objfil +@@ -1351,6 +1352,12 @@ elf_symfile_read (struct objfile *objfil symbol_file_add_separate (abfd, debugfile, symfile_flags, objfile); do_cleanups (cleanup); } @@ -224,13 +224,13 @@ Index: gdb-7.6.90.20140127/gdb/elfread.c } } -Index: gdb-7.6.90.20140127/gdb/symfile.h +Index: gdb-7.7.50.20140609/gdb/symfile.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/symfile.h 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/symfile.h 2014-02-06 16:46:52.250646487 +0100 -@@ -554,6 +554,10 @@ void free_symfile_segment_data (struct s - - extern struct cleanup *increment_reading_symtab (void); +--- gdb-7.7.50.20140609.orig/gdb/symfile.h 2014-06-13 20:09:42.419750277 +0200 ++++ gdb-7.7.50.20140609/gdb/symfile.h 2014-06-13 20:10:04.478772510 +0200 +@@ -570,6 +570,10 @@ void expand_symtabs_matching (expand_sym + void map_symbol_filenames (symbol_filename_ftype *fun, void *data, + int need_fullname); +/* build-id support. */ +extern struct elf_build_id *build_id_addr_get (CORE_ADDR addr); @@ -239,11 +239,11 @@ Index: gdb-7.6.90.20140127/gdb/symfile.h /* From dwarf2read.c */ /* Names for a dwarf2 debugging section. The field NORMAL is the normal -Index: gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/lib/gdb.exp 2014-02-06 16:46:51.643645810 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp 2014-02-06 16:46:52.251646488 +0100 -@@ -1504,6 +1504,16 @@ proc default_gdb_start { } { +--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:37.384745236 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/lib/gdb.exp 2014-06-13 20:09:42.420750278 +0200 +@@ -1492,6 +1492,16 @@ proc default_gdb_start { } { warning "Couldn't set the width to 0." } } @@ -260,10 +260,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/lib/gdb.exp return 0 } -Index: gdb-7.6.90.20140127/gdb/testsuite/lib/mi-support.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/lib/mi-support.exp 2014-01-27 02:57:54.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/lib/mi-support.exp 2014-02-06 16:46:52.252646489 +0100 +--- gdb-7.7.50.20140609.orig/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:37.385745237 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/lib/mi-support.exp 2014-06-13 20:09:42.421750279 +0200 @@ -212,6 +212,16 @@ proc default_mi_gdb_start { args } { warning "Couldn't set the width to 0." } @@ -281,11 +281,11 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/lib/mi-support.exp # If allowing the inferior to have its own PTY then assign the inferior # its own terminal device here. if { $separate_inferior_pty } { -Index: gdb-7.6.90.20140127/gdb/objfiles.h +Index: gdb-7.7.50.20140609/gdb/objfiles.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/objfiles.h 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/objfiles.h 2014-02-06 16:46:52.113646334 +0100 -@@ -436,6 +436,10 @@ struct objfile +--- gdb-7.7.50.20140609.orig/gdb/objfiles.h 2014-06-13 20:09:37.385745237 +0200 ++++ gdb-7.7.50.20140609/gdb/objfiles.h 2014-06-13 20:09:42.421750279 +0200 +@@ -464,6 +464,10 @@ struct objfile #define OBJF_NOT_FILENAME (1 << 6) @@ -296,11 +296,11 @@ Index: gdb-7.6.90.20140127/gdb/objfiles.h /* Declarations for functions defined in objfiles.c */ extern struct objfile *allocate_objfile (bfd *, const char *name, int); -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/corefile.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/gdb.base/corefile.exp 2014-01-27 02:57:54.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.base/corefile.exp 2014-02-06 16:46:52.113646334 +0100 -@@ -281,3 +281,33 @@ gdb_test_multiple "core-file $corefile" +--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:37.385745237 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.base/corefile.exp 2014-06-13 20:09:42.421750279 +0200 +@@ -293,3 +293,33 @@ gdb_test_multiple "core-file $corefile" pass $test } } @@ -334,10 +334,10 @@ Index: gdb-7.6.90.20140127/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.6.90.20140127/gdb/build-id.c +Index: gdb-7.7.50.20140609/gdb/build-id.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/build-id.c 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/build-id.c 2014-02-06 16:46:52.113646334 +0100 +--- gdb-7.7.50.20140609.orig/gdb/build-id.c 2014-06-13 20:09:37.386745238 +0200 ++++ gdb-7.7.50.20140609/gdb/build-id.c 2014-06-13 20:09:42.422750280 +0200 @@ -27,11 +27,65 @@ #include "symfile.h" #include "objfiles.h" @@ -1160,10 +1160,10 @@ Index: gdb-7.6.90.20140127/gdb/build-id.c + + observer_attach_executable_changed (debug_print_executable_changed); +} -Index: gdb-7.6.90.20140127/gdb/build-id.h +Index: gdb-7.7.50.20140609/gdb/build-id.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/build-id.h 2014-01-27 02:57:53.000000000 +0100 -+++ gdb-7.6.90.20140127/gdb/build-id.h 2014-02-06 16:46:52.114646335 +0100 +--- gdb-7.7.50.20140609.orig/gdb/build-id.h 2014-06-13 20:09:37.386745238 +0200 ++++ gdb-7.7.50.20140609/gdb/build-id.h 2014-06-13 20:09:42.422750280 +0200 @@ -32,13 +32,18 @@ extern int build_id_verify (bfd *abfd, the caller. */ @@ -1185,11 +1185,11 @@ Index: gdb-7.6.90.20140127/gdb/build-id.h + char **build_id_filename_return); #endif /* BUILD_ID_H */ -Index: gdb-7.6.90.20140127/gdb/dwarf2read.c +Index: gdb-7.7.50.20140609/gdb/dwarf2read.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2read.c 2014-02-06 16:46:51.809645995 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2read.c 2014-02-06 16:49:55.679850414 +0100 -@@ -2429,7 +2429,7 @@ dwarf2_get_dwz_file (void) +--- gdb-7.7.50.20140609.orig/gdb/dwarf2read.c 2014-06-13 20:09:37.389745241 +0200 ++++ gdb-7.7.50.20140609/gdb/dwarf2read.c 2014-06-13 20:09:42.425750283 +0200 +@@ -2446,7 +2446,7 @@ dwarf2_get_dwz_file (void) } if (dwz_bfd == NULL) diff --git a/gdb-6.6-scheduler_locking-step-is-default.patch b/gdb-6.6-scheduler_locking-step-is-default.patch index 6e3e05d..0b1c521 100644 --- a/gdb-6.6-scheduler_locking-step-is-default.patch +++ b/gdb-6.6-scheduler_locking-step-is-default.patch @@ -1,8 +1,8 @@ -Index: gdb-7.6.90.20140127/gdb/infrun.c +Index: gdb-7.7.50.20140609/gdb/infrun.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/infrun.c 2014-02-04 23:48:27.262092869 +0100 -+++ gdb-7.6.90.20140127/gdb/infrun.c 2014-02-04 23:48:31.674096613 +0100 -@@ -1618,7 +1618,7 @@ static const char *const scheduler_enums +--- gdb-7.7.50.20140609.orig/gdb/infrun.c 2014-06-13 20:08:51.225699203 +0200 ++++ gdb-7.7.50.20140609/gdb/infrun.c 2014-06-13 20:08:55.515703466 +0200 +@@ -1661,7 +1661,7 @@ static const char *const scheduler_enums schedlock_step, NULL }; @@ -11,11 +11,11 @@ Index: gdb-7.6.90.20140127/gdb/infrun.c static void show_scheduler_mode (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value) -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-cli.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-cli.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2014-02-04 23:48:27.263092871 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-cli.exp 2014-02-04 23:48:31.674096613 +0100 -@@ -163,7 +163,7 @@ mi_execute_to "exec-continue" "breakpoin +--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.mi/mi-cli.exp 2014-06-13 20:08:55.515703466 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-cli.exp 2014-06-13 20:09:24.862732832 +0200 +@@ -181,7 +181,7 @@ mi_expect_stop "breakpoint-hit" "main" " # Test that the token is output even for CLI commands # Also test that *stopped includes frame information. mi_gdb_test "34 next" \ @@ -23,11 +23,11 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-cli.exp + ".*34\\\^running.*\\*running,thread-id=\"1\"" \ "34 next: run" - if {!$async} { -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-logging.exp + # Test that the new current source line is output to the console +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-logging.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2014-02-04 23:48:27.263092871 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-logging.exp 2014-02-04 23:48:31.674096613 +0100 +--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.mi/mi-logging.exp 2014-06-13 20:08:51.227699205 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-logging.exp 2014-06-13 20:08:55.516703467 +0200 @@ -53,7 +53,7 @@ close $chan set mi_log_prompt "\[(\]gdb\[)\] \[\r\n\]+" @@ -46,10 +46,10 @@ Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-logging.exp pass "Redirect log file contents" } else { fail "Redirect log file contents" -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-console.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-console.exp =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/testsuite/gdb.mi/mi-console.exp 2014-02-04 23:48:31.675096666 +0100 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.mi/mi-console.exp 2014-02-04 23:48:55.981127963 +0100 +--- gdb-7.7.50.20140609.orig/gdb/testsuite/gdb.mi/mi-console.exp 2014-06-13 20:08:51.227699205 +0200 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.mi/mi-console.exp 2014-06-13 20:08:55.516703467 +0200 @@ -60,6 +60,9 @@ if { [gdb_compile "${srcdir}/${subdir}/ mi_run_to_main diff --git a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch index c1e3a5e..1b51ec2 100644 --- a/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch +++ b/gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch @@ -21,41 +21,20 @@ Port to GDB-6.8pre. -Index: gdb-7.6.90.20140127/gdb/inferior.h +Index: gdb-7.7.90.20140613/gdb/infrun.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/inferior.h 2014-01-27 22:05:28.801895347 +0100 -+++ gdb-7.6.90.20140127/gdb/inferior.h 2014-01-27 22:33:45.230157813 +0100 -@@ -155,7 +155,15 @@ extern void reopen_exec_file (void); - /* The `resume' routine should only be called in special circumstances. - Normally, use `proceed', which handles a lot of bookkeeping. */ - --extern void resume (int, enum gdb_signal); -+enum resume_step -+ { -+ /* currently_stepping () should return non-zero for non-continue. */ -+ RESUME_STEP_CONTINUE = 0, -+ RESUME_STEP_USER, /* Stepping is intentional by the user. */ -+ RESUME_STEP_NEEDED /* Stepping only for software watchpoints. */ -+ }; -+ -+extern void resume (enum resume_step, enum gdb_signal); - - extern ptid_t user_visible_resume_ptid (int step); - -Index: gdb-7.6.90.20140127/gdb/infrun.c -=================================================================== ---- gdb-7.6.90.20140127.orig/gdb/infrun.c 2014-01-27 22:05:28.804895349 +0100 -+++ gdb-7.6.90.20140127/gdb/infrun.c 2014-01-27 22:35:12.781224279 +0100 -@@ -83,7 +83,7 @@ static int follow_fork (void); +--- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:36:43.637294782 +0200 +@@ -84,7 +84,7 @@ static int follow_fork (void); static void set_schedlock_func (char *args, int from_tty, struct cmd_list_element *c); -static int currently_stepping (struct thread_info *tp); +static enum resume_step currently_stepping (struct thread_info *tp); - static int currently_stepping_or_nexting_callback (struct thread_info *tp, - void *data); -@@ -1699,7 +1699,8 @@ user_visible_resume_ptid (int step) + static void xdb_handle_command (char *args, int from_tty); + +@@ -1742,7 +1742,8 @@ user_visible_resume_ptid (int step) } else if ((scheduler_mode == schedlock_on) || (scheduler_mode == schedlock_step @@ -65,16 +44,16 @@ Index: gdb-7.6.90.20140127/gdb/infrun.c { /* User-settable 'scheduler' mode requires solo thread resume. */ resume_ptid = inferior_ptid; -@@ -1717,7 +1718,7 @@ user_visible_resume_ptid (int step) +@@ -1760,7 +1761,7 @@ user_visible_resume_ptid (int step) STEP nonzero if we should step (zero to continue instead). SIG is the signal to give the inferior (zero for none). */ void -resume (int step, enum gdb_signal sig) +resume (enum resume_step step, enum gdb_signal sig) { - int should_resume = 1; struct cleanup *old_cleanups = make_cleanup (resume_cleanups, 0); -@@ -1750,9 +1751,13 @@ resume (int step, enum gdb_signal sig) + struct regcache *regcache = get_current_regcache (); +@@ -1800,9 +1801,13 @@ resume (int step, enum gdb_signal sig) if (debug_infrun) fprintf_unfiltered (gdb_stdlog, @@ -90,64 +69,59 @@ Index: gdb-7.6.90.20140127/gdb/infrun.c tp->control.trap_expected, target_pid_to_str (inferior_ptid), paddress (gdbarch, pc)); -@@ -2147,7 +2152,7 @@ proceed (CORE_ADDR addr, enum gdb_signal +@@ -2188,6 +2193,7 @@ proceed (CORE_ADDR addr, enum gdb_signal + struct thread_info *tp; CORE_ADDR pc; struct address_space *aspace; - /* GDB may force the inferior to step due to various reasons. */ -- int force_step = 0; + enum resume_step resume_step = RESUME_STEP_CONTINUE; /* If we're stopped at a fork/vfork, follow the branch set by the "set follow-fork-mode" command; otherwise, we'll just proceed -@@ -2187,13 +2192,13 @@ proceed (CORE_ADDR addr, enum gdb_signal +@@ -2230,13 +2236,19 @@ proceed (CORE_ADDR addr, enum gdb_signal + Note, we don't do this in reverse, because we won't actually be executing the breakpoint insn anyway. We'll be (un-)executing the previous instruction. */ - -- force_step = 1; ++ { + tp->stepping_over_breakpoint = 1; + resume_step = RESUME_STEP_USER; ++ } else if (gdbarch_single_step_through_delay_p (gdbarch) && gdbarch_single_step_through_delay (gdbarch, get_current_frame ())) /* We stepped onto an instruction that needs to be stepped again before re-inserting the breakpoint, do so. */ -- force_step = 1; ++ { + tp->stepping_over_breakpoint = 1; + resume_step = RESUME_STEP_USER; ++ } } else { -@@ -2225,13 +2230,13 @@ proceed (CORE_ADDR addr, enum gdb_signal - is required it returns TRUE and sets the current thread to - the old thread. */ - if (prepare_to_proceed (step)) -- force_step = 1; -+ resume_step = RESUME_STEP_USER; +@@ -2288,6 +2300,7 @@ proceed (CORE_ADDR addr, enum gdb_signal + tp->prev_pc = regcache_read_pc (get_current_regcache ()); + switch_to_thread (step_over->ptid); + tp = step_over; ++ resume_step = RESUME_STEP_USER; + } } - /* prepare_to_proceed may change the current thread. */ - tp = inferior_thread (); - -- if (force_step) -+ if (resume_step == RESUME_STEP_USER) - { - tp->control.trap_expected = 1; - /* If displaced stepping is enabled, we can step over the -@@ -2318,9 +2323,13 @@ proceed (CORE_ADDR addr, enum gdb_signal +@@ -2375,9 +2388,13 @@ proceed (CORE_ADDR addr, enum gdb_signal /* Reset to normal state. */ init_infwait_state (); -+ if (step) ++ if (tp->control.trap_expected || step) + resume_step = RESUME_STEP_USER; + if (resume_step == RESUME_STEP_CONTINUE && bpstat_should_step ()) + resume_step = RESUME_STEP_NEEDED; + /* Resume inferior. */ -- resume (force_step || step || bpstat_should_step (), +- resume (tp->control.trap_expected || step || bpstat_should_step (), - tp->suspend.stop_signal); + resume (resume_step, tp->suspend.stop_signal); /* Wait for it to stop (if not standalone) and in any case decode why it stopped, and act accordingly. */ -@@ -5332,13 +5341,18 @@ switch_back_to_stepped_thread (struct ex +@@ -5359,13 +5376,16 @@ switch_back_to_stepped_thread (struct ex /* Is thread TP in the middle of single-stepping? */ @@ -156,26 +130,23 @@ Index: gdb-7.6.90.20140127/gdb/infrun.c currently_stepping (struct thread_info *tp) { - return ((tp->control.step_range_end -- && tp->control.step_resume_breakpoint == NULL) ++ if ((tp->control.step_range_end + && tp->control.step_resume_breakpoint == NULL) - || tp->control.trap_expected - || bpstat_should_step ()); -+ if ((tp->control.step_range_end -+ && tp->control.step_resume_breakpoint == NULL) -+ || tp->control.trap_expected) ++ || tp->control.trap_expected) + return RESUME_STEP_USER; -+ -+ if (bpstat_should_step ()) ++ if (bpstat_should_step ()) + return RESUME_STEP_NEEDED; -+ + return RESUME_STEP_CONTINUE; } - /* Returns true if any thread *but* the one passed in "data" is in the -Index: gdb-7.6.90.20140127/gdb/linux-nat.c + /* Inferior has stepped into a subroutine call with source code that +Index: gdb-7.7.90.20140613/gdb/linux-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/linux-nat.c 2014-01-27 22:05:28.806895350 +0100 -+++ gdb-7.6.90.20140127/gdb/linux-nat.c 2014-01-27 22:33:45.330157889 +0100 -@@ -2697,7 +2697,11 @@ static int +--- gdb-7.7.90.20140613.orig/gdb/linux-nat.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/linux-nat.c 2014-06-13 21:31:19.449949814 +0200 +@@ -2709,7 +2709,11 @@ static int select_singlestep_lwp_callback (struct lwp_info *lp, void *data) { if (lp->last_resume_kind == resume_step @@ -188,11 +159,19 @@ Index: gdb-7.6.90.20140127/gdb/linux-nat.c return 1; else return 0; -Index: gdb-7.6.90.20140127/gdb/linux-nat.h +Index: gdb-7.7.90.20140613/gdb/linux-nat.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/linux-nat.h 2014-01-27 22:05:28.807895351 +0100 -+++ gdb-7.6.90.20140127/gdb/linux-nat.h 2014-01-27 22:33:45.334157892 +0100 -@@ -59,8 +59,8 @@ struct lwp_info +--- gdb-7.7.90.20140613.orig/gdb/linux-nat.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/linux-nat.h 2014-06-13 21:31:19.449949814 +0200 +@@ -18,6 +18,7 @@ + along with this program. If not, see . */ + + #include "target.h" ++#include "infrun.h" + + #include + +@@ -59,8 +60,8 @@ struct lwp_info /* If non-zero, a pending wait status. */ int status; @@ -203,3 +182,36 @@ Index: gdb-7.6.90.20140127/gdb/linux-nat.h /* STOPPED_BY_WATCHPOINT is non-zero if this LWP stopped with a data watchpoint trap. */ +Index: gdb-7.7.90.20140613/gdb/infrun.h +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/infrun.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/infrun.h 2014-06-13 21:31:19.449949814 +0200 +@@ -89,7 +89,14 @@ extern void proceed (CORE_ADDR, enum gdb + + /* The `resume' routine should only be called in special circumstances. + Normally, use `proceed', which handles a lot of bookkeeping. */ +-extern void resume (int, enum gdb_signal); ++enum resume_step ++ { ++ /* currently_stepping () should return non-zero for non-continue. */ ++ RESUME_STEP_CONTINUE = 0, ++ RESUME_STEP_USER, /* Stepping is intentional by the user. */ ++ RESUME_STEP_NEEDED /* Stepping only for software watchpoints. */ ++ }; ++extern void resume (enum resume_step, enum gdb_signal); + + extern ptid_t user_visible_resume_ptid (int step); + +diff --git a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp +index 2a30604..ee1fd11 100644 +--- a/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp ++++ b/gdb/testsuite/gdb.threads/signal-while-stepping-over-bp-other-thread.exp +@@ -97,7 +97,7 @@ gdb_test "set debug infrun 1" + + gdb_test \ + "step" \ +- ".*need to step-over.*resume \\(step=1.*signal arrived while stepping over breakpoint.*switching back to stepped thread.*stepped to a different line.*callme.*" \ ++ ".*need to step-over.*resume \\(step=RESUME_STEP_USER.*signal arrived while stepping over breakpoint.*switching back to stepped thread.*stepped to a different line.*callme.*" \ + "step" + + set cnt_after [get_value "args\[$my_number\]" "get count after step"] diff --git a/gdb-6.8-attach-signalled-detach-stopped.patch b/gdb-6.8-attach-signalled-detach-stopped.patch index b86306d..cde9e45 100644 --- a/gdb-6.8-attach-signalled-detach-stopped.patch +++ b/gdb-6.8-attach-signalled-detach-stopped.patch @@ -1,8 +1,8 @@ -Index: gdb-7.7/gdb/linux-nat.c +Index: gdb-7.7.90.20140613/gdb/linux-nat.c =================================================================== ---- gdb-7.7.orig/gdb/linux-nat.c 2014-02-09 19:13:32.998214571 +0100 -+++ gdb-7.7/gdb/linux-nat.c 2014-02-09 19:17:37.561499606 +0100 -@@ -176,6 +176,9 @@ blocked. */ +--- gdb-7.7.90.20140613.orig/gdb/linux-nat.c 2014-06-13 23:03:34.364177614 +0200 ++++ gdb-7.7.90.20140613/gdb/linux-nat.c 2014-06-13 23:05:07.749279122 +0200 +@@ -178,6 +178,9 @@ blocked. */ static struct target_ops *linux_ops; static struct target_ops linux_ops_saved; @@ -12,7 +12,7 @@ Index: gdb-7.7/gdb/linux-nat.c /* The method to call, if any, when a new thread is attached. */ static void (*linux_nat_new_thread) (struct lwp_info *); -@@ -652,7 +655,14 @@ holding the child stopped. Try \"set de +@@ -683,7 +686,14 @@ holding the child stopped. Try \"set de parent_inf->waiting_for_vfork_done = 0; } else if (detach_fork) @@ -28,7 +28,7 @@ Index: gdb-7.7/gdb/linux-nat.c /* Note that the detach above makes PARENT_INF dangling. */ -@@ -1099,6 +1109,7 @@ linux_nat_post_attach_wait (ptid_t ptid, +@@ -1107,6 +1117,7 @@ linux_nat_post_attach_wait (ptid_t ptid, if (debug_linux_nat) fprintf_unfiltered (gdb_stdlog, "LNPAW: Attaching to a stopped process\n"); @@ -36,7 +36,7 @@ Index: gdb-7.7/gdb/linux-nat.c /* The process is definitely stopped. It is in a job control stop, unless the kernel predates the TASK_STOPPED / -@@ -1518,6 +1529,9 @@ get_pending_status (struct lwp_info *lp, +@@ -1529,6 +1540,9 @@ get_pending_status (struct lwp_info *lp, gdb_signal_to_string (signo)); } @@ -46,7 +46,7 @@ Index: gdb-7.7/gdb/linux-nat.c return 0; } -@@ -1631,6 +1645,8 @@ linux_nat_detach (struct target_ops *ops +@@ -1642,6 +1656,8 @@ linux_nat_detach (struct target_ops *ops } else linux_ops->to_detach (ops, args, from_tty); @@ -55,9 +55,9 @@ Index: gdb-7.7/gdb/linux-nat.c } /* Resume LP. */ -@@ -1813,6 +1829,14 @@ linux_nat_resume (struct target_ops *ops - linux_nat_resume_callback. */ - lp->stopped = 0; +@@ -1824,6 +1840,14 @@ linux_nat_resume (struct target_ops *ops + return; + } + /* At this point, we are going to resume the inferior and if we + have attached to a stopped process, we no longer should leave @@ -68,9 +68,9 @@ Index: gdb-7.7/gdb/linux-nat.c + pid_was_stopped = 0; + if (resume_many) - iterate_over_lwps (ptid, linux_nat_resume_callback, NULL); + iterate_over_lwps (ptid, linux_nat_resume_callback, lp); -@@ -3864,6 +3888,8 @@ linux_nat_mourn_inferior (struct target_ +@@ -3870,6 +3894,8 @@ linux_nat_mourn_inferior (struct target_ /* Let the arch-specific native code know this process is gone. */ linux_nat_forget_process (pid); @@ -79,10 +79,10 @@ Index: gdb-7.7/gdb/linux-nat.c } /* Convert a native/host siginfo object, into/from the siginfo in the -Index: gdb-7.7/gdb/testsuite/gdb.threads/attach-stopped.exp +Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.threads/attach-stopped.exp =================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-01-08 10:23:36.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-02-09 19:13:33.321214945 +0100 +--- gdb-7.7.90.20140613.orig/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-06-13 23:03:34.365177615 +0200 ++++ gdb-7.7.90.20140613/gdb/testsuite/gdb.threads/attach-stopped.exp 2014-06-13 23:03:37.162180660 +0200 @@ -61,7 +61,65 @@ proc corefunc { threadtype } { gdb_reinitialize_dir $srcdir/$subdir gdb_load ${binfile} diff --git a/gdb-6.8-quit-never-aborts.patch b/gdb-6.8-quit-never-aborts.patch index 11317a2..50e809f 100644 --- a/gdb-6.8-quit-never-aborts.patch +++ b/gdb-6.8-quit-never-aborts.patch @@ -5,23 +5,23 @@ Some of the threads may not be properly PTRACE_DETACHed which hurts if they should have been detached with SIGSTOP (as they are accidentally left running on the debugger termination). -Index: gdb-7.6.50.20130731-cvs/gdb/defs.h +Index: gdb-7.7.90.20140613/gdb/defs.h =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/defs.h 2013-08-02 16:58:31.453016573 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/defs.h 2013-08-02 16:58:41.221030412 +0200 -@@ -177,6 +177,7 @@ extern int check_quit_flag (void); - /* Set the quit flag. */ - extern void set_quit_flag (void); +--- gdb-7.7.90.20140613.orig/gdb/defs.h 2014-06-13 23:10:18.876623018 +0200 ++++ gdb-7.7.90.20140613/gdb/defs.h 2014-06-13 23:10:52.450660505 +0200 +@@ -174,6 +174,7 @@ extern void set_quit_flag (void); + /* Flag that function quit should call quit_force. */ + extern volatile int sync_quit_force_run; +extern int quit_flag_cleanup; extern int immediate_quit; extern void quit (void); -Index: gdb-7.6.50.20130731-cvs/gdb/top.c +Index: gdb-7.7.90.20140613/gdb/top.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/top.c 2013-08-02 16:58:41.222030414 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/top.c 2013-08-02 16:59:06.321066228 +0200 -@@ -1415,7 +1415,9 @@ quit_force (char *args, int from_tty) +--- gdb-7.7.90.20140613.orig/gdb/top.c 2014-06-13 23:10:15.910619715 +0200 ++++ gdb-7.7.90.20140613/gdb/top.c 2014-06-13 23:10:18.877623020 +0200 +@@ -1378,7 +1378,9 @@ quit_force (char *args, int from_tty) if (ex.reason < 0) \ exception_print (gdb_stderr, ex) @@ -32,11 +32,11 @@ Index: gdb-7.6.50.20130731-cvs/gdb/top.c /* Get out of tfind mode, and kill or detach all inferiors. */ DO_TRY -Index: gdb-7.6.50.20130731-cvs/gdb/utils.c +Index: gdb-7.7.90.20140613/gdb/utils.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/utils.c 2013-08-02 16:58:31.455016575 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/utils.c 2013-08-02 16:58:41.223030415 +0200 -@@ -136,6 +136,11 @@ int quit_flag; +--- gdb-7.7.90.20140613.orig/gdb/utils.c 2014-06-13 23:10:18.878623021 +0200 ++++ gdb-7.7.90.20140613/gdb/utils.c 2014-06-13 23:10:38.307644652 +0200 +@@ -125,6 +125,11 @@ int job_control; int immediate_quit; @@ -45,30 +45,20 @@ Index: gdb-7.6.50.20130731-cvs/gdb/utils.c + +int quit_flag_cleanup; + - #ifndef HAVE_PYTHON - - /* Clear the quit flag. */ -@@ -159,6 +164,9 @@ set_quit_flag (void) - int - check_quit_flag (void) - { -+ if (quit_flag_cleanup) -+ return 0; -+ - /* This is written in a particular way to avoid races. */ - if (quit_flag) - { -Index: gdb-7.6.50.20130731-cvs/gdb/python/python.c + /* Nonzero means that strings with character values >0x7F should be printed + as octal escapes. Zero means just print the value (e.g. it's an + international character, and the terminal or window can cope.) */ +Index: gdb-7.7.90.20140613/gdb/extension.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/python/python.c 2013-08-02 16:58:31.456016577 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/python/python.c 2013-08-02 16:58:41.224030416 +0200 -@@ -191,6 +191,9 @@ set_quit_flag (void) - int - check_quit_flag (void) - { +--- gdb-7.7.90.20140613.orig/gdb/extension.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/extension.c 2014-06-13 23:11:32.434704853 +0200 +@@ -817,6 +817,9 @@ check_quit_flag (void) + int i, result = 0; + const struct extension_language_defn *extlang; + + if (quit_flag_cleanup) + return 0; + - return PyOS_InterruptOccurred (); - } - + ALL_ENABLED_EXTENSION_LANGUAGES (i, extlang) + { + if (extlang->ops->check_quit_flag != NULL) diff --git a/gdb-7.7-bnc877566.patch b/gdb-7.7-bnc877566.patch deleted file mode 100644 index 5f19cfb..0000000 --- a/gdb-7.7-bnc877566.patch +++ /dev/null @@ -1,26 +0,0 @@ -This fixes a bug that leads to various failures when debugging a -31-bit inferior with a 64-bit gdb on s390x. - -gdb/ - * s390-linux-nat.c (fill_gregset): Remove erroneous offset 4 in - call to regcache_raw_collect. ---- - gdb/s390-linux-nat.c | 2 +- - 1 file changed, 1 insertion(+), 1 deletion(-) - -diff --git a/gdb/s390-linux-nat.c b/gdb/s390-linux-nat.c -index 5c38952..45db7c9 100644 ---- a/gdb/s390-linux-nat.c -+++ b/gdb/s390-linux-nat.c -@@ -164,7 +164,7 @@ fill_gregset (const struct regcache *regcache, gregset_t *regp, int regno) - memset (p, 0, 4); - p += 4; - } -- regcache_raw_collect (regcache, reg, p + 4); -+ regcache_raw_collect (regcache, reg, p); - } - } - --- -1.8.4.2 - diff --git a/gdb-7.7.tar.bz2 b/gdb-7.7.tar.bz2 deleted file mode 100644 index a45fcbc..0000000 --- a/gdb-7.7.tar.bz2 +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:0404d1c6ee6b3ddd811722b5197944758d37b4591c216030effbac204f5a6c23 -size 24846320 diff --git a/gdb-7.8.tar.bz2 b/gdb-7.8.tar.bz2 new file mode 100644 index 0000000..118d7cb --- /dev/null +++ b/gdb-7.8.tar.bz2 @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:1cb8f2a7a79546381e9cb1dfae254f68a7935f513690d98efbba9c4f692daf41 +size 25469193 diff --git a/gdb-archer-pie-addons-keep-disabled.patch b/gdb-archer-pie-addons-keep-disabled.patch index 217acff..134e65c 100644 --- a/gdb-archer-pie-addons-keep-disabled.patch +++ b/gdb-archer-pie-addons-keep-disabled.patch @@ -1,8 +1,8 @@ -Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.c +Index: gdb-7.7.50.20140609/gdb/breakpoint.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/breakpoint.c 2013-08-02 16:29:16.065402116 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/breakpoint.c 2013-08-02 16:29:17.073403456 +0200 -@@ -15963,6 +15963,50 @@ initialize_breakpoint_ops (void) +--- gdb-7.7.50.20140609.orig/gdb/breakpoint.c 2014-06-13 20:24:34.564667225 +0200 ++++ gdb-7.7.50.20140609/gdb/breakpoint.c 2014-06-13 20:24:35.650668351 +0200 +@@ -16364,6 +16364,50 @@ initialize_breakpoint_ops (void) static struct cmd_list_element *enablebreaklist = NULL; void @@ -53,11 +53,11 @@ Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.c _initialize_breakpoint (void) { struct cmd_list_element *c; -Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.h +Index: gdb-7.7.50.20140609/gdb/breakpoint.h =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/breakpoint.h 2013-08-02 16:29:17.074403457 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/breakpoint.h 2013-08-02 16:29:30.221420896 +0200 -@@ -1555,4 +1555,7 @@ extern void breakpoint_free_objfile (str +--- gdb-7.7.50.20140609.orig/gdb/breakpoint.h 2014-06-13 20:24:34.566667227 +0200 ++++ gdb-7.7.50.20140609/gdb/breakpoint.h 2014-06-13 20:24:35.651668352 +0200 +@@ -1553,4 +1553,7 @@ extern void breakpoint_free_objfile (str extern char *ep_parse_optional_if_clause (char **arg); @@ -65,13 +65,13 @@ Index: gdb-7.6.50.20130731-cvs/gdb/breakpoint.h + struct section_offsets *delta); + #endif /* !defined (BREAKPOINT_H) */ -Index: gdb-7.6.50.20130731-cvs/gdb/objfiles.c +Index: gdb-7.7.50.20140609/gdb/objfiles.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/objfiles.c 2013-08-02 16:29:16.068402120 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/objfiles.c 2013-08-02 16:29:17.075403458 +0200 -@@ -851,6 +851,11 @@ objfile_relocate1 (struct objfile *objfi - objfile->sf->sym_probe_fns->sym_relocate_probe (objfile, - new_offsets, delta); +--- gdb-7.7.50.20140609.orig/gdb/objfiles.c 2014-06-13 20:24:35.652668353 +0200 ++++ gdb-7.7.50.20140609/gdb/objfiles.c 2014-06-13 20:25:10.867704891 +0200 +@@ -820,6 +820,11 @@ objfile_relocate1 (struct objfile *objfi + obj_section_addr (s)); + } + /* Final call of breakpoint_re_set can keep breakpoint locations disabled if + their addresses match. */ diff --git a/gdb-archer-pie-addons.patch b/gdb-archer-pie-addons.patch index 87a2d5f..eadf807 100644 --- a/gdb-archer-pie-addons.patch +++ b/gdb-archer-pie-addons.patch @@ -1,24 +1,24 @@ -Index: gdb-7.5.50.20130118/gdb/gdbtypes.h +Index: gdb-7.7.50.20140609/gdb/gdbtypes.h =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/gdbtypes.h 2013-01-18 23:07:03.488358315 +0100 -+++ gdb-7.5.50.20130118/gdb/gdbtypes.h 2013-01-18 23:08:10.286451570 +0100 -@@ -420,6 +420,7 @@ enum field_loc_kind +--- gdb-7.7.50.20140609.orig/gdb/gdbtypes.h 2014-06-13 20:23:55.210626427 +0200 ++++ gdb-7.7.50.20140609/gdb/gdbtypes.h 2014-06-13 20:24:26.156658622 +0200 +@@ -440,6 +440,7 @@ enum field_loc_kind { - FIELD_LOC_KIND_BITPOS, /* bitpos */ - FIELD_LOC_KIND_ENUMVAL, /* enumval */ + FIELD_LOC_KIND_BITPOS, /**< bitpos */ + FIELD_LOC_KIND_ENUMVAL, /**< enumval */ + /* This address is unrelocated by the objfile's ANOFFSET. */ - FIELD_LOC_KIND_PHYSADDR, /* physaddr */ - FIELD_LOC_KIND_PHYSNAME, /* physname */ - FIELD_LOC_KIND_DWARF_BLOCK /* dwarf_block */ -@@ -614,6 +615,7 @@ struct main_type - is the location (in the target) of the static field. - Otherwise, physname is the mangled label of the static field. */ + FIELD_LOC_KIND_PHYSADDR, /**< physaddr */ + FIELD_LOC_KIND_PHYSNAME, /**< physname */ + FIELD_LOC_KIND_DWARF_BLOCK /**< dwarf_block */ +@@ -617,6 +618,7 @@ struct main_type + field. Otherwise, physname is the mangled label of the + static field. */ + /* This address is unrelocated by the objfile's ANOFFSET. */ CORE_ADDR physaddr; const char *physname; -@@ -1237,6 +1239,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1262,6 +1264,7 @@ extern void allocate_gnat_aux_type (stru #define FIELD_ENUMVAL_LVAL(thisfld) ((thisfld).loc.enumval) #define FIELD_ENUMVAL(thisfld) (FIELD_ENUMVAL_LVAL (thisfld) + 0) #define FIELD_STATIC_PHYSNAME(thisfld) ((thisfld).loc.physname) @@ -26,7 +26,7 @@ Index: gdb-7.5.50.20130118/gdb/gdbtypes.h #define FIELD_STATIC_PHYSADDR(thisfld) ((thisfld).loc.physaddr) #define FIELD_DWARF_BLOCK(thisfld) ((thisfld).loc.dwarf_block) #define SET_FIELD_BITPOS(thisfld, bitpos) \ -@@ -1248,6 +1251,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1273,6 +1276,7 @@ extern void allocate_gnat_aux_type (stru #define SET_FIELD_PHYSNAME(thisfld, name) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSNAME, \ FIELD_STATIC_PHYSNAME (thisfld) = (name)) @@ -34,7 +34,7 @@ Index: gdb-7.5.50.20130118/gdb/gdbtypes.h #define SET_FIELD_PHYSADDR(thisfld, addr) \ (FIELD_LOC_KIND (thisfld) = FIELD_LOC_KIND_PHYSADDR, \ FIELD_STATIC_PHYSADDR (thisfld) = (addr)) -@@ -1264,6 +1268,7 @@ extern void allocate_gnat_aux_type (stru +@@ -1289,6 +1293,7 @@ extern void allocate_gnat_aux_type (stru #define TYPE_FIELD_BITPOS(thistype, n) FIELD_BITPOS (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ENUMVAL(thistype, n) FIELD_ENUMVAL (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_STATIC_PHYSNAME(thistype, n) FIELD_STATIC_PHYSNAME (TYPE_FIELD (thistype, n)) @@ -42,11 +42,11 @@ Index: gdb-7.5.50.20130118/gdb/gdbtypes.h #define TYPE_FIELD_STATIC_PHYSADDR(thistype, n) FIELD_STATIC_PHYSADDR (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_DWARF_BLOCK(thistype, n) FIELD_DWARF_BLOCK (TYPE_FIELD (thistype, n)) #define TYPE_FIELD_ARTIFICIAL(thistype, n) FIELD_ARTIFICIAL(TYPE_FIELD(thistype,n)) -Index: gdb-7.5.50.20130118/gdb/jv-lang.c +Index: gdb-7.7.50.20140609/gdb/jv-lang.c =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/jv-lang.c 2013-01-18 23:07:03.488358315 +0100 -+++ gdb-7.5.50.20130118/gdb/jv-lang.c 2013-01-18 23:08:10.286451570 +0100 -@@ -430,7 +430,8 @@ java_link_class_type (struct gdbarch *gd +--- gdb-7.7.50.20140609.orig/gdb/jv-lang.c 2014-06-13 20:23:55.211626428 +0200 ++++ gdb-7.7.50.20140609/gdb/jv-lang.c 2014-06-13 20:23:56.278627534 +0200 +@@ -427,7 +427,8 @@ java_link_class_type (struct gdbarch *gd fields = NULL; nfields--; /* First set up dummy "class" field. */ @@ -56,7 +56,7 @@ Index: gdb-7.5.50.20130118/gdb/jv-lang.c TYPE_FIELD_NAME (type, nfields) = "class"; TYPE_FIELD_TYPE (type, nfields) = value_type (clas); SET_TYPE_FIELD_PRIVATE (type, nfields); -@@ -478,7 +479,8 @@ java_link_class_type (struct gdbarch *gd +@@ -475,7 +476,8 @@ java_link_class_type (struct gdbarch *gd SET_TYPE_FIELD_PROTECTED (type, i); } if (accflags & 0x0008) /* ACC_STATIC */ @@ -66,11 +66,11 @@ Index: gdb-7.5.50.20130118/gdb/jv-lang.c else SET_FIELD_BITPOS (TYPE_FIELD (type, i), 8 * boffset); if (accflags & 0x8000) /* FIELD_UNRESOLVED_FLAG */ -Index: gdb-7.5.50.20130118/gdb/value.c +Index: gdb-7.7.50.20140609/gdb/value.c =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/value.c 2013-01-18 23:07:03.490358319 +0100 -+++ gdb-7.5.50.20130118/gdb/value.c 2013-01-18 23:08:10.287451543 +0100 -@@ -2624,7 +2624,8 @@ value_static_field (struct type *type, i +--- gdb-7.7.50.20140609.orig/gdb/value.c 2014-06-13 20:23:55.212626429 +0200 ++++ gdb-7.7.50.20140609/gdb/value.c 2014-06-13 20:23:56.279627535 +0200 +@@ -2783,7 +2783,8 @@ value_static_field (struct type *type, i { case FIELD_LOC_KIND_PHYSADDR: retval = value_at_lazy (TYPE_FIELD_TYPE (type, fieldno), diff --git a/gdb-archer-vla-tests.patch b/gdb-archer-vla-tests.patch new file mode 100644 index 0000000..c8d4557 --- /dev/null +++ b/gdb-archer-vla-tests.patch @@ -0,0 +1,2795 @@ +Index: gdb-7.7.90.20140613/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" { + # are. Observed with (FSF GNU Ada 4.5.3 20110124). + xfail $test + } ++ -re "= \\(\\)\[\r\n\]+$gdb_prompt $" { ++ # archer-jankratochvil-vla resolves it as a dynamic type resolved as an ++ # empty array [0..-1]. ++ # DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref) ++ xfail $test ++ } + } + +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,455 @@ ++ .file "x86_64-vla-typedef.c" ++ .section .debug_abbrev,"",@progbits ++.Ldebug_abbrev0: ++ .section .debug_info,"",@progbits ++.Ldebug_info0: ++ .section .debug_line,"",@progbits ++.Ldebug_line0: ++ .text ++.Ltext0: ++.globl foo ++ .type foo, @function ++foo: ++.LFB2: ++ .file 1 "x86_64-vla-typedef.c" ++ .loc 1 22 0 ++ pushq %rbp ++.LCFI0: ++ movq %rsp, %rbp ++.LCFI1: ++ subq $64, %rsp ++.LCFI2: ++ movl %edi, -36(%rbp) ++ .loc 1 22 0 ++ movq %rsp, %rax ++ movq %rax, -48(%rbp) ++ .loc 1 23 0 ++ movl -36(%rbp), %edx ++ movslq %edx,%rax ++ subq $1, %rax ++ movq %rax, -24(%rbp) ++ .loc 1 24 0 ++ movslq %edx,%rax ++ addq $15, %rax ++ addq $15, %rax ++ shrq $4, %rax ++ salq $4, %rax ++ subq %rax, %rsp ++ movq %rsp, -56(%rbp) ++ movq -56(%rbp), %rax ++ addq $15, %rax ++ shrq $4, %rax ++ salq $4, %rax ++ movq %rax, -56(%rbp) ++ movq -56(%rbp), %rax ++ movq %rax, -16(%rbp) ++ .loc 1 27 0 ++ movl $0, -4(%rbp) ++ jmp .L2 ++.L3: ++ .loc 1 28 0 ++ movl -4(%rbp), %esi ++ movl -4(%rbp), %eax ++ movl %eax, %ecx ++ movq -16(%rbp), %rdx ++ movslq %esi,%rax ++ movb %cl, (%rdx,%rax) ++ .loc 1 27 0 ++ addl $1, -4(%rbp) ++.L2: ++ movl -4(%rbp), %eax ++ cmpl -36(%rbp), %eax ++ jl .L3 ++ .loc 1 30 0 ++ .globl break_here ++break_here: ++ movq -16(%rbp), %rax ++ movb $0, (%rax) ++ movq -48(%rbp), %rsp ++ .loc 1 31 0 ++ leave ++ ret ++.LFE2: ++ .size foo, .-foo ++ .section .debug_frame,"",@progbits ++.Lframe0: ++ .long .LECIE0-.LSCIE0 ++.LSCIE0: ++ .long 0xffffffff ++ .byte 0x1 ++ .string "" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .align 8 ++.LECIE0: ++.LSFDE0: ++ .long .LEFDE0-.LASFDE0 ++.LASFDE0: ++ .long .Lframe0 ++ .quad .LFB2 ++ .quad .LFE2-.LFB2 ++ .byte 0x4 ++ .long .LCFI0-.LFB2 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x86 ++ .uleb128 0x2 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xd ++ .uleb128 0x6 ++ .align 8 ++.LEFDE0: ++ .section .eh_frame,"a",@progbits ++.Lframe1: ++ .long .LECIE1-.LSCIE1 ++.LSCIE1: ++ .long 0x0 ++ .byte 0x1 ++ .string "zR" ++ .uleb128 0x1 ++ .sleb128 -8 ++ .byte 0x10 ++ .uleb128 0x1 ++ .byte 0x3 ++ .byte 0xc ++ .uleb128 0x7 ++ .uleb128 0x8 ++ .byte 0x90 ++ .uleb128 0x1 ++ .align 8 ++.LECIE1: ++.LSFDE1: ++ .long .LEFDE1-.LASFDE1 ++.LASFDE1: ++ .long .LASFDE1-.Lframe1 ++ .long .LFB2 ++ .long .LFE2-.LFB2 ++ .uleb128 0x0 ++ .byte 0x4 ++ .long .LCFI0-.LFB2 ++ .byte 0xe ++ .uleb128 0x10 ++ .byte 0x86 ++ .uleb128 0x2 ++ .byte 0x4 ++ .long .LCFI1-.LCFI0 ++ .byte 0xd ++ .uleb128 0x6 ++ .align 8 ++.LEFDE1: ++ .text ++.Letext0: ++ .section .debug_loc,"",@progbits ++.Ldebug_loc0: ++.LLST0: ++ .quad .LFB2-.Ltext0 ++ .quad .LCFI0-.Ltext0 ++ .value 0x2 ++ .byte 0x77 ++ .sleb128 8 ++ .quad .LCFI0-.Ltext0 ++ .quad .LCFI1-.Ltext0 ++ .value 0x2 ++ .byte 0x77 ++ .sleb128 16 ++ .quad .LCFI1-.Ltext0 ++ .quad .LFE2-.Ltext0 ++ .value 0x2 ++ .byte 0x76 ++ .sleb128 16 ++ .quad 0x0 ++ .quad 0x0 ++ .section .debug_info ++ .long .Ldebug_end - .Ldebug_start ++.Ldebug_start: ++ .value 0x2 ++ .long .Ldebug_abbrev0 ++ .byte 0x8 ++ .uleb128 0x1 ++ .long .LASF2 ++ .byte 0x1 ++ .long .LASF3 ++ .long .LASF4 ++ .quad .Ltext0 ++ .quad .Letext0 ++ .long .Ldebug_line0 ++ .uleb128 0x2 ++ .byte 0x1 ++ .string "foo" ++ .byte 0x1 ++ .byte 0x16 ++ .byte 0x1 ++ .quad .LFB2 ++ .quad .LFE2 ++ .long .LLST0 ++ .long 0x83 ++ .uleb128 0x3 ++ .long .LASF5 ++ .byte 0x1 ++ .byte 0x15 ++ .long 0x83 ++ .byte 0x2 ++ .byte 0x91 ++ .sleb128 -52 ++.Ltag_typedef: ++ .uleb128 0x4 ++ .long .LASF6 ++ .byte 0x1 ++ .byte 0x17 ++ .long .Ltag_array_type - .debug_info ++ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */ ++ .long .LASF0 ++ .byte 0x1 ++ .byte 0x18 ++#if 1 ++ .long .Ltag_typedef - .debug_info ++#else ++ /* Debugging only: Skip the typedef indirection. */ ++ .long .Ltag_array_type - .debug_info ++#endif ++ /* DW_AT_location: DW_FORM_block1: start */ ++ .byte 0x3 ++ .byte 0x91 ++ .sleb128 -32 ++#if 0 ++ .byte 0x6 /* DW_OP_deref */ ++#else ++ .byte 0x96 /* DW_OP_nop */ ++#endif ++ /* DW_AT_location: DW_FORM_block1: end */ ++ .uleb128 0x6 ++ .string "i" ++ .byte 0x1 ++ .byte 0x19 ++ .long 0x83 ++ .byte 0x2 ++ .byte 0x91 ++ .sleb128 -20 ++ .byte 0x0 ++ .uleb128 0x7 ++ .byte 0x4 ++ .byte 0x5 ++ .string "int" ++.Ltag_array_type: ++ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ ++ .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */ ++ .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */ ++1: /* DW_AT_data_location: DW_FORM_block1: start */ ++ .byte 2f - 3f /* length */ ++3: ++ .byte 0x97 /* DW_OP_push_object_address */ ++ .byte 0x6 /* DW_OP_deref */ ++2: /* DW_AT_data_location: DW_FORM_block1: end */ ++ .uleb128 0x9 ++ .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */ ++ .byte 0x3 ++ .byte 0x91 ++ .sleb128 -40 ++ .byte 0x6 ++ .byte 0x0 ++ .uleb128 0xa ++ .byte 0x8 ++ .byte 0x7 ++ .uleb128 0xb ++ .byte 0x1 ++ .byte 0x6 ++ .long .LASF1 ++ .byte 0x0 ++.Ldebug_end: ++ .section .debug_abbrev ++ .uleb128 0x1 ++ .uleb128 0x11 ++ .byte 0x1 ++ .uleb128 0x25 ++ .uleb128 0xe ++ .uleb128 0x13 ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0xe ++ .uleb128 0x1b ++ .uleb128 0xe ++ .uleb128 0x11 ++ .uleb128 0x1 ++ .uleb128 0x12 ++ .uleb128 0x1 ++ .uleb128 0x10 ++ .uleb128 0x6 ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x2 ++ .uleb128 0x2e ++ .byte 0x1 ++ .uleb128 0x3f ++ .uleb128 0xc ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x27 ++ .uleb128 0xc ++ .uleb128 0x11 ++ .uleb128 0x1 ++ .uleb128 0x12 ++ .uleb128 0x1 ++ .uleb128 0x40 ++ .uleb128 0x6 ++ .uleb128 0x1 ++ .uleb128 0x13 ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0x5 ++ .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0xe ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x2 ++ .uleb128 0xa ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x4 ++ .uleb128 0x16 ++ .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0xe ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x5 ++ .uleb128 0x34 ++ .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0xe ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x2 ++ .uleb128 0xa ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x6 ++ .uleb128 0x34 ++ .byte 0x0 ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .uleb128 0x3a ++ .uleb128 0xb ++ .uleb128 0x3b ++ .uleb128 0xb ++ .uleb128 0x49 ++ .uleb128 0x13 ++ .uleb128 0x2 ++ .uleb128 0xa ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x7 ++ .uleb128 0x24 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0x8 ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ ++ .uleb128 0x1 ++ .byte 0x1 ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x1 /* DW_AT_sibling */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x50 /* DW_AT_data_location */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0x9 ++ .uleb128 0x21 ++ .byte 0x0 ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x2f ++ .uleb128 0xa ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0xa ++ .uleb128 0x24 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .byte 0x0 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0x24 ++ .byte 0x0 ++ .uleb128 0xb ++ .uleb128 0xb ++ .uleb128 0x3e ++ .uleb128 0xb ++ .uleb128 0x3 ++ .uleb128 0xe ++ .byte 0x0 ++ .byte 0x0 ++ .byte 0x0 ++ .section .debug_pubnames,"",@progbits ++ .long 0x16 ++ .value 0x2 ++ .long .Ldebug_info0 ++ .long 0xa8 ++ .long 0x2d ++ .string "foo" ++ .long 0x0 ++ .section .debug_aranges,"",@progbits ++ .long 0x2c ++ .value 0x2 ++ .long .Ldebug_info0 ++ .byte 0x8 ++ .byte 0x0 ++ .value 0x0 ++ .value 0x0 ++ .quad .Ltext0 ++ .quad .Letext0-.Ltext0 ++ .quad 0x0 ++ .quad 0x0 ++ .section .debug_str,"MS",@progbits,1 ++.LASF0: ++ .string "array" ++.LASF5: ++ .string "size" ++.LASF3: ++ .string "x86_64-vla-typedef.c" ++.LASF6: ++ .string "array_t" ++.LASF1: ++ .string "char" ++.LASF4: ++ .string "gdb.arch" ++.LASF2: ++ .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 +=================================================================== +--- /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 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 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 . */ ++ ++#if 0 ++ ++void ++foo (int size) ++{ ++ typedef char array_t[size]; ++ array_t array; ++ int i; ++ ++ for (i = 0; i < size; i++) ++ array[i] = i; ++ ++ array[0] = 0; /* break-here */ ++} ++ ++#else ++ ++int ++main (void) ++{ ++ foo (26); ++ foo (78); ++ return 0; ++} ++ ++#endif +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,64 @@ ++# Copyright 2009 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 . ++ ++# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate. ++ ++if ![istarget "x86_64-*-*"] then { ++ verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64." ++ return ++} ++ ++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 ++if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] { ++ untested x86_64-vla-typedef ++ return -1 ++} ++ ++gdb_breakpoint "break_here" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++gdb_test "whatis array" "type = array_t" "first: whatis array" ++ ++gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array" ++ ++gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'" ++gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'" ++gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'" ++gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'" ++ ++gdb_continue_to_breakpoint "break_here" ++ ++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 +=================================================================== +--- 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 +@@ -17,6 +17,13 @@ + + int array[] = {1, 2, 3, 4}; + ++#ifdef __GNUC__ ++struct ++ { ++ int a[0]; ++ } unbound; ++#endif ++ + int + main (void) + { +Index: gdb-7.7.90.20140613/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" \ + "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ + "Print array with array-indexes on" + +- ++set test "p unbound.a == &unbound.a\[0\]" ++gdb_test_multiple $test $test { ++ -re " = 1\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" { ++ unsupported "$test (no GCC)" ++ } ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,20 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++struct { ++ int field; ++} staticstruct = { 1 }; +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,26 @@ ++# Copyright 2009 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 . ++ ++set test internal-var-field-address ++set binfile ${test}.x ++if { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++clean_restart $binfile ++ ++gdb_test {set $varstruct = staticstruct} ++gdb_test {p $varstruct.field} " = 1" +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,31 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2011 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 . */ ++ ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ char s[2 + argc]; ++ void (*f) (char *) = 0; ++ ++ memset (s, 0, sizeof (s)); ++ s[0] = 'X'; ++ ++ f (s); ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,38 @@ ++# Copyright 2011 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 . ++ ++set testfile vla-frame ++set executable ${testfile} ++ ++if { [prepare_for_testing ${testfile}.exp ${executable}] } { ++ return -1 ++} ++ ++if ![runto_main] { ++ return -1 ++} ++ ++set test "continue" ++gdb_test_multiple $test $test { ++ -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" { ++ pass $test ++ } ++ -re "\r\n$gdb_prompt $" { ++ untested ${testfile}.exp ++ return ++ } ++} ++ ++gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,30 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 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 . */ ++ ++#include ++ ++int ++main (int argc, char **argv) ++{ ++ int array[argc]; ++ ++ array[0] = array[0]; ++ ++ abort (); ++ ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,109 @@ ++# Copyright 2008 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 . ++ ++# We could crash in: ++# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69 ++# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97 ++# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL)); ++# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496 ++# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156 ++# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206 ++# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430 ++# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840 ++# ... ++# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292 ++# ... ++# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273 ++ ++set testfile vla-overflow ++set shfile ${objdir}/${subdir}/${testfile}-gdb.sh ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++set f [open "|getconf PAGESIZE" "r"] ++gets $f pagesize ++close $f ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++if { [runto_main] < 0 } { ++ untested vla-overflow ++ return -1 ++} ++ ++# Get the GDB memory size when we stay at main. ++ ++proc memory_v_pages_get {} { ++ global pid_of_gdb pagesize ++ set fd [open "/proc/$pid_of_gdb/statm"] ++ gets $fd line ++ close $fd ++ # number of pages of virtual memory ++ scan $line "%d" drs ++ return $drs ++} ++ ++set pages_found [memory_v_pages_get] ++ ++# s390x with glibc-debuginfo.s390x installed used approx. 16MB. ++set mb_reserve 40 ++verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve" ++set kb_found [expr $pages_found * $pagesize / 1024] ++set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024] ++verbose -log "kb_found = $kb_found, kb_permit = $kb_permit" ++ ++# Create the ulimit wrapper. ++set f [open $shfile "w"] ++puts $f "#! /bin/sh" ++puts $f "ulimit -v $kb_permit" ++puts $f "exec $GDB \"\$@\"" ++close $f ++remote_exec host "chmod +x $shfile" ++ ++gdb_exit ++set GDBold $GDB ++set GDB "$shfile" ++gdb_start ++set GDB $GDBold ++ ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++set pid_of_gdb [exp_pid -i [board_info host fileid]] ++ ++# Check the size again after the second run. ++# We must not stop in main as it would cache `array' and never crash later. ++ ++gdb_run_cmd ++ ++verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()" ++ ++verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" ++ ++# `abort' can get expressed as `*__GI_abort'. ++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 +=================================================================== +--- /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 +@@ -0,0 +1,55 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2008 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 . */ ++ ++#include ++ ++void ++marker (void) ++{ ++} ++ ++void ++bar (char *a, char *b, char *c, int size) ++{ ++ memset (a, '1', size); ++ memset (b, '2', size); ++ memset (c, '3', 48); ++} ++ ++void ++foo (int size) ++{ ++ char temp1[size]; ++ char temp3[48]; ++ ++ temp1[size - 1] = '\0'; ++ { ++ char temp2[size]; ++ ++ bar (temp1, temp2, temp3, size); ++ ++ marker (); /* break-here */ ++ } ++} ++ ++int ++main (void) ++{ ++ foo (26); ++ foo (78); ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,62 @@ ++# Copyright 2008 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 . ++ ++set testfile vla ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile} ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { ++ untested "Couldn't compile test program" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto_main] { ++ untested vla ++ return -1 ++} ++ ++gdb_breakpoint [gdb_get_line_number "break-here"] ++ ++gdb_continue_to_breakpoint "break-here" ++ ++gdb_test "whatis temp1" "type = char \\\[26\\\]" "first: whatis temp1" ++gdb_test "whatis temp2" "type = char \\\[26\\\]" "first: whatis temp2" ++gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3" ++ ++gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1" ++gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2" ++gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3" ++ ++gdb_test "p temp1" " = '1' " "first: print temp1" ++gdb_test "p temp2" " = '2' " "first: print temp2" ++gdb_test "p temp3" " = '3' " "first: print temp3" ++ ++gdb_continue_to_breakpoint "break-here" ++ ++gdb_test "whatis temp1" "type = char \\\[78\\\]" "second: whatis temp1" ++gdb_test "whatis temp2" "type = char \\\[78\\\]" "second: whatis temp2" ++gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3" ++ ++gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1" ++gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2" ++gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3" ++ ++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 +=================================================================== +--- /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 +@@ -0,0 +1,246 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2010 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 . */ ++ ++/* Debug information */ ++ ++/* We will `break *main' at the very first instruction. */ ++#define main_length 1 ++ ++ .section .data ++vardata: ++ /* See DW_OP_lit3 + 1 (0-based). */ ++ .string "seennotseen" ++ ++ .section .debug_info ++.Lcu1_begin: ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF version number */ ++ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ ++ .byte 4 /* Pointer Size (in bytes) */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .4byte .Lproducer /* DW_AT_producer */ ++ /* Use C++ to exploit a bug in parsing DW_AT_name "". */ ++ .byte 4 /* DW_AT_language (C++) - */ ++ .4byte main /* DW_AT_low_pc */ ++ .byte main_length /* DW_AT_high_pc */ ++ ++.Larray_type: ++ .uleb128 2 /* Abbrev: DW_TAG_array_type */ ++ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 0 /* DW_AT_lower_bound */ ++ .4byte .Llen_var-.Lcu1_begin /* DW_AT_upper_bound */ ++ .byte 0 /* End of children of die */ ++ ++ /* DW_AT_upper_bound is referencing an optimized-out variable. */ ++.Larrayb_type: ++ .uleb128 2 /* Abbrev: DW_TAG_array_type */ ++ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 0 /* DW_AT_lower_bound */ ++ .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */ ++ .byte 0 /* End of children of die */ ++ ++ /* DW_AT_upper_bound is referencing register. */ ++.Larrayreg_type: ++ .uleb128 2 /* Abbrev: DW_TAG_array_type */ ++ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 0 /* DW_AT_lower_bound */ ++ .byte 2f - 1f /* DW_AT_upper_bound */ ++1: .byte 0x50 /* DW_OP_reg0 */ ++2: ++ .byte 0 /* End of children of die */ ++ ++.Luint_type: ++ .uleb128 4 /* Abbrev: DW_TAG_base_type */ ++ .4byte .Luint_str /* DW_AT_name */ ++ .byte 4 /* DW_AT_byte_size */ ++ .byte 7 /* DW_AT_encoding */ ++ ++.Lchar_type: ++ .uleb128 4 /* Abbrev: DW_TAG_base_type */ ++ .4byte .Lchar_str /* DW_AT_name */ ++ .byte 1 /* DW_AT_byte_size */ ++ .byte 6 /* DW_AT_encoding */ ++ ++.Llen_var: ++ .uleb128 5 /* Abbrev: DW_TAG_variable artificial */ ++ .byte 1 /* DW_AT_artificial */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ .4byte .Llen_loclist-.Lloclist /* DW_AT_location */ ++ ++ /* optimized-out variable for b_string. */ ++.Llenb_var: ++ .uleb128 7 /* Abbrev: DW_TAG_variable artificial no DW_AT_location */ ++ .byte 1 /* DW_AT_artificial */ ++ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .string "a_string" /* DW_AT_name */ ++ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 2f - 1f /* DW_AT_location */ ++1: .byte 3 /* DW_OP_addr */ ++ .4byte vardata /* */ ++2: ++ ++ /* DW_AT_upper_bound is referencing an optimized-out variable. */ ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .string "b_string" /* DW_AT_name */ ++ .4byte .Larrayb_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 2f - 1f /* DW_AT_location */ ++1: .byte 3 /* DW_OP_addr */ ++ .4byte vardata /* */ ++2: ++ ++ /* DW_AT_upper_bound is referencing register. */ ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .string "reg_string" /* DW_AT_name */ ++ .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 2f - 1f /* DW_AT_location */ ++1: .byte 3 /* DW_OP_addr */ ++ .4byte vardata /* */ ++2: ++ ++ .byte 0 /* End of children of CU */ ++.Lcu1_end: ++ ++ .section .debug_loc ++.Lloclist: ++.Llen_loclist: ++ .4byte 0 # Location list begin address ++ .4byte main_length # Location list end address ++ .value 2f-1f # Location expression size ++1: .byte 0x33 # DW_OP_lit3 ++ .byte 0x9f # DW_OP_stack_value ++2: ++ .quad 0x0 # Location list terminator begin (*.LLST2) ++ .quad 0x0 # Location list terminator end (*.LLST2) ++ ++ .section .debug_abbrev ++.Ldebug_abbrev0: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 0x1 /* has_children */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0xe /* DW_FORM_strp */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x11 /* DW_AT_low_pc */ ++ .uleb128 0x1 /* DW_FORM_addr */ ++ .uleb128 0x12 /* DW_AT_high_pc */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x1 /* TAG: DW_TAG_array_type */ ++ .byte 0x1 /* DW_children_yes */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 3 /* Abbrev code */ ++ .uleb128 0x21 /* DW_TAG_subrange_type */ ++ .byte 0x0 /* no children */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x22 /* DW_AT_lower_bound */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x2f /* DW_AT_upper_bound */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 4 /* Abbrev code */ ++ .uleb128 0x24 /* DW_TAG_base_type */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0xe /* DW_FORM_strp */ ++ .uleb128 0xb /* DW_AT_byte_size */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3e /* DW_AT_encoding */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 5 /* Abbrev code */ ++ .uleb128 0x34 /* DW_TAG_variable */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x34 /* DW_AT_artificial */ ++ .uleb128 0x0c /* DW_FORM_flag */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x02 /* DW_AT_location */ ++ .uleb128 0x06 /* DW_FORM_data4 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 6 /* Abbrev code */ ++ .uleb128 0x34 /* DW_TAG_variable */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x2 /* DW_AT_location */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 7 /* Abbrev code */ ++ .uleb128 0x34 /* DW_TAG_variable */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x34 /* DW_AT_artificial */ ++ .uleb128 0x0c /* DW_FORM_flag */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 8 /* Abbrev code */ ++ .uleb128 0x21 /* DW_TAG_subrange_type with block */ ++ .byte 0x0 /* no children */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x22 /* DW_AT_lower_bound */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x2f /* DW_AT_upper_bound */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .byte 0x0 /* Terminator */ ++ ++/* String table */ ++ .section .debug_str ++.Lproducer: ++ .string "GNU C 3.3.3" ++.Lchar_str: ++ .string "char" ++.Luint_str: ++ .string "unsigned int" +Index: gdb-7.7.90.20140613/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 @@ ++# Copyright 2010 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 . ++ ++# Test printing variable with dynamic bounds which reference a different ++# (artificial in the GCC case) variable containing loclist as its location. ++# This testcase uses value (not address) of the referenced variable: ++# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762 ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++# For now pick a sampling of likely targets. ++if {![istarget *-*-linux*] ++ && ![istarget *-*-gnu*] ++ && ![istarget *-*-elf*] ++ && ![istarget *-*-openbsd*] ++ && ![istarget arm-*-eabi*] ++ && ![istarget powerpc-*-eabi*]} { ++ return 0 ++} ++ ++set testfile dw2-bound-loclist ++if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } { ++ return -1 ++} ++ ++# 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\]} ++ ++# Not runto_main as dw2-bound-loclist.S handles only the first byte of main. ++if ![runto "*main"] { ++ return -1 ++} ++ ++gdb_test "p a_string" { = "seen"} ++gdb_test "ptype a_string" {type = char \[4\]} ++ ++gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"} ++gdb_test "ptype b_string" {type = char \[\]} ++ ++# 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 +=================================================================== +--- /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 +@@ -0,0 +1,42 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2004 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. */ ++ ++ ++/* The function `func1' traced into must have debug info on offset > 0; ++ (DW_UNSND (attr)). This is the reason of `func0' existence. */ ++ ++void ++func0(int a, int b) ++{ ++} ++ ++/* `func1' being traced into must have some arguments to dump. */ ++ ++void ++func1(int a, int b) ++{ ++ func0 (a,b); ++} ++ ++int ++main(void) ++{ ++ func1 (1, 2); ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,79 @@ ++# Copyright 2006 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. ++ ++# Minimal DWARF-2 unit test ++ ++# This test can only be run on targets which support DWARF-2. ++# For now pick a sampling of likely targets. ++if {![istarget *-*-linux*] ++ && ![istarget *-*-gnu*] ++ && ![istarget *-*-elf*] ++ && ![istarget *-*-openbsd*] ++ && ![istarget arm-*-eabi*] ++ && ![istarget powerpc-*-eabi*]} { ++ return 0 ++} ++ ++set testfile "dw2-stripped" ++set srcfile ${testfile}.c ++set binfile ${objdir}/${subdir}/${testfile}.x ++ ++remote_exec build "rm -f ${binfile}" ++ ++# get the value of gcc_compiled ++if [get_compiler_info ${binfile}] { ++ return -1 ++} ++ ++# This test can only be run on gcc as we use additional_flags=FIXME ++if {$gcc_compiled == 0} { ++ return 0 ++} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } { ++ return -1 ++} ++ ++remote_exec build "objcopy -R .debug_loc ${binfile}" ++set strip_output [remote_exec build "objdump -h ${binfile}"] ++ ++set test "stripping test file preservation" ++if [ regexp ".debug_info " $strip_output] { ++ pass "$test (.debug_info preserved)" ++} else { ++ fail "$test (.debug_info got also stripped)" ++} ++ ++set test "stripping test file functionality" ++if [ regexp ".debug_loc " $strip_output] { ++ fail "$test (.debug_loc still present)" ++} else { ++ pass "$test (.debug_loc stripped)" ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++# For C programs, "start" should stop in main(). ++ ++gdb_test "start" \ ++ ".*main \\(\\) at .*" \ ++ "start" ++gdb_test "step" \ ++ "func.* \\(.*\\) at .*" \ ++ "step" +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,83 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++/* Debug information */ ++ ++ .section .debug_info ++.Lcu1_begin: ++ /* CU header */ ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF Version */ ++ .4byte .Labbrev1_begin /* Offset into abbrev section */ ++ .byte 4 /* Pointer size */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */ ++ .ascii "GNU C 4.3.2\0" /* DW_AT_producer */ ++ .byte 1 /* DW_AT_language (C) */ ++ ++.Ltype_uchar: ++ .uleb128 2 /* Abbrev: DW_TAG_structure_type */ ++ .ascii "some_struct\0" /* DW_AT_name */ ++ ++ .uleb128 3 /* Abbrev: DW_TAG_member */ ++ .ascii "field\0" /* DW_AT_name */ ++ .byte 0 /* DW_AT_data_member_location */ ++ ++ .byte 0 /* End of children of some_struct */ ++ ++ .byte 0 /* End of children of CU */ ++ ++.Lcu1_end: ++ ++/* Abbrev table */ ++ .section .debug_abbrev ++.Labbrev1_begin: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 1 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x13 /* DW_TAG_structure_type */ ++ .byte 1 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 3 /* Abbrev code */ ++ .uleb128 0x0d /* DW_TAG_member */ ++ .byte 0 /* has_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x38 /* DW_AT_data_member_location */ ++ .uleb128 0x0b /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,37 @@ ++# Copyright 2009 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 . ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++# For now pick a sampling of likely targets. ++if {![istarget *-*-linux*] ++ && ![istarget *-*-gnu*] ++ && ![istarget *-*-elf*] ++ && ![istarget *-*-openbsd*] ++ && ![istarget arm-*-eabi*] ++ && ![istarget powerpc-*-eabi*]} { ++ return 0 ++} ++ ++set testfile "dw2-struct-member-data-location" ++set srcfile ${testfile}.S ++set binfile ${testfile}.x ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } { ++ return -1 ++} ++ ++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 +=================================================================== +--- /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 +@@ -0,0 +1,121 @@ ++/* This testcase is part of GDB, the GNU debugger. ++ ++ Copyright 2012 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 . */ ++ ++/* Debug information */ ++ ++ .section .data ++vardata: ++ .rept 129 ++ .ascii "x" ++ .endr ++ .ascii "UNSEEN\0" ++ ++ .section .debug_info ++.Lcu1_begin: ++ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ ++.Lcu1_start: ++ .2byte 2 /* DWARF version number */ ++ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ ++ .byte 4 /* Pointer Size (in bytes) */ ++ ++ /* CU die */ ++ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ ++ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ ++ .byte 2 /* DW_AT_language (C) - */ ++ ++.Larray_type: ++ .uleb128 2 /* Abbrev: DW_TAG_array_type */ ++ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ ++ ++ .uleb128 8 /* Abbrev: DW_TAG_subrange_type without DW_AT_type */ ++ .byte 0 /* DW_AT_lower_bound */ ++ .byte 128 /* DW_AT_upper_bound */ ++ ++ .byte 0 /* End of children of die */ ++ ++.Lchar_type: ++ .uleb128 4 /* Abbrev: DW_TAG_base_type */ ++ .ascii "char\0" /* DW_AT_name */ ++ .byte 1 /* DW_AT_byte_size */ ++ .byte 6 /* DW_AT_encoding */ ++ ++ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ ++ .ascii "notype_string\0" /* DW_AT_name */ ++ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */ ++ .byte 2f - 1f /* DW_AT_location */ ++1: .byte 3 /* DW_OP_addr */ ++ .4byte vardata /* */ ++2: ++ ++ .byte 0 /* End of children of CU */ ++.Lcu1_end: ++ ++ .section .debug_abbrev ++.Ldebug_abbrev0: ++ .uleb128 1 /* Abbrev code */ ++ .uleb128 0x11 /* DW_TAG_compile_unit */ ++ .byte 0x1 /* has_children */ ++ .uleb128 0x25 /* DW_AT_producer */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x13 /* DW_AT_language */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 2 /* Abbrev code */ ++ .uleb128 0x1 /* TAG: DW_TAG_array_type */ ++ .byte 0x1 /* DW_children_yes */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 4 /* Abbrev code */ ++ .uleb128 0x24 /* DW_TAG_base_type */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0xb /* DW_AT_byte_size */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x3e /* DW_AT_encoding */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 6 /* Abbrev code */ ++ .uleb128 0x34 /* DW_TAG_variable */ ++ .byte 0x0 /* no_children */ ++ .uleb128 0x3 /* DW_AT_name */ ++ .uleb128 0x8 /* DW_FORM_string */ ++ .uleb128 0x49 /* DW_AT_type */ ++ .uleb128 0x13 /* DW_FORM_ref4 */ ++ .uleb128 0x2 /* DW_AT_location */ ++ .uleb128 0xa /* DW_FORM_block1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .uleb128 8 /* Abbrev code */ ++ .uleb128 0x21 /* DW_TAG_subrange_type without DW_AT_type */ ++ .byte 0x0 /* no children */ ++ .uleb128 0x22 /* DW_AT_lower_bound */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .uleb128 0x2f /* DW_AT_upper_bound */ ++ .uleb128 0xb /* DW_FORM_data1 */ ++ .byte 0x0 /* Terminator */ ++ .byte 0x0 /* Terminator */ ++ ++ .byte 0x0 /* Terminator */ +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,39 @@ ++# Copyright 2012 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 . ++load_lib dwarf.exp ++ ++# https://bugzilla.redhat.com/show_bug.cgi?id=806920 ++# read_subrange_type reinitialization ++# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without ++# specified DW_AT_type, present only in XLF produced code. ++ ++# This test can only be run on targets which support DWARF-2 and use gas. ++if {![dwarf2_support]} { ++ return 0 ++} ++ ++set testfile dw2-subrange-no-type ++set srcfile ${testfile}.S ++set executable ${testfile}.x ++set binfile [standard_output_file ${executable}] ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { ++ return -1 ++} ++ ++clean_restart $executable ++ ++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 +=================================================================== +--- /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 +@@ -0,0 +1,42 @@ ++# Copyright 2009 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. ++ ++# This file was written by Jan Kratochvil . ++ ++# This file is part of the gdb testsuite. Array element stride must not be ++# specified in the number of elements but in a number of bytes instead. ++# Original problem: ++# (gdb) p c40pt(1) ++# $1 = '0-hello', ' ' ++# (gdb) p c40pt(2) ++# warning: Fortran array stride not divisible by the element size ++ ++set testfile dwarf-stride ++set srcfile ${testfile}.f90 ++ ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "break-here"] ++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 +=================================================================== +--- /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 +@@ -0,0 +1,40 @@ ++! Copyright 2009 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. ++! ++! File written by Alan Matsuoka. ++ ++program repro ++ ++ type small_stride ++ character*40 long_string ++ integer small_pad ++ end type small_stride ++ ++ type(small_stride), dimension (20), target :: unpleasant ++ character*40, pointer, dimension(:):: c40pt ++ ++ integer i ++ ++ do i = 0,19 ++ unpleasant(i+1)%small_pad = i+1 ++ unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello' ++ end do ++ ++ c40pt => unpleasant%long_string ++ ++ print *, c40pt ! break-here ++ ++end program repro +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,151 @@ ++# Copyright 2007 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. ++ ++# This file was written by Jan Kratochvil . ++ ++# This file is part of the gdb testsuite. It contains tests for dynamically ++# allocated Fortran arrays. ++# It depends on the GCC dynamic Fortran arrays DWARF support: ++# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244 ++ ++set testfile "dynamic" ++set srcfile ${testfile}.f90 ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { ++ untested "Couldn't compile ${srcfile}" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "varx-init"] ++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_breakpoint [gdb_get_line_number "varx-allocated"] ++gdb_continue_to_breakpoint "varx-allocated" ++# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...) ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated" ++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. ++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated" ++ ++gdb_breakpoint [gdb_get_line_number "varx-filled"] ++gdb_continue_to_breakpoint "varx-filled" ++gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6" ++gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7" ++gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8" ++gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9" ++gdb_test "p varv" "\\$\[0-9\]* = " "p varv unassociated" ++gdb_test "ptype varv" "type = " "ptype varv unassociated" ++ ++set test "output varx" ++gdb_test_multiple $test $test { ++ -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" { ++ pass $test ++ } ++} ++ ++gdb_breakpoint [gdb_get_line_number "varv-associated"] ++gdb_continue_to_breakpoint "varv-associated" ++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated" ++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated" ++# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. ++gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated" ++gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated" ++# Intel Fortran Compiler 10.1.008 uses the pointer type. ++gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated" ++ ++gdb_breakpoint [gdb_get_line_number "varv-filled"] ++gdb_continue_to_breakpoint "varv-filled" ++gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled" ++gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled" ++ ++gdb_breakpoint [gdb_get_line_number "varv-deassociated"] ++gdb_continue_to_breakpoint "varv-deassociated" ++# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type. ++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_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_breakpoint [gdb_get_line_number "vary-passed"] ++gdb_continue_to_breakpoint "vary-passed" ++# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...) ++gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)" ++ ++gdb_breakpoint [gdb_get_line_number "vary-filled"] ++gdb_continue_to_breakpoint "vary-filled" ++gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)" ++gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8" ++gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9" ++gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10" ++# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...) ++gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)" ++ ++gdb_breakpoint [gdb_get_line_number "varw-almostfilled"] ++gdb_continue_to_breakpoint "varw-almostfilled" ++gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)" ++gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1" ++# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...) ++gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled" ++# "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_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))" ++gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3" ++gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6" ++gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5" ++gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1" ++ ++gdb_breakpoint [gdb_get_line_number "varz-almostfilled"] ++gdb_continue_to_breakpoint "varz-almostfilled" ++# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not. ++gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?" ++# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7) ++# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7. ++gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?" ++gdb_test "p varz" "\\$\[0-9\]* = \\(\\)" ++gdb_test "p vart" "\\$\[0-9\]* = \\(\\)" ++gdb_test "p varz(3)" "\\$\[0-9\]* = 4" ++# maps to foo::vary(1,1) ++gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8" ++# maps to foo::vary(2,2) ++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 +=================================================================== +--- /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 +@@ -0,0 +1,98 @@ ++! Copyright 2007 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine baz ++ real, target, allocatable :: varx (:, :, :) ++ real, pointer :: varv (:, :, :) ++ real, target :: varu (1, 2, 3) ++ logical :: l ++ allocate (varx (1:6, 5:15, 17:28)) ! varx-init ++ l = allocated (varx) ++ varx(:, :, :) = 6 ! varx-allocated ++ varx(1, 5, 17) = 7 ++ varx(2, 6, 18) = 8 ++ varx(6, 15, 28) = 9 ++ varv => varx ! varx-filled ++ l = associated (varv) ++ varv(3, 7, 19) = 10 ! varv-associated ++ varv => null () ! varv-filled ++ l = associated (varv) ++ deallocate (varx) ! varv-deassociated ++ l = allocated (varx) ++ varu(:, :, :) = 10 ! varx-deallocated ++ allocate (varv (1:6, 5:15, 17:28)) ++ l = associated (varv) ++ varv(:, :, :) = 6 ++ varv(1, 5, 17) = 7 ++ varv(2, 6, 18) = 8 ++ varv(6, 15, 28) = 9 ++ deallocate (varv) ++ l = associated (varv) ++ varv => varu ++ varv(1, 1, 1) = 6 ++ varv(1, 2, 3) = 7 ++ l = associated (varv) ++end subroutine baz ++subroutine foo (vary, varw) ++ real :: vary (:, :) ++ real :: varw (:, :, :) ++ vary(:, :) = 4 ! vary-passed ++ vary(1, 1) = 8 ++ vary(2, 2) = 9 ++ vary(1, 3) = 10 ++ varw(:, :, :) = 5 ! vary-filled ++ varw(1, 1, 1) = 6 ++ varw(2, 2, 2) = 7 ! varw-almostfilled ++end subroutine foo ++subroutine bar (varz, vart) ++ real :: varz (*) ++ real :: vart (2:11, 7:*) ++ varz(1:3) = 4 ++ varz(2) = 5 ! varz-almostfilled ++ vart(2,7) = vart(2,7) ++end subroutine bar ++program test ++ interface ++ subroutine foo (vary, varw) ++ real :: vary (:, :) ++ real :: varw (:, :, :) ++ end subroutine ++ end interface ++ interface ++ subroutine bar (varz, vart) ++ real :: varz (*) ++ real :: vart (2:11, 7:*) ++ end subroutine ++ end interface ++ real :: x (10, 10), y (5), z(8, 8, 8) ++ x(:,:) = 1 ++ y(:) = 2 ++ z(:,:,:) = 3 ++ call baz ++ call foo (x, z(2:6, 4:7, 6:8)) ++ call bar (y, x) ++ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort ++ if (x (1, 3) .ne. 10) call abort ++ if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort ++ if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort ++ call foo (transpose (x), z) ++ 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 +=================================================================== +--- /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 +@@ -0,0 +1,59 @@ ++# Copyright 2008 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. ++ ++# This file was written by Jan Kratochvil . ++ ++# This file is part of the gdb testsuite. It contains tests for Fortran ++# strings with dynamic length. ++ ++set testfile "string" ++set srcfile ${testfile}.f90 ++set binfile ${objdir}/${subdir}/${testfile} ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { ++ untested "Couldn't compile ${srcfile}" ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "var-init"] ++gdb_continue_to_breakpoint "var-init" ++gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)" ++gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)" ++gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)" ++gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)" ++gdb_test "ptype *e" "Attempt to take contents of a non-pointer value." ++gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)" ++gdb_test "p c" "\\$\[0-9\]* = 'c'" ++gdb_test "p d" "\\$\[0-9\]* = 'd '" ++gdb_test "p e" "\\$\[0-9\]* = 'g '" ++gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)" ++gdb_test "p *e" "Attempt to take contents of a non-pointer value." ++gdb_test "p *f" "Attempt to take contents of a non-pointer value." ++ ++gdb_breakpoint [gdb_get_line_number "var-finish"] ++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 +=================================================================== +--- /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 +@@ -0,0 +1,37 @@ ++! Copyright 2008 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine foo (e, f) ++ character (len=1) :: c ++ character (len=8) :: d ++ character (len=*) :: e ++ character (len=*) :: f (1:7, 8:10) ++ c = 'c' ++ d = 'd' ++ e = 'e' ! var-init ++ f = 'f' ++ f(1,9) = 'f2' ++ c = 'c' ! var-finish ++end subroutine foo ++ character (len=4) :: g, h (1:7, 8:10) ++ g = 'g' ++ h = 'h' ++ call foo (g, h) ++end +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,72 @@ ++# Copyright 2011 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 . ++ ++if { [skip_fortran_tests] } { return -1 } ++ ++set testfile "subrange" ++set srcfile ${testfile}.f90 ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] { ++ perror "Couldn't run to MAIN__" ++ continue ++} ++ ++# Depending on the compiler version being used, the name of the 4-byte integer ++# and real types can be printed differently. For instance, gfortran-4.1 uses ++# "int4" whereas gfortran-4.3 uses "int(kind=4)". ++set int4 "(int4|integer\\(kind=4\\))" ++ ++gdb_breakpoint [gdb_get_line_number "break-static"] ++gdb_continue_to_breakpoint "break-static" ".*break-static.*" ++ ++foreach var {a alloc ptr} { ++ global pf_prefix ++ set old_prefix $pf_prefix ++ lappend pf_prefix "$var:" ++ ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (2, 2:3)" { = \(22, 32\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (2:3, 3)" { = \(32, 33\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (1, 2:)" { = \(21, 31\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (2, :2)" { = \(12, 22\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (3, 2:2)" { = \(23\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)" ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (4, :)" { = \(14, 24, 34\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)} ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)" ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (:)" "Wrong number of subscripts" ++ setup_kfail "*-*-*" "vlaregression/9999" ++ gdb_test "p $var (:, :, :)" "Wrong number of subscripts" ++ ++ set pf_prefix $old_prefix ++} ++ ++gdb_test_no_output {set $a=a} ++delete_breakpoints ++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 +=================================================================== +--- /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 +@@ -0,0 +1,28 @@ ++! Copyright 2011 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 test ++ integer, target :: a (4, 3) ++ integer, allocatable :: alloc (:, :) ++ integer, pointer :: ptr (:, :) ++ do 1 i = 1, 4 ++ do 1 j = 1, 3 ++ a (i, j) = j * 10 + i ++1 continue ++ allocate (alloc (4, 3)) ++ alloc = a ++ ptr => a ++ write (*,*) a ! break-static ++end +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,26 @@ ++/* Copyright 2011 Free Software Foundation, Inc. ++ ++ This file is part of GDB. ++ ++ 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 . */ ++ ++int ++main (int argc, char **argv) ++{ ++ char vla[argc]; ++ ++ vla[0] = 0; /* break-here */ ++ ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,57 @@ ++# Copyright 2011 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 . ++ ++load_lib mi-support.exp ++set MIFLAGS "-i=mi2" ++ ++gdb_exit ++if [mi_gdb_start] { ++ continue ++} ++ ++set testfile "mi2-var-stale-type" ++set srcfile ${testfile}.c ++set binfile [standard_output_file ${testfile}] ++if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} { ++ return -1 ++} ++ ++mi_delete_breakpoints ++mi_gdb_reinitialize_dir $srcdir/$subdir ++mi_gdb_load ${binfile} ++ ++mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \ ++ {\^done} \ ++ "maintenance set internal-error quit yes" ++ ++mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \ ++ {\^done} \ ++ "maintenance set internal-error corefile yes" ++ ++set line [gdb_get_line_number "break-here"] ++set func "main" ++ ++mi_gdb_test "-break-insert -t $srcfile:$line" \ ++ "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \ ++ "breakpoint at $func" ++ ++if { [mi_run_cmd] < 0 } { ++ return -1 ++} ++mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla" ++ ++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 +=================================================================== +--- /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 +@@ -0,0 +1,22 @@ ++/* This file is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++int ++func (int *arr) ++{ ++ return arr[0]; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,28 @@ ++/* This file is part of GDB, the GNU debugger. ++ ++ Copyright 2009 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 . */ ++ ++extern int func (int *arr); ++ ++int ++main (void) ++{ ++ int arr[] = { 42 }; ++ ++ func (arr); ++ ++ return 0; ++} +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,33 @@ ++# Copyright 2009 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. ++# ++# This file is part of the gdb testsuite. ++ ++if { [prepare_for_testing array-from-register.exp "array-from-register" \ ++ {array-from-register.c array-from-register-func.c} \ ++ {debug optimize=-O2}] } { ++ return -1 ++} ++ ++if ![runto func] then { ++ return -1 ++} ++ ++gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+" ++ ++# 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 +=================================================================== +--- /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 +@@ -0,0 +1,104 @@ ++# Copyright 2008, 2009 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 . ++ ++if $tracelevel then { ++ strace $tracelevel ++} ++ ++load_lib "pascal.exp" ++ ++set testfile "arrays" ++set srcfile ${testfile}.pas ++set binfile ${objdir}/${subdir}/${testfile}$EXEEXT ++ ++# These tests only work with fpc, using the -gw3 compile-option ++pascal_init ++if { $pascal_compiler_is_fpc != 1 } { ++ return -1 ++} ++ ++# Detect if the fpc version is below 2.3.0 ++set fpc_generates_dwarf_for_dynamic_arrays 1 ++if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))} { ++ set fpc_generates_dwarf_for_dynamic_arrays 0 ++} ++ ++ ++if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } { ++ return -1 ++} ++ ++gdb_exit ++gdb_start ++gdb_reinitialize_dir $srcdir/$subdir ++gdb_load ${binfile} ++set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] ++set bp_location2 [gdb_get_line_number "set breakpoint 2 here"] ++ ++ ++if { [gdb_breakpoint ${srcfile}:${bp_location1}] } { ++ pass "setting breakpoint 1" ++} ++if { [gdb_breakpoint ${srcfile}:${bp_location2}] } { ++ pass "setting breakpoint 2" ++} ++ ++# Verify that "start" lands inside the right procedure. ++if { [gdb_start_cmd] < 0 } { ++ untested start ++ return -1 ++} ++ ++gdb_test "" ".* at .*${srcfile}.*" "start" ++ ++gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint" ++ ++gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type" ++gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer" ++ ++gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint" ++ ++gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char" ++gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer" ++ ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type" ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer" ++ ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char" ++ ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string" ++ ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string" ++ ++if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { ++ setup_xfail "*-*-*" ++} ++gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" ++ +Index: gdb-7.7.90.20140613/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 +@@ -0,0 +1,82 @@ ++{ ++ Copyright 2008, 2009 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 arrays; ++ ++{$mode objfpc}{$h+} ++ ++uses sysutils; ++ ++type TStatArrInt= array[0..11] of integer; ++ TDynArrInt= array of integer; ++ TStatArrStr= array[0..12] of string; ++ TDynArrStr= array of string; ++ TDynArrChar = array of char; ++ TStatArrChar = array [0..11] of char; ++ ++ TStat2dArrInt = array[0..11,0..4] of integer; ++ ++var StatArrInt: TStatArrInt; ++ StatArrInt_: Array[0..11] of integer; ++ DynArrInt: TDynArrInt; ++ DynArrInt_: Array of integer; ++ StatArrStr: TStatArrStr; ++ DynArrStr: TDynArrStr; ++ StatArrChar: TStatArrChar; ++ DynArrChar: TDynArrChar; ++ ++ Stat2dArrInt: TStat2dArrInt; ++ ++ s: string; ++ ++ i,j : integer; ++ ++begin ++ for i := 0 to 11 do ++ begin ++ StatArrInt[i]:= i+50; ++ StatArrInt_[i]:= i+50; ++ StatArrChar[i]:= chr(ord('a')+i); ++ for j := 0 to 4 do ++ Stat2dArrInt[i,j]:=i+j; ++ end; ++ writeln(StatArrInt_[0]); ++ writeln(StatArrInt[0]); { set breakpoint 1 here } ++ writeln(StatArrChar[0]); ++ writeln(Stat2dArrInt[0,0]); ++ ++ setlength(DynArrInt,13); ++ setlength(DynArrInt_,13); ++ setlength(DynArrStr,13); ++ setlength(DynArrChar,13); ++ for i := 0 to 12 do ++ begin ++ DynArrInt[i]:= i+50; ++ DynArrInt_[i]:= i+50; ++ DynArrChar[i]:= chr(ord('a')+i); ++ StatArrStr[i]:='str'+inttostr(i); ++ DynArrStr[i]:='dstr'+inttostr(i); ++ end; ++ writeln(DynArrInt_[1]); ++ writeln(DynArrInt[1]); ++ writeln(DynArrStr[1]); ++ writeln(StatArrStr[1]); ++ writeln(DynArrChar[1]); ++ ++ s := 'test'#0'string'; ++ writeln(s); { set breakpoint 2 here } ++end. +Index: gdb-7.7.90.20140613/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 {} { + send_gdb "y\n" + exp_continue + } ++ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\ ++ { send_gdb "y\n" ++ verbose "\t\tUnloading symbols for program being debugged" ++ exp_continue ++ } + -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 +=================================================================== +--- 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 {} { + global pascal_compiler_is_fpc + global gpc_compiler + global fpc_compiler ++ global fpcversion_major ++ global fpcversion_minor ++ global fpcversion_release + global env + + if { $pascal_init_done == 1 } { +@@ -64,6 +67,20 @@ proc pascal_init {} { + set pascal_compiler_is_fpc 1 + verbose -log "Free Pascal compiler found" + } ++ ++ # Detect the fpc-version ++ if { $pascal_compiler_is_fpc == 1 } { ++ set fpcversion_major 1 ++ set fpcversion_minor 0 ++ set fpcversion_release 0 ++ set fpcversion [ remote_exec host $fpc_compiler "-iV" ] ++ if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] { ++ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major ++ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor ++ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release ++ } ++ verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release" ++ } + } + set pascal_init_done 1 + } diff --git a/gdb-archer.patch b/gdb-archer.patch index 5fb2c15..0a01be6 100644 --- a/gdb-archer.patch +++ b/gdb-archer.patch @@ -2,37 +2,23 @@ http://sourceware.org/gdb/wiki/ProjectArcher http://sourceware.org/gdb/wiki/ArcherBranchManagement GIT snapshot: -commit 21c8ac8faa4256f27d4751d8f0d2b218f2d232a8 +commit b88230edf4e2da948d633c283ba0893bf22bd7ae -branch jankratochvil/fedoragdb77 - the merge of branches: -jankratochvil/vla tromey/python -diff --git a/README.archer b/README.archer -new file mode 100644 -index 0000000..5ae587e ---- /dev/null -+++ b/README.archer -@@ -0,0 +1,13 @@ -+Merge for Fedora 21: http://pkgs.fedoraproject.org/cgit/gdb.git/ -+ -+jankratochvil/vla -+tromey/python -+ -+================================================================ +Index: gdb-7.8/README.archer +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.8/README.archer 2014-07-29 19:29:04.861982779 +0200 +@@ -0,0 +1,2 @@ +This branch originally held the Python code for gdb. It still exists +because a small amount of code here has not yet been merged upstream. -+ -+================================================================ -+C variable length arrays / DW_FORM_block / Fortran dynamic arrays. -+implementation plan: http://sourceware.org/ml/gdb/2012-11/msg00094.html -+explanation of its merge status: http://sourceware.org/ml/gdb/2011-03/msg00021.html -diff --git a/gdb/Makefile.in b/gdb/Makefile.in -index 824b26b..56f052a 100644 ---- a/gdb/Makefile.in -+++ b/gdb/Makefile.in -@@ -1372,6 +1372,12 @@ stamp-h: $(srcdir)/config.in config.status +Index: gdb-7.8/gdb/Makefile.in +=================================================================== +--- gdb-7.8.orig/gdb/Makefile.in 2014-07-29 19:29:02.665979655 +0200 ++++ gdb-7.8/gdb/Makefile.in 2014-07-29 19:29:04.862982781 +0200 +@@ -1476,6 +1476,12 @@ stamp-h: $(srcdir)/config.in config.stat CONFIG_LINKS= \ $(SHELL) config.status @@ -42,180 +28,39 @@ index 824b26b..56f052a 100644 + CONFIG_HEADERS= \ + $(SHELL) config.status + - config.status: $(srcdir)/configure configure.tgt configure.host development.sh + config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh $(SHELL) config.status --recheck -diff --git a/gdb/ada-lang.c b/gdb/ada-lang.c -index e70a33b..977f3e2 100644 ---- a/gdb/ada-lang.c -+++ b/gdb/ada-lang.c -@@ -12703,6 +12703,7 @@ ada_operator_length (const struct expression *exp, int pc, int *oplenp, - - static int - ada_operator_check (struct expression *exp, int pos, -+ int (*type_func) (struct type *type, void *data), - int (*objfile_func) (struct objfile *objfile, void *data), - void *data) - { -@@ -12717,12 +12718,15 @@ ada_operator_check (struct expression *exp, int pos, - break; - - default: -- return operator_check_standard (exp, pos, objfile_func, data); -+ return operator_check_standard (exp, pos, type_func, objfile_func, -+ data); - } - - /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */ - -- if (type && TYPE_OBJFILE (type) -+ if (type && type_func && (*type_func) (type, data)) -+ return 1; -+ if (type && TYPE_OBJFILE (type) && objfile_func - && (*objfile_func) (TYPE_OBJFILE (type), data)) - return 1; - -diff --git a/gdb/block.c b/gdb/block.c -index 2ae6ee2..376a1e8 100644 ---- a/gdb/block.c -+++ b/gdb/block.c -@@ -693,3 +693,21 @@ block_iter_match_next (const char *name, - - return block_iter_match_step (iterator, name, compare, 0); - } -+ -+/* Return OBJFILE in which BLOCK is located or NULL if we cannot find it for -+ whatever reason. */ -+ -+struct objfile * -+block_objfile (const struct block *block) -+{ -+ struct symbol *func; -+ -+ if (block == NULL) -+ return NULL; -+ -+ func = block_linkage_function (block); -+ if (func == NULL) -+ return NULL; -+ -+ return SYMBOL_SYMTAB (func)->objfile; -+} -diff --git a/gdb/block.h b/gdb/block.h -index ca143a9..0f065f8 100644 ---- a/gdb/block.h -+++ b/gdb/block.h -@@ -279,4 +279,6 @@ extern struct symbol *block_iter_match_next (const char *name, - (sym); \ - (sym) = block_iterator_next (&(iter))) - -+extern struct objfile *block_objfile (const struct block *block); -+ - #endif /* BLOCK_H */ -diff --git a/gdb/breakpoint.c b/gdb/breakpoint.c -index 66a69b5..952e1c5 100644 ---- a/gdb/breakpoint.c -+++ b/gdb/breakpoint.c -@@ -15734,6 +15734,24 @@ all_tracepoints (void) - return tp_vec; - } - -+#if 0 -+/* Call type_mark_used for any TYPEs referenced from this GDB source file. */ -+ -+static void -+breakpoint_types_mark_used (void) -+{ -+ struct breakpoint *b; -+ -+ ALL_BREAKPOINTS (b) -+ { -+ if (b->exp) -+ exp_types_mark_used (b->exp); -+ if (b->val) -+ type_mark_used (value_type (b->val)); -+ } -+} -+#endif -+ - - /* This help string is used for the break, hbreak, tbreak and thbreak - commands. It is defined as a macro to prevent duplication. -@@ -16699,4 +16717,7 @@ agent-printf \"printf format string\", arg1, arg2, arg3, ..., argn\n\ - - observer_attach_about_to_proceed (breakpoint_about_to_proceed); - observer_attach_thread_exit (remove_threaded_breakpoints); -+#if 0 -+ observer_attach_mark_used (breakpoint_types_mark_used); -+#endif - } -diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c -index 4edc9ec..292eddb 100644 ---- a/gdb/c-typeprint.c -+++ b/gdb/c-typeprint.c -@@ -689,7 +689,13 @@ c_type_print_varspec_suffix (struct type *type, - - fprintf_filtered (stream, (is_vector ? - " __attribute__ ((vector_size(" : "[")); -- if (get_array_bounds (type, &low_bound, &high_bound)) -+ if (TYPE_RANGE_DATA (TYPE_INDEX_TYPE (type))->high.kind -+ != RANGE_BOUND_KIND_CONSTANT) -+ { -+ /* No _() - printed sources should not be locale dependent. */ -+ fprintf_filtered (stream, "variable"); -+ } -+ else if (get_array_bounds (type, &low_bound, &high_bound)) - fprintf_filtered (stream, "%s", - plongest (high_bound - low_bound + 1)); - fprintf_filtered (stream, (is_vector ? ")))" : "]")); -diff --git a/gdb/cleanups.c b/gdb/cleanups.c -index e5291ab..4820972 100644 ---- a/gdb/cleanups.c -+++ b/gdb/cleanups.c -@@ -261,9 +261,11 @@ save_final_cleanups (void) - static void - restore_my_cleanups (struct cleanup **pmy_chain, struct cleanup *chain) - { -+#if 0 /* archer-jankratochvil-vla */ - if (*pmy_chain != SENTINEL_CLEANUP) - internal_warning (__FILE__, __LINE__, - _("restore_my_cleanups has found a stale cleanup")); -+#endif - - *pmy_chain = chain; - } -diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in -index e535316..444de9d 100644 ---- a/gdb/data-directory/Makefile.in -+++ b/gdb/data-directory/Makefile.in -@@ -63,13 +63,21 @@ PYTHON_FILES = \ - gdb/prompt.py \ +Index: gdb-7.8/gdb/data-directory/Makefile.in +=================================================================== +--- gdb-7.8.orig/gdb/data-directory/Makefile.in 2014-07-29 19:29:02.665979655 +0200 ++++ gdb-7.8/gdb/data-directory/Makefile.in 2014-07-29 19:29:33.053022486 +0200 +@@ -66,6 +66,8 @@ PYTHON_FILE_LIST = \ + gdb/xmethod.py \ gdb/command/bound_registers.py \ gdb/command/__init__.py \ + gdb/command/ignore_errors.py \ + gdb/command/pahole.py \ + gdb/command/xmethods.py \ gdb/command/frame_filters.py \ gdb/command/type_printers.py \ - gdb/command/pretty_printers.py \ +@@ -73,7 +75,10 @@ PYTHON_FILE_LIST = \ gdb/command/prompt.py \ gdb/command/explore.py \ gdb/function/__init__.py \ - gdb/function/strfns.py + gdb/function/strfns.py \ -+ gdb/function/__init__.py \ + gdb/function/caller_is.py \ + gdb/function/in_scope.py \ -+ gdb/printing.py \ -+ gdb/prompt.py \ + gdb/types.py - SYSTEM_GDBINIT_DIR = system-gdbinit - SYSTEM_GDBINIT_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(SYSTEM_GDBINIT_DIR) -diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo -index 74ddcf5..c45e1eb 100644 ---- a/gdb/doc/gdb.texinfo -+++ b/gdb/doc/gdb.texinfo -@@ -1222,6 +1222,16 @@ for remote debugging. + @HAVE_PYTHON_TRUE@PYTHON_FILES = $(PYTHON_FILE_LIST) + @HAVE_PYTHON_FALSE@PYTHON_FILES = +Index: gdb-7.8/gdb/doc/gdb.texinfo +=================================================================== +--- gdb-7.8.orig/gdb/doc/gdb.texinfo 2014-07-29 19:29:02.675979669 +0200 ++++ gdb-7.8/gdb/doc/gdb.texinfo 2014-07-29 19:29:04.871982794 +0200 +@@ -1225,6 +1225,16 @@ for remote debugging. Run using @var{device} for your program's standard input and output. @c FIXME: kingdon thinks there is more to -tty. Investigate. @@ -232,7 +77,11 @@ index 74ddcf5..c45e1eb 100644 @c resolve the situation of these eventually @item -tui @cindex @code{--tui} -@@ -23521,8 +23531,6 @@ containing @code{end}. For example: +Index: gdb-7.8/gdb/doc/python.texi +=================================================================== +--- gdb-7.8.orig/gdb/doc/python.texi 2014-07-29 19:29:02.677979672 +0200 ++++ gdb-7.8/gdb/doc/python.texi 2014-07-29 19:29:04.872982795 +0200 +@@ -88,8 +88,6 @@ containing @code{end}. For example: @smallexample (@value{GDBP}) python @@ -241,1848 +90,10 @@ index 74ddcf5..c45e1eb 100644 >print 23 >end 23 -@@ -23536,6 +23544,14 @@ controlled using @code{set python print-stack}: if @code{full}, then - full Python stack printing is enabled; if @code{none}, then Python stack - and message printing is disabled; if @code{message}, the default, only - the message component of the error is printed. -+ -+@kindex maint set python auto-load -+@item maint set python auto-load -+By default, @value{GDBN} will attempt to automatically load Python -+code when an object file is opened. This can be controlled using -+@code{maint set python auto-load}: if @code{on}, the default, then -+Python auto-loading is enabled; if @code{off}, then Python -+auto-loading is disabled. - @end table - - It is also possible to execute a Python script from the @value{GDBN} -diff --git a/gdb/doc/observer.texi b/gdb/doc/observer.texi -index 61acbb2..ac37324 100644 ---- a/gdb/doc/observer.texi -+++ b/gdb/doc/observer.texi -@@ -253,6 +253,11 @@ The trace state variable @var{tsv} is deleted. If @var{tsv} is - The trace state value @var{tsv} is modified. - @end deftypefun - -+@c @deftypefun void mark_used (void) -+@c Mark any possibly reclaimable objects as used during a mark-and-sweep garbage -+@c collector pass. Currently only @code{type_mark_used} marker is supported. -+@c @end deftypefun -+ - @deftypefun void test_notification (int @var{somearg}) - This observer is used for internal testing. Do not use. - See testsuite/gdb.gdb/observer.exp. -diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c -index 36c9f66..1f21766 100644 ---- a/gdb/dwarf2expr.c -+++ b/gdb/dwarf2expr.c -@@ -1478,6 +1478,14 @@ execute_stack_op (struct dwarf_expr_context *ctx, - } - break; - -+ case DW_OP_push_object_address: -+ if (ctx->funcs->get_object_address == NULL) -+ error (_("DWARF-2 expression error: DW_OP_push_object_address must " -+ "have a value to push.")); -+ result = (ctx->funcs->get_object_address) (ctx->baton); -+ result_val = value_from_ulongest (address_type, result); -+ break; -+ - default: - error (_("Unhandled dwarf expression opcode 0x%x"), op); - } -diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h -index 39dadf3..8cebbe8 100644 ---- a/gdb/dwarf2expr.h -+++ b/gdb/dwarf2expr.h -@@ -84,12 +84,8 @@ struct dwarf_expr_context_funcs - This can throw an exception if the index is out of range. */ - CORE_ADDR (*get_addr_index) (void *baton, unsigned int index); - --#if 0 -- /* Not yet implemented. */ -- - /* Return the `object address' for DW_OP_push_object_address. */ - CORE_ADDR (*get_object_address) (void *baton); --#endif - }; - - /* The location of a value. */ -diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c -index dd921ec..01a8566 100644 ---- a/gdb/dwarf2loc.c -+++ b/gdb/dwarf2loc.c -@@ -306,6 +306,9 @@ struct dwarf_expr_baton - { - struct frame_info *frame; - struct dwarf2_per_cu_data *per_cu; -+ /* From DW_TAG_variable's DW_AT_location (not DW_TAG_type's -+ DW_AT_data_location) for DW_OP_push_object_address. */ -+ CORE_ADDR object_address; - }; - - /* Helper functions for dwarf2_evaluate_loc_desc. */ -@@ -433,7 +436,7 @@ dwarf_expr_frame_base_1 (struct symbol *framefunc, CORE_ADDR pc, - - if (*length == 0) - error (_("Could not find the frame base for \"%s\"."), -- SYMBOL_NATURAL_NAME (framefunc)); -+ SYMBOL_PRINT_NAME (framefunc)); - } - - /* Helper function for dwarf2_evaluate_loc_desc. Computes the CFA for -@@ -500,6 +503,85 @@ dwarf_expr_dwarf_call (struct dwarf_expr_context *ctx, cu_offset die_offset) - ctx->funcs->get_frame_pc, ctx->baton); - } - -+static CORE_ADDR -+dwarf_expr_object_address (void *baton) -+{ -+ struct dwarf_expr_baton *debaton = baton; -+ -+ /* The message is suppressed in DWARF_BLOCK_EXEC. */ -+ if (debaton->object_address == 0) -+ error (_("Cannot resolve DW_OP_push_object_address for a missing object")); -+ -+ return debaton->object_address; -+} -+ -+/* Address of the variable we are currently referring to. It is set from -+ DW_TAG_variable's DW_AT_location (not DW_TAG_type's DW_AT_data_location) for -+ DW_OP_push_object_address. */ -+ -+static CORE_ADDR object_address; -+ -+/* Callers use object_address_set while their callers use the result set so we -+ cannot run the cleanup at the local block of our direct caller. Still we -+ should reset OBJECT_ADDRESS at least for the next GDB command. */ -+ -+static void -+object_address_cleanup (void *prev_save_voidp) -+{ -+ CORE_ADDR *prev_save = prev_save_voidp; -+ -+ object_address = *prev_save; -+ xfree (prev_save); -+} -+ -+/* Set the base address - DW_AT_location - of a variable. It is being later -+ used to derive other object addresses by DW_OP_push_object_address. -+ -+ It would be useful to sanity check ADDRESS - such as for some objects with -+ unset value_raw_address - but some valid addresses may be zero (such as first -+ objects in relocatable .o files). */ -+ -+void -+object_address_set (CORE_ADDR address) -+{ -+ CORE_ADDR *prev_save; -+ -+ prev_save = xmalloc (sizeof *prev_save); -+ *prev_save = object_address; -+ make_cleanup (object_address_cleanup, prev_save); -+ -+ object_address = address; -+} -+ -+/* Evaluate DWARF location list at DLLBATON expecting it produces exactly one -+ CORE_ADDR result stored to *ADDRP on the DWARF stack stack. If the result -+ could not be found return zero and keep *ADDRP unchanged. */ -+ -+int -+dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton, -+ struct type *type, CORE_ADDR *addrp) -+{ -+ struct frame_info *frame = get_selected_frame (NULL); -+ const gdb_byte *data; -+ size_t size; -+ struct value *val; -+ -+ if (!dllbaton) -+ return 0; -+ -+ data = dwarf2_find_location_expression (dllbaton, &size, -+ get_frame_address_in_block (frame)); -+ if (data == NULL) -+ return 0; -+ -+ val = dwarf2_evaluate_loc_desc (type, frame, data, size, dllbaton->per_cu); -+ if (value_optimized_out (val)) -+ return 0; -+ -+ *addrp = value_as_address (val); -+ return 1; -+} -+ - /* Callback function for dwarf2_evaluate_loc_desc. */ - - static struct type * -@@ -1215,10 +1297,12 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, - - saved_ctx.gdbarch = ctx->gdbarch; - saved_ctx.addr_size = ctx->addr_size; -+ saved_ctx.ref_addr_size = ctx->ref_addr_size; - saved_ctx.offset = ctx->offset; - saved_ctx.baton = ctx->baton; - ctx->gdbarch = get_objfile_arch (dwarf2_per_cu_objfile (baton_local.per_cu)); - ctx->addr_size = dwarf2_per_cu_addr_size (baton_local.per_cu); -+ ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (baton_local.per_cu); - ctx->offset = dwarf2_per_cu_text_offset (baton_local.per_cu); - ctx->baton = &baton_local; - -@@ -1226,10 +1310,78 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, - - ctx->gdbarch = saved_ctx.gdbarch; - ctx->addr_size = saved_ctx.addr_size; -+ ctx->ref_addr_size = saved_ctx.ref_addr_size; - ctx->offset = saved_ctx.offset; - ctx->baton = saved_ctx.baton; - } - -+static CORE_ADDR dwarf_expr_get_addr_index (void *baton, unsigned int index); -+ -+/* Evaluate DWARF expression at DATA ... DATA + SIZE with its result readable -+ by dwarf_expr_fetch (RETVAL, 0). FRAME parameter can be NULL to call -+ get_selected_frame to find it. Returned dwarf_expr_context freeing is -+ pushed on the cleanup chain. */ -+ -+static void -+dwarf_expr_prep_ctx (struct dwarf_expr_context *ctx, struct frame_info *frame, -+ const gdb_byte *data, size_t size, -+ struct dwarf2_per_cu_data *per_cu) -+{ -+ struct dwarf_expr_baton baton; -+ struct objfile *objfile = dwarf2_per_cu_objfile (per_cu); -+ volatile struct gdb_exception ex; -+ -+ baton.frame = frame; -+ baton.per_cu = per_cu; -+ baton.object_address = object_address; -+ -+ ctx->gdbarch = get_objfile_arch (objfile); -+ ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); -+ ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu); -+ ctx->offset = dwarf2_per_cu_text_offset (per_cu); -+ ctx->baton = &baton; -+ ctx->funcs = &dwarf_expr_ctx_funcs; -+ -+ dwarf_expr_eval (ctx, data, size); -+} -+ -+/* Evaluate DWARF expression at DLBATON expecting it produces exactly one -+ CORE_ADDR result on the DWARF stack stack. */ -+ -+CORE_ADDR -+dwarf_locexpr_baton_eval (struct dwarf2_locexpr_baton *dlbaton) -+{ -+ struct dwarf_expr_context *ctx; -+ CORE_ADDR retval; -+ struct cleanup *back_to; -+ -+ ctx = new_dwarf_expr_context (); -+ back_to = make_cleanup_free_dwarf_expr_context (ctx); -+ -+ dwarf_expr_prep_ctx (ctx, get_selected_frame (NULL), dlbaton->data, -+ dlbaton->size, dlbaton->per_cu); -+ -+ if (ctx->num_pieces > 0) -+ error (_("DW_OP_*piece is unsupported for DW_FORM_block")); -+ -+ retval = dwarf_expr_fetch_address (ctx, 0); -+ -+ if (ctx->location == DWARF_VALUE_REGISTER) -+ { -+ /* Inlined dwarf_expr_read_reg as we no longer have the baton. */ -+ -+ int gdb_regnum = gdbarch_dwarf2_reg_to_regnum (ctx->gdbarch, retval); -+ struct type *type = builtin_type (ctx->gdbarch)->builtin_data_ptr; -+ struct frame_info *frame = get_selected_frame (NULL); -+ -+ retval = address_from_register (type, gdb_regnum, frame); -+ } -+ -+ do_cleanups (back_to); -+ -+ return retval; -+} -+ - /* Callback function for dwarf2_evaluate_loc_desc. - Fetch the address indexed by DW_OP_GNU_addr_index. */ - -@@ -2205,7 +2357,8 @@ static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs = - dwarf_expr_dwarf_call, - dwarf_expr_get_base_type, - dwarf_expr_push_dwarf_reg_entry_value, -- dwarf_expr_get_addr_index -+ dwarf_expr_get_addr_index, -+ dwarf_expr_object_address - }; - - /* Evaluate a location description, starting at DATA and with length -@@ -2220,7 +2373,6 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, - LONGEST byte_offset) - { - struct value *retval; -- struct dwarf_expr_baton baton; - struct dwarf_expr_context *ctx; - struct cleanup *old_chain, *value_chain; - struct objfile *objfile = dwarf2_per_cu_objfile (per_cu); -@@ -2232,29 +2384,18 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, - if (size == 0) - return allocate_optimized_out_value (type); - -- baton.frame = frame; -- baton.per_cu = per_cu; -- - ctx = new_dwarf_expr_context (); - old_chain = make_cleanup_free_dwarf_expr_context (ctx); - value_chain = make_cleanup_value_free_to_mark (value_mark ()); - -- ctx->gdbarch = get_objfile_arch (objfile); -- ctx->addr_size = dwarf2_per_cu_addr_size (per_cu); -- ctx->ref_addr_size = dwarf2_per_cu_ref_addr_size (per_cu); -- ctx->offset = dwarf2_per_cu_text_offset (per_cu); -- ctx->baton = &baton; -- ctx->funcs = &dwarf_expr_ctx_funcs; -- - TRY_CATCH (ex, RETURN_MASK_ERROR) - { -- dwarf_expr_eval (ctx, data, size); -+ dwarf_expr_prep_ctx (ctx, frame, data, size, per_cu); - } - if (ex.reason < 0) - { - if (ex.error == NOT_AVAILABLE_ERROR) - { -- do_cleanups (old_chain); - retval = allocate_value (type); - mark_value_bytes_unavailable (retval, 0, TYPE_LENGTH (type)); - return retval; -@@ -2329,6 +2470,16 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, - int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); - - do_cleanups (value_chain); -+ -+ /* Frame may be needed for check_typedef of TYPE_DYNAMIC. */ -+ make_cleanup_restore_selected_frame (); -+ select_frame (frame); -+ -+ /* object_address_set called here is required in ALLOCATE_VALUE's -+ CHECK_TYPEDEF for the object's possible -+ DW_OP_push_object_address. */ -+ object_address_set (address); -+ - retval = value_at_lazy (type, address + byte_offset); - if (in_stack_memory) - set_value_stack (retval, 1); -@@ -4241,8 +4392,7 @@ loclist_tracepoint_var_ref (struct symbol *symbol, struct gdbarch *gdbarch, - dlbaton->per_cu); - } - --/* The set of location functions used with the DWARF-2 expression -- evaluator and location lists. */ -+/* The set of location functions used with the DWARF-2 location lists. */ - const struct symbol_computed_ops dwarf2_loclist_funcs = { - loclist_read_variable, - loclist_read_variable_at_entry, -diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h -index 786e77c..55ff4e6 100644 ---- a/gdb/dwarf2loc.h -+++ b/gdb/dwarf2loc.h -@@ -137,6 +137,15 @@ struct dwarf2_loclist_baton - - extern const struct symbol_computed_ops dwarf2_locexpr_funcs; - extern const struct symbol_computed_ops dwarf2_loclist_funcs; -+extern const struct symbol_computed_ops dwarf2_missing_funcs; -+ -+extern void object_address_set (CORE_ADDR address); -+ -+extern CORE_ADDR dwarf_locexpr_baton_eval -+ (struct dwarf2_locexpr_baton *dlbaton); -+ -+extern int dwarf_loclist_baton_eval (struct dwarf2_loclist_baton *dllbaton, -+ struct type *type, CORE_ADDR *addrp); - - extern const struct symbol_block_ops dwarf2_block_frame_base_locexpr_funcs; - extern const struct symbol_block_ops dwarf2_block_frame_base_loclist_funcs; -diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c -index 23bcfe0..ca9ffda 100644 ---- a/gdb/dwarf2read.c -+++ b/gdb/dwarf2read.c -@@ -1738,6 +1738,9 @@ static void fill_in_loclist_baton (struct dwarf2_cu *cu, - struct dwarf2_loclist_baton *baton, - const struct attribute *attr); - -+static struct dwarf2_loclist_baton *dwarf2_attr_to_loclist_baton -+ (const struct attribute *attr, struct dwarf2_cu *cu); -+ - static void dwarf2_symbol_mark_computed (const struct attribute *attr, - struct symbol *sym, - struct dwarf2_cu *cu, -@@ -1771,6 +1774,9 @@ static void age_cached_comp_units (void); - - static void free_one_cached_comp_unit (struct dwarf2_per_cu_data *); - -+static void fetch_die_type_attrs (struct die_info *die, struct type *type, -+ struct dwarf2_cu *cu); -+ - static struct type *set_die_type (struct die_info *, struct type *, - struct dwarf2_cu *); - -@@ -1799,6 +1805,9 @@ static struct type *get_die_type_at_offset (sect_offset, - - static struct type *get_die_type (struct die_info *die, struct dwarf2_cu *cu); - -+static struct dwarf2_locexpr_baton *dwarf2_attr_to_locexpr_baton -+ (const struct attribute *attr, struct dwarf2_cu *cu); -+ - static void dwarf2_release_queue (void *dummy); - - static void queue_comp_unit (struct dwarf2_per_cu_data *per_cu, -@@ -13227,6 +13236,29 @@ process_enumeration_scope (struct die_info *die, struct dwarf2_cu *cu) - new_symbol (die, this_type, cu); - } - -+/* Create a new array dimension referencing its target type TYPE. -+ -+ Multidimensional arrays are internally represented as a stack of -+ singledimensional arrays being referenced by their TYPE_TARGET_TYPE. */ -+ -+static struct type * -+create_single_array_dimension (struct type *type, struct type *range_type, -+ struct die_info *die, struct dwarf2_cu *cu) -+{ -+ type = create_array_type (NULL, type, range_type); -+ -+ /* These generic type attributes need to be fetched by -+ evaluate_subexp_standard 's call of -+ value_subscripted_rvalue only for the innermost array type. */ -+ fetch_die_type_attrs (die, type, cu); -+ -+ /* These generic type attributes are checked for allocated/associated -+ validity while accessing FIELD_LOC_KIND_DWARF_BLOCK. */ -+ fetch_die_type_attrs (die, range_type, cu); -+ -+ return type; -+} -+ - /* Extract all information from a DW_TAG_array_type DIE and put it in - the DIE's type field. For now, this only handles one dimensional - arrays. */ -@@ -13240,7 +13272,7 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) - struct type *element_type, *range_type, *index_type; - struct type **range_types = NULL; - struct attribute *attr; -- int ndim = 0; -+ int ndim = 0, i; - struct cleanup *back_to; - const char *name; - -@@ -13293,17 +13325,19 @@ read_array_type (struct die_info *die, struct dwarf2_cu *cu) - type = element_type; - - if (read_array_order (die, cu) == DW_ORD_col_major) -- { -- int i = 0; -- -- while (i < ndim) -- type = create_array_type (NULL, type, range_types[i++]); -- } -- else -- { -- while (ndim-- > 0) -- type = create_array_type (NULL, type, range_types[ndim]); -- } -+ for (i = 0; i < ndim; i++) -+ type = create_single_array_dimension (type, range_types[i], die, cu); -+ else /* (read_array_order (die, cu) == DW_ORD_row_major) */ -+ for (i = ndim - 1; i >= 0; i--) -+ type = create_single_array_dimension (type, range_types[i], die, cu); -+ -+ /* Data locations should be set only for the outermost dimension as they -+ would be confusing for the dereferenced offset on the inner ones. */ -+ attr = dwarf2_attr (die, DW_AT_data_location, cu); -+ if (attr_form_is_block (attr)) -+ TYPE_DATA_LOCATION_DWARF_BLOCK (type) -+ = dwarf2_attr_to_locexpr_baton (attr, cu); -+ gdb_assert (!TYPE_DATA_LOCATION_IS_ADDR (type)); - - /* Understand Dwarf2 support for vector types (like they occur on - the PowerPC w/ AltiVec). Gcc just adds another attribute to the -@@ -13942,29 +13976,114 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) - struct gdbarch *gdbarch = get_objfile_arch (objfile); - struct type *type, *range_type, *index_type, *char_type; - struct attribute *attr; -- unsigned int length; -+ int length; -+ -+ index_type = objfile_type (objfile)->builtin_int; -+ /* RANGE_TYPE is allocated from OBJFILE, not as a permanent type. */ -+ range_type = alloc_type (objfile); -+ /* LOW_BOUND and HIGH_BOUND are set for real below. */ -+ range_type = create_range_type (range_type, index_type, 0, -1); -+ -+ /* C/C++ should probably have the low bound 0 but C/C++ does not use -+ DW_TAG_string_type. */ -+ TYPE_LOW_BOUND (range_type) = 1; - - attr = dwarf2_attr (die, DW_AT_string_length, cu); -- if (attr) -+ if (attr && attr_form_is_block (attr)) - { -- length = DW_UNSND (attr); -+ /* Security check for a size overflow. */ -+ if (DW_BLOCK (attr)->size + 2 < DW_BLOCK (attr)->size) -+ TYPE_HIGH_BOUND (range_type) = 1; -+ /* Extend the DWARF block by a new DW_OP_deref/DW_OP_deref_size -+ instruction as DW_AT_string_length specifies the length location, not -+ its value. */ -+ else -+ { -+ struct dwarf2_locexpr_baton *length_baton = NULL; -+ struct dwarf_block *blk = DW_BLOCK (attr); -+ -+ /* Turn any single DW_OP_reg* into DW_OP_breg*(0) but clearing -+ DW_OP_deref* in such case. */ -+ -+ if (blk->size == 1 && blk->data[0] >= DW_OP_reg0 -+ && blk->data[0] <= DW_OP_reg31) -+ length_baton = dwarf2_attr_to_locexpr_baton (attr, cu); -+ else if (blk->size > 1 && blk->data[0] == DW_OP_regx) -+ { -+ ULONGEST ulongest; -+ const gdb_byte *end; -+ -+ end = safe_read_uleb128 (&blk->data[1], &blk->data[blk->size], -+ &ulongest); -+ if (end == &blk->data[blk->size]) -+ length_baton = dwarf2_attr_to_locexpr_baton (attr, cu); -+ } -+ -+ if (length_baton == NULL) -+ { -+ struct attribute *size_attr; -+ gdb_byte *data; -+ -+ length_baton = obstack_alloc (&cu->comp_unit_obstack, -+ sizeof (*length_baton)); -+ length_baton->per_cu = cu->per_cu; -+ length_baton->size = DW_BLOCK (attr)->size + 2; -+ data = obstack_alloc (&cu->comp_unit_obstack, -+ length_baton->size); -+ length_baton->data = data; -+ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size); -+ -+ /* DW_AT_BYTE_SIZE existing together with DW_AT_STRING_LENGTH -+ specifies the size of an integer to fetch. */ -+ size_attr = dwarf2_attr (die, DW_AT_byte_size, cu); -+ if (size_attr) -+ { -+ data[DW_BLOCK (attr)->size] = DW_OP_deref_size; -+ data[DW_BLOCK (attr)->size + 1] = DW_UNSND (size_attr); -+ if (data[DW_BLOCK (attr)->size + 1] != DW_UNSND (size_attr)) -+ complaint (&symfile_complaints, -+ _("DW_AT_string_length's DW_AT_byte_size " -+ "integer exceeds the byte size storage")); -+ } -+ else -+ { -+ data[DW_BLOCK (attr)->size] = DW_OP_deref; -+ data[DW_BLOCK (attr)->size + 1] = DW_OP_nop; -+ } -+ } -+ -+ TYPE_RANGE_DATA (range_type)->high.kind -+ = RANGE_BOUND_KIND_DWARF_BLOCK; -+ TYPE_RANGE_DATA (range_type)->high.u.dwarf_block = length_baton; -+ TYPE_DYNAMIC (range_type) = 1; -+ } - } - else - { -- /* Check for the DW_AT_byte_size attribute. */ -+ if (attr && attr_form_is_constant (attr)) -+ { -+ /* We currently do not support a constant address where the location -+ should be read from - attr_form_is_block is expected instead. See -+ DWARF for the DW_AT_STRING_LENGTH vs. DW_AT_BYTE_SIZE difference. -+ */ -+ /* PASSTHRU */ -+ } -+ - attr = dwarf2_attr (die, DW_AT_byte_size, cu); -- if (attr) -- { -- length = DW_UNSND (attr); -- } -+ if (attr && attr_form_is_block (attr)) -+ { -+ TYPE_RANGE_DATA (range_type)->high.kind -+ = RANGE_BOUND_KIND_DWARF_BLOCK; -+ TYPE_RANGE_DATA (range_type)->high.u.dwarf_block = -+ dwarf2_attr_to_locexpr_baton (attr, cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ else if (attr && attr_form_is_constant (attr)) -+ TYPE_HIGH_BOUND (range_type) = dwarf2_get_attr_constant_value (attr, 0); - else -- { -- length = 1; -- } -+ TYPE_HIGH_BOUND (range_type) = 1; - } - -- index_type = objfile_type (objfile)->builtin_int; -- range_type = create_range_type (NULL, index_type, 1, length); - char_type = language_string_char_type (cu->language_defn, gdbarch); - type = create_string_type (NULL, char_type, range_type); - -@@ -14289,7 +14408,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - struct type *base_type, *orig_base_type; - struct type *range_type; - struct attribute *attr; -- LONGEST low, high; -+ LONGEST low; - int low_default_is_valid; - const char *name; - LONGEST negative_mask; -@@ -14348,42 +14467,6 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - "- DIE at 0x%x [in module %s]"), - die->offset.sect_off, objfile_name (cu->objfile)); - -- attr = dwarf2_attr (die, DW_AT_upper_bound, cu); -- if (attr) -- { -- if (attr_form_is_block (attr) || attr_form_is_ref (attr)) -- { -- /* GCC encodes arrays with unspecified or dynamic length -- with a DW_FORM_block1 attribute or a reference attribute. -- FIXME: GDB does not yet know how to handle dynamic -- arrays properly, treat them as arrays with unspecified -- length for now. -- -- FIXME: jimb/2003-09-22: GDB does not really know -- how to handle arrays of unspecified length -- either; we just represent them as zero-length -- arrays. Choose an appropriate upper bound given -- the lower bound we've computed above. */ -- high = low - 1; -- } -- else -- high = dwarf2_get_attr_constant_value (attr, 1); -- } -- else -- { -- attr = dwarf2_attr (die, DW_AT_count, cu); -- if (attr) -- { -- int count = dwarf2_get_attr_constant_value (attr, 1); -- high = low + count - 1; -- } -- else -- { -- /* Unspecified array length. */ -- high = low - 1; -- } -- } -- - /* Dwarf-2 specifications explicitly allows to create subrange types - without specifying a base type. - In that case, the base type must be set to the type of -@@ -14422,24 +14505,163 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) - } - } - -- negative_mask = -+ /* LOW_BOUND and HIGH_BOUND are set for real below. */ -+ range_type = create_range_type (NULL, orig_base_type, 0, -1); -+ TYPE_UNSIGNED (range_type) = 0; -+ -+ negative_mask = - (LONGEST) -1 << (TYPE_LENGTH (base_type) * TARGET_CHAR_BIT - 1); -- if (!TYPE_UNSIGNED (base_type) && (low & negative_mask)) -- low |= negative_mask; -- if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) -- high |= negative_mask; - -- range_type = create_range_type (NULL, orig_base_type, low, high); -+ /* Exclude language_ada from any TYPE_DYNAMIC constructs below. GDB Ada -+ supports implements the dynamic bounds in a non-DWARF way and the -+ existing DWARF dynamic bounds are invalid, leading to memory access -+ errors. */ - -- /* Mark arrays with dynamic length at least as an array of unspecified -- length. GDB could check the boundary but before it gets implemented at -- least allow accessing the array elements. */ -- if (attr && attr_form_is_block (attr)) -- TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; -+ attr = dwarf2_attr (die, DW_AT_lower_bound, cu); -+ if (attr && attr_form_is_block (attr) && cu->language != language_ada) -+ { -+ TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_BLOCK; -+ TYPE_RANGE_DATA (range_type)->low.u.dwarf_block = -+ dwarf2_attr_to_locexpr_baton (attr, cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ /* For setting a default if DW_AT_UPPER_BOUND would be missing. */ -+ low = 0; -+ } -+ else if (attr && attr_form_is_ref (attr) && cu->language != language_ada) -+ { -+ struct die_info *target_die; -+ struct dwarf2_cu *target_cu = cu; -+ struct attribute *target_loc_attr; -+ -+ target_die = follow_die_ref_or_sig (die, attr, &target_cu); -+ gdb_assert (target_cu->objfile == cu->objfile); -+ target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); -+ -+ TYPE_RANGE_DATA (range_type)->low.kind = RANGE_BOUND_KIND_DWARF_LOCLIST; -+ TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.loclist -+ = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu); -+ TYPE_RANGE_DATA (range_type)->low.u.dwarf_loclist.type -+ = die_type (target_die, target_cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ /* For setting a default if DW_AT_UPPER_BOUND would be missing. */ -+ low = 0; -+ } -+ else -+ { -+ if (attr && attr_form_is_constant (attr)) -+ low = dwarf2_get_attr_constant_value (attr, 0); -+ else -+ { -+ if (cu->language == language_fortran) -+ { -+ /* FORTRAN implies a lower bound of 1, if not given. */ -+ low = 1; -+ } -+ else -+ { -+ /* According to DWARF we should assume the value 0 only for -+ LANGUAGE_C and LANGUAGE_CPLUS. */ -+ low = 0; -+ } -+ } -+ if (!TYPE_UNSIGNED (base_type) && (low & negative_mask)) -+ low |= negative_mask; -+ TYPE_LOW_BOUND (range_type) = low; -+ if (low >= 0) -+ TYPE_UNSIGNED (range_type) = 1; -+ } - -- /* Ada expects an empty array on no boundary attributes. */ -- if (attr == NULL && cu->language != language_ada) -- TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; -+ attr = dwarf2_attr (die, DW_AT_upper_bound, cu); -+ if (!attr || (!attr_form_is_block (attr) && !attr_form_is_constant (attr) -+ && !attr_form_is_ref (attr))) -+ { -+ attr = dwarf2_attr (die, DW_AT_count, cu); -+ /* It does not hurt but it is needlessly ineffective in check_typedef. */ -+ if (attr && (attr_form_is_block (attr) || attr_form_is_constant (attr))) -+ { -+ TYPE_RANGE_HIGH_BOUND_IS_COUNT (range_type) = 1; -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ /* Pass it now as the regular DW_AT_upper_bound. */ -+ } -+ -+ if (attr && attr_form_is_block (attr) && cu->language != language_ada) -+ { -+ TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_BLOCK; -+ TYPE_RANGE_DATA (range_type)->high.u.dwarf_block = -+ dwarf2_attr_to_locexpr_baton (attr, cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ else if (attr && attr_form_is_ref (attr) && cu->language != language_ada) -+ { -+ struct die_info *target_die; -+ struct dwarf2_cu *target_cu = cu; -+ struct attribute *target_loc_attr; -+ -+ target_die = follow_die_ref_or_sig (die, attr, &target_cu); -+ gdb_assert (target_cu->objfile == cu->objfile); -+ target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); -+ -+ TYPE_RANGE_DATA (range_type)->high.kind = RANGE_BOUND_KIND_DWARF_LOCLIST; -+ TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.loclist -+ = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu); -+ TYPE_RANGE_DATA (range_type)->high.u.dwarf_loclist.type -+ = die_type (target_die, target_cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ else -+ { -+ LONGEST high; -+ -+ if (attr && attr_form_is_constant (attr)) -+ high = dwarf2_get_attr_constant_value (attr, 0); -+ else -+ { -+ /* Ada expects an empty array on no boundary attributes. */ -+ if (cu->language != language_ada) -+ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 1; -+ high = low - 1; -+ } -+ if (!TYPE_UNSIGNED (base_type) && (high & negative_mask)) -+ high |= negative_mask; -+ TYPE_HIGH_BOUND (range_type) = high; -+ } -+ -+ /* DW_AT_bit_stride is currently unsupported as we count in bytes. */ -+ attr = dwarf2_attr (die, DW_AT_byte_stride, cu); -+ if (attr && attr_form_is_block (attr) && cu->language != language_ada) -+ { -+ TYPE_RANGE_DATA (range_type)->byte_stride.kind -+ = RANGE_BOUND_KIND_DWARF_BLOCK; -+ TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_block = -+ dwarf2_attr_to_locexpr_baton (attr, cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ else if (attr && attr_form_is_ref (attr) && cu->language != language_ada) -+ { -+ struct die_info *target_die; -+ struct dwarf2_cu *target_cu = cu; -+ struct attribute *target_loc_attr; -+ -+ target_die = follow_die_ref_or_sig (die, attr, &target_cu); -+ gdb_assert (target_cu->objfile == cu->objfile); -+ target_loc_attr = dwarf2_attr (target_die, DW_AT_location, target_cu); -+ -+ TYPE_RANGE_DATA (range_type)->byte_stride.kind -+ = RANGE_BOUND_KIND_DWARF_LOCLIST; -+ TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.loclist -+ = dwarf2_attr_to_loclist_baton (target_loc_attr, target_cu); -+ TYPE_RANGE_DATA (range_type)->byte_stride.u.dwarf_loclist.type -+ = die_type (target_die, target_cu); -+ TYPE_DYNAMIC (range_type) = 1; -+ } -+ else if (attr && attr_form_is_constant (attr)) -+ { -+ TYPE_BYTE_STRIDE (range_type) = dwarf2_get_attr_constant_value (attr, 0); -+ if (TYPE_BYTE_STRIDE (range_type) == 0) -+ complaint (&symfile_complaints, -+ _("Found DW_AT_byte_stride with unsupported value 0")); -+ } - - name = dwarf2_name (die, cu); - if (name) -@@ -17361,11 +17583,14 @@ var_decode_location (struct attribute *attr, struct symbol *sym, - (i.e. when the value of a register or memory location is - referenced, or a thread-local block, etc.). Then again, it might - not be worthwhile. I'm assuming that it isn't unless performance -- or memory numbers show me otherwise. */ -+ or memory numbers show me otherwise. -+ -+ SYMBOL_CLASS may get overriden by dwarf2_symbol_mark_computed. */ - - dwarf2_symbol_mark_computed (attr, sym, cu, 0); - -- if (SYMBOL_COMPUTED_OPS (sym)->location_has_loclist) -+ if (SYMBOL_COMPUTED_OPS (sym) != NULL -+ && SYMBOL_COMPUTED_OPS (sym)->location_has_loclist) - cu->has_loclist = 1; - } - -@@ -18212,6 +18437,9 @@ read_type_die_1 (struct die_info *die, struct dwarf2_cu *cu) - break; - } - -+ if (this_type) -+ finalize_type (this_type); -+ - return this_type; - } - -@@ -20894,66 +21122,109 @@ fill_in_loclist_baton (struct dwarf2_cu *cu, - baton->from_dwo = cu->dwo_unit != NULL; - } - --static void --dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym, -- struct dwarf2_cu *cu, int is_block) -+/* Convert DW_BLOCK into struct dwarf2_locexpr_baton. ATTR must be a DW_BLOCK -+ attribute type. */ -+ -+static struct dwarf2_locexpr_baton * -+dwarf2_attr_to_locexpr_baton (const struct attribute *attr, -+ struct dwarf2_cu *cu) -+{ -+ struct objfile *objfile = dwarf2_per_objfile->objfile; -+ struct dwarf2_locexpr_baton *baton; -+ -+ gdb_assert (attr == NULL || attr_form_is_block (attr)); -+ -+ baton = obstack_alloc (&objfile->objfile_obstack, sizeof (*baton)); -+ baton->per_cu = cu->per_cu; -+ gdb_assert (baton->per_cu); -+ -+ /* Note that we're just copying the block's data pointer -+ here, not the actual data. We're still pointing into the -+ info_buffer for SYM's objfile; right now we never release -+ that buffer, but when we do clean up properly this may -+ need to change. */ -+ if (attr != NULL) -+ { -+ baton->size = DW_BLOCK (attr)->size; -+ baton->data = DW_BLOCK (attr)->data; -+ } -+ else -+ { -+ baton->size = 0; -+ baton->data = NULL; -+ } -+ gdb_assert (baton->size == 0 || baton->data != NULL); -+ -+ return baton; -+} -+ -+static struct dwarf2_loclist_baton * -+dwarf2_attr_to_loclist_baton (const struct attribute *attr, -+ struct dwarf2_cu *cu) - { - struct objfile *objfile = dwarf2_per_objfile->objfile; - struct dwarf2_section_info *section = cu_debug_loc_section (cu); -+ struct dwarf2_loclist_baton *baton; - -- if (attr_form_is_section_offset (attr) -+ /* DW_AT_location of the referenced DIE may be missing if the referenced -+ variable has been optimized out. */ -+ if (!attr) -+ return NULL; -+ -+ dwarf2_read_section (dwarf2_per_objfile->objfile, section); -+ -+ if (!(attr_form_is_section_offset (attr) - /* .debug_loc{,.dwo} may not exist at all, or the offset may be outside - the section. If so, fall through to the complaint in the - other branch. */ -- && DW_UNSND (attr) < dwarf2_section_size (objfile, section)) -- { -- struct dwarf2_loclist_baton *baton; -+ && DW_UNSND (attr) < dwarf2_section_size (objfile, section))) -+ return NULL; - -- baton = obstack_alloc (&objfile->objfile_obstack, -- sizeof (struct dwarf2_loclist_baton)); -+ baton = obstack_alloc (&objfile->objfile_obstack, -+ sizeof (struct dwarf2_loclist_baton)); - -- fill_in_loclist_baton (cu, baton, attr); -+ fill_in_loclist_baton (cu, baton, attr); - -- if (cu->base_known == 0) -- complaint (&symfile_complaints, -- _("Location list used without " -- "specifying the CU base address.")); -+ if (cu->base_known == 0) -+ complaint (&symfile_complaints, -+ _("Location list used without " -+ "specifying the CU base address.")); -+ -+ return baton; -+} -+ -+/* SYM may get its SYMBOL_CLASS overriden on invalid ATTR content. */ -+ -+static void -+dwarf2_symbol_mark_computed (const struct attribute *attr, struct symbol *sym, -+ struct dwarf2_cu *cu, int is_block) -+{ -+ struct dwarf2_loclist_baton *loclist_baton; - -+ loclist_baton = dwarf2_attr_to_loclist_baton (attr, cu); -+ if (loclist_baton) -+ { - SYMBOL_ACLASS_INDEX (sym) = (is_block - ? dwarf2_loclist_block_index - : dwarf2_loclist_index); -- SYMBOL_LOCATION_BATON (sym) = baton; -+ SYMBOL_LOCATION_BATON (sym) = loclist_baton; -+ } -+ else if (attr_form_is_block (attr)) -+ { -+ SYMBOL_ACLASS_INDEX (sym) = (is_block -+ ? dwarf2_locexpr_block_index -+ : dwarf2_locexpr_index); -+ SYMBOL_LOCATION_BATON (sym) = dwarf2_attr_to_locexpr_baton (attr, cu); - } - else - { -- struct dwarf2_locexpr_baton *baton; -- -- baton = obstack_alloc (&objfile->objfile_obstack, -- sizeof (struct dwarf2_locexpr_baton)); -- baton->per_cu = cu->per_cu; -- gdb_assert (baton->per_cu); -- -- if (attr_form_is_block (attr)) -- { -- /* Note that we're just copying the block's data pointer -- here, not the actual data. We're still pointing into the -- info_buffer for SYM's objfile; right now we never release -- that buffer, but when we do clean up properly this may -- need to change. */ -- baton->size = DW_BLOCK (attr)->size; -- baton->data = DW_BLOCK (attr)->data; -- } -- else -- { -- dwarf2_invalid_attrib_class_complaint ("location description", -- SYMBOL_NATURAL_NAME (sym)); -- baton->size = 0; -- } -+ dwarf2_invalid_attrib_class_complaint ("location description", -+ SYMBOL_NATURAL_NAME (sym)); - - SYMBOL_ACLASS_INDEX (sym) = (is_block - ? dwarf2_locexpr_block_index - : dwarf2_locexpr_index); -- SYMBOL_LOCATION_BATON (sym) = baton; -+ SYMBOL_LOCATION_BATON (sym) = dwarf2_attr_to_locexpr_baton (NULL, cu); - } - } - -@@ -21326,6 +21597,25 @@ per_cu_offset_and_type_eq (const void *item_lhs, const void *item_rhs) - && ofs_lhs->offset.sect_off == ofs_rhs->offset.sect_off); - } - -+/* Fill in generic attributes applicable for type DIEs. */ -+ -+static void -+fetch_die_type_attrs (struct die_info *die, struct type *type, -+ struct dwarf2_cu *cu) -+{ -+ struct attribute *attr; -+ -+ attr = dwarf2_attr (die, DW_AT_allocated, cu); -+ if (attr_form_is_block (attr)) -+ TYPE_ALLOCATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu); -+ gdb_assert (!TYPE_NOT_ALLOCATED (type)); -+ -+ attr = dwarf2_attr (die, DW_AT_associated, cu); -+ if (attr_form_is_block (attr)) -+ TYPE_ASSOCIATED (type) = dwarf2_attr_to_locexpr_baton (attr, cu); -+ gdb_assert (!TYPE_NOT_ASSOCIATED (type)); -+} -+ - /* Set the type associated with DIE to TYPE. Save it in CU's hash - table if necessary. For convenience, return TYPE. - -@@ -21350,6 +21640,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) - struct dwarf2_per_cu_offset_and_type **slot, ofs; - struct objfile *objfile = cu->objfile; - -+ fetch_die_type_attrs (die, type, cu); -+ - /* For Ada types, make sure that the gnat-specific data is always - initialized (if not already set). There are a few types where - we should not be doing so, because the type-specific area is -diff --git a/gdb/eval.c b/gdb/eval.c -index bfbe319..3fdc5d5 100644 ---- a/gdb/eval.c -+++ b/gdb/eval.c -@@ -41,6 +41,7 @@ - #include "gdb_obstack.h" - #include "objfiles.h" - #include "python/python.h" -+#include "dwarf2loc.h" - - #include "gdb_assert.h" - -@@ -397,27 +398,222 @@ init_array_element (struct value *array, struct value *element, - } - - static struct value * --value_f90_subarray (struct value *array, -- struct expression *exp, int *pos, enum noside noside) -+value_f90_subarray (struct value *array, struct expression *exp, int *pos, -+ int nargs, enum noside noside) - { -- int pc = (*pos) + 1; -- LONGEST low_bound, high_bound; -- struct type *range = check_typedef (TYPE_INDEX_TYPE (value_type (array))); -- enum f90_range_type range_type = longest_to_int (exp->elts[pc].longconst); -- -- *pos += 3; -- -- if (range_type == LOW_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) -- low_bound = TYPE_LOW_BOUND (range); -+ /* Type to use for the newly allocated value ARRAY. */ -+ struct type *new_array_type; -+ -+ /* Type being iterated for each dimension. */ -+ struct type *type, *type_last_target; -+ -+ /* Pointer in the last holder to the type of current dimension. */ -+ struct type **typep = &new_array_type; -+ -+ struct subscript_index -+ { -+ enum { SUBSCRIPT_RANGE, SUBSCRIPT_NUMBER } kind; -+ union -+ { -+ struct subscript_range -+ { -+ enum f90_range_type f90_range_type; -+ LONGEST low_bound, high_bound; -+ } -+ range; -+ LONGEST number; -+ }; -+ } -+ *subscript_array; -+ struct type **type_array; -+ int i; -+ struct cleanup *old_chain; -+ CORE_ADDR value_byte_address, value_byte_offset = 0; -+ htab_t copied_types; -+ struct value *saved_array; -+ -+ old_chain = make_cleanup (null_cleanup, 0); -+ object_address_set (value_raw_address (array)); -+ -+ if (value_optimized_out (array) -+ || (VALUE_LVAL (array) != not_lval -+ && VALUE_LVAL (array) != lval_memory -+ && VALUE_LVAL (array) != lval_internalvar_component -+ && VALUE_LVAL (array) != lval_internalvar)) -+ error (_("value being subranged must be in memory")); -+ type = check_typedef (value_type (array)); -+ f_object_address_data_valid_or_error (type); -+ -+ copied_types = create_copied_types_hash (NULL); -+ type = copy_type_recursive (type, copied_types); -+ htab_delete (copied_types); -+ -+ if (nargs != calc_f77_array_dims (type)) -+ error (_("Wrong number of subscripts")); -+ -+ if (TYPE_DATA_LOCATION_IS_ADDR (type)) -+ { -+ value_byte_address = (TYPE_DATA_LOCATION_ADDR (type) -+ + value_offset (array)); -+ TYPE_DATA_LOCATION_IS_ADDR (type) = 0; -+ TYPE_DATA_LOCATION_DWARF_BLOCK (type) = NULL; -+ } - else -- low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); -+ { -+ gdb_assert (TYPE_DATA_LOCATION_DWARF_BLOCK (type) == NULL); -+ value_byte_address = value_address (array); -+ } -+ -+ new_array_type = type; -+ -+ subscript_array = alloca (sizeof (*subscript_array) * nargs); -+ -+ gdb_assert (nargs > 0); -+ -+ /* Now that we know we have a legal array subscript expression -+ let us actually find out where this element exists in the array. */ -+ -+ /* Take array indices left to right. */ -+ for (i = 0; i < nargs; i++) -+ { -+ struct subscript_index *index = &subscript_array[i]; -+ -+ if (exp->elts[*pos].opcode == OP_F90_RANGE) -+ { -+ int pc = (*pos) + 1; -+ struct subscript_range *range; -+ -+ index->kind = SUBSCRIPT_RANGE; -+ range = &index->range; -+ -+ *pos += 3; -+ range->f90_range_type = longest_to_int (exp->elts[pc].longconst); -+ -+ if (range->f90_range_type == HIGH_BOUND_DEFAULT -+ || range->f90_range_type == NONE_BOUND_DEFAULT) -+ range->low_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, -+ pos, noside)); -+ -+ if (range->f90_range_type == LOW_BOUND_DEFAULT -+ || range->f90_range_type == NONE_BOUND_DEFAULT) -+ range->high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, -+ pos, noside)); -+ } -+ else -+ { -+ struct value *val; - -- if (range_type == HIGH_BOUND_DEFAULT || range_type == BOTH_BOUND_DEFAULT) -- high_bound = TYPE_HIGH_BOUND (range); -+ index->kind = SUBSCRIPT_NUMBER; -+ -+ /* Evaluate each subscript; it must be a legal integer in F77. */ -+ val = evaluate_subexp_with_coercion (exp, pos, noside); -+ index->number = value_as_long (val); -+ } -+ } -+ -+ /* Internal type of array is arranged right to left. */ -+ for (i = nargs - 1; i >= 0; i--) -+ { -+ struct subscript_index *index = &subscript_array[i]; -+ struct type *range_type = TYPE_INDEX_TYPE (type); -+ -+ switch (index->kind) -+ { -+ case SUBSCRIPT_RANGE: -+ { -+ struct subscript_range *range = &index->range; -+ CORE_ADDR byte_offset; -+ -+ if (range->f90_range_type == LOW_BOUND_DEFAULT -+ || range->f90_range_type == BOTH_BOUND_DEFAULT) -+ range->low_bound = TYPE_LOW_BOUND (range_type); -+ -+ if (range->f90_range_type == HIGH_BOUND_DEFAULT -+ || range->f90_range_type == BOTH_BOUND_DEFAULT) -+ range->high_bound = TYPE_HIGH_BOUND (range_type); -+ -+ if (range->low_bound < TYPE_LOW_BOUND (range_type) -+ || (!TYPE_HIGH_BOUND_UNDEFINED (range_type) -+ && range->high_bound > TYPE_HIGH_BOUND (range_type))) -+ error (_("slice out of range")); -+ -+ byte_offset = ((range->low_bound - TYPE_LOW_BOUND (range_type)) -+ * TYPE_ARRAY_BYTE_STRIDE_VALUE (type)); -+ TYPE_LOW_BOUND (range_type) = range->low_bound; -+ TYPE_HIGH_BOUND (range_type) = range->high_bound; -+ if (range->f90_range_type == LOW_BOUND_DEFAULT -+ || range->f90_range_type == NONE_BOUND_DEFAULT) -+ TYPE_HIGH_BOUND_UNDEFINED (range_type) = 0; -+ -+ typep = &TYPE_TARGET_TYPE (type); -+ value_byte_offset += byte_offset; -+ type = TYPE_TARGET_TYPE (type); -+ } -+ break; -+ -+ case SUBSCRIPT_NUMBER: -+ { -+ CORE_ADDR byte_offset; -+ -+ if (index->number < TYPE_LOW_BOUND (range_type) -+ || (!TYPE_HIGH_BOUND_UNDEFINED (range_type) -+ && index->number > TYPE_HIGH_BOUND (range_type))) -+ error (_("no such vector element")); -+ -+ byte_offset = ((index->number - TYPE_LOW_BOUND (range_type)) -+ * TYPE_ARRAY_BYTE_STRIDE_VALUE (type)); -+ -+ type = TYPE_TARGET_TYPE (type); -+ *typep = type; -+ value_byte_offset += byte_offset; -+ } -+ break; -+ } -+ } -+ -+ type_last_target = type; -+ type_array = alloca (sizeof (*type_array) * nargs); -+ i = 0; -+ for (type = new_array_type; type != type_last_target; -+ type = TYPE_TARGET_TYPE (type)) -+ type_array[i++] = type; -+ while (i > 0) -+ { -+ struct type *type = type_array[--i]; -+ -+ /* Force TYPE_LENGTH (type) recalculation. */ -+ TYPE_TARGET_STUB (type) = 1; -+ check_typedef (type); -+ } -+ -+ saved_array = array; -+ array = allocate_value_lazy (new_array_type); -+ VALUE_LVAL (array) = VALUE_LVAL (saved_array); -+ if (VALUE_LVAL (saved_array) == lval_internalvar_component) -+ VALUE_LVAL (array) = lval_internalvar; - else -- high_bound = value_as_long (evaluate_subexp (NULL_TYPE, exp, pos, noside)); -+ VALUE_LVAL (array) = VALUE_LVAL (saved_array); -+ VALUE_FRAME_ID (array) = VALUE_FRAME_ID (saved_array); -+ if (VALUE_LVAL (array) != lval_internalvar) -+ set_value_address (array, value_byte_address + value_byte_offset); -+ -+ if (!value_lazy (saved_array) -+ && TYPE_LENGTH (value_type (saved_array)) > 0 -+ && TYPE_LENGTH (new_array_type) > 0) -+ { -+ gdb_assert (TYPE_LENGTH (new_array_type) -+ <= TYPE_LENGTH (value_type (saved_array))); -+ /* FIXME: It simulates non-public allocate_value_contents. */ -+ value_contents_all_raw (array); -+ set_value_lazy (array, 0); -+ -+ memcpy (value_contents_writeable (array), -+ value_contents (saved_array) + value_byte_offset, -+ TYPE_LENGTH (new_array_type)); -+ } - -- return value_slice (array, low_bound, high_bound - low_bound + 1); -+ do_cleanups (old_chain); -+ return array; - } - - -@@ -714,6 +910,7 @@ evaluate_subexp_standard (struct type *expect_type, - int save_pos1; - struct symbol *function = NULL; - char *function_name = NULL; -+ struct cleanup *old_chain; - - pc = (*pos)++; - op = exp->elts[pc].opcode; -@@ -1780,6 +1977,8 @@ evaluate_subexp_standard (struct type *expect_type, - - /* First determine the type code we are dealing with. */ - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); -+ old_chain = make_cleanup (null_cleanup, 0); -+ object_address_set (value_raw_address (arg1)); - type = check_typedef (value_type (arg1)); - code = TYPE_CODE (type); - -@@ -1800,23 +1999,13 @@ evaluate_subexp_standard (struct type *expect_type, - code = TYPE_CODE (type); - } - } -+ do_cleanups (old_chain); - - switch (code) - { - case TYPE_CODE_ARRAY: -- if (exp->elts[*pos].opcode == OP_F90_RANGE) -- return value_f90_subarray (arg1, exp, pos, noside); -- else -- goto multi_f77_subscript; -- - case TYPE_CODE_STRING: -- if (exp->elts[*pos].opcode == OP_F90_RANGE) -- return value_f90_subarray (arg1, exp, pos, noside); -- else -- { -- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); -- return value_subscript (arg1, value_as_long (arg2)); -- } -+ return value_f90_subarray (arg1, exp, pos, nargs, noside); - - case TYPE_CODE_PTR: - case TYPE_CODE_FUNC: -@@ -2229,49 +2418,6 @@ evaluate_subexp_standard (struct type *expect_type, - } - return (arg1); - -- multi_f77_subscript: -- { -- LONGEST subscript_array[MAX_FORTRAN_DIMS]; -- int ndimensions = 1, i; -- struct value *array = arg1; -- -- if (nargs > MAX_FORTRAN_DIMS) -- error (_("Too many subscripts for F77 (%d Max)"), MAX_FORTRAN_DIMS); -- -- ndimensions = calc_f77_array_dims (type); -- -- if (nargs != ndimensions) -- error (_("Wrong number of subscripts")); -- -- gdb_assert (nargs > 0); -- -- /* Now that we know we have a legal array subscript expression -- let us actually find out where this element exists in the array. */ -- -- /* Take array indices left to right. */ -- for (i = 0; i < nargs; i++) -- { -- /* Evaluate each subscript; it must be a legal integer in F77. */ -- arg2 = evaluate_subexp_with_coercion (exp, pos, noside); -- -- /* Fill in the subscript array. */ -- -- subscript_array[i] = value_as_long (arg2); -- } -- -- /* Internal type of array is arranged right to left. */ -- for (i = nargs; i > 0; i--) -- { -- struct type *array_type = check_typedef (value_type (array)); -- LONGEST index = subscript_array[i - 1]; -- -- array = value_subscripted_rvalue (array, index, -- f77_get_lowerbound (array_type)); -- } -- -- return array; -- } -- - case BINOP_LOGICAL_AND: - arg1 = evaluate_subexp (NULL_TYPE, exp, pos, noside); - if (noside == EVAL_SKIP) -@@ -2503,15 +2649,23 @@ evaluate_subexp_standard (struct type *expect_type, - if (expect_type && TYPE_CODE (expect_type) == TYPE_CODE_PTR) - expect_type = TYPE_TARGET_TYPE (check_typedef (expect_type)); - arg1 = evaluate_subexp (expect_type, exp, pos, noside); -+ old_chain = make_cleanup (null_cleanup, 0); -+ object_address_set (value_raw_address (arg1)); - type = check_typedef (value_type (arg1)); - if (TYPE_CODE (type) == TYPE_CODE_METHODPTR - || TYPE_CODE (type) == TYPE_CODE_MEMBERPTR) - error (_("Attempt to dereference pointer " - "to member without an object")); - if (noside == EVAL_SKIP) -- goto nosideret; -+ { -+ do_cleanups (old_chain); -+ goto nosideret; -+ } - if (unop_user_defined_p (op, arg1)) -- return value_x_unop (arg1, op, noside); -+ { -+ do_cleanups (old_chain); -+ return value_x_unop (arg1, op, noside); -+ } - else if (noside == EVAL_AVOID_SIDE_EFFECTS) - { - type = check_typedef (value_type (arg1)); -@@ -2520,12 +2674,18 @@ evaluate_subexp_standard (struct type *expect_type, - /* In C you can dereference an array to get the 1st elt. */ - || TYPE_CODE (type) == TYPE_CODE_ARRAY - ) -- return value_zero (TYPE_TARGET_TYPE (type), -- lval_memory); -+ { -+ do_cleanups (old_chain); -+ return value_zero (TYPE_TARGET_TYPE (type), -+ lval_memory); -+ } - else if (TYPE_CODE (type) == TYPE_CODE_INT) -- /* GDB allows dereferencing an int. */ -- return value_zero (builtin_type (exp->gdbarch)->builtin_int, -- lval_memory); -+ { -+ do_cleanups (old_chain); -+ /* GDB allows dereferencing an int. */ -+ return value_zero (builtin_type (exp->gdbarch)->builtin_int, -+ lval_memory); -+ } - else - error (_("Attempt to take contents of a non-pointer value.")); - } -@@ -2535,9 +2695,14 @@ evaluate_subexp_standard (struct type *expect_type, - do. "long long" variables are rare enough that - BUILTIN_TYPE_LONGEST would seem to be a mistake. */ - if (TYPE_CODE (type) == TYPE_CODE_INT) -- return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int, -- (CORE_ADDR) value_as_address (arg1)); -- return value_ind (arg1); -+ { -+ do_cleanups (old_chain); -+ return value_at_lazy (builtin_type (exp->gdbarch)->builtin_int, -+ (CORE_ADDR) value_as_address (arg1)); -+ } -+ arg1 = value_ind (arg1); -+ do_cleanups (old_chain); -+ return arg1; - - case UNOP_ADDR: - /* C++: check for and handle pointer to members. */ -@@ -2967,7 +3132,7 @@ evaluate_subexp_with_coercion (struct expression *exp, - { - enum exp_opcode op; - int pc; -- struct value *val; -+ struct value *val = NULL; - struct symbol *var; - struct type *type; - -@@ -2978,13 +3143,18 @@ evaluate_subexp_with_coercion (struct expression *exp, - { - case OP_VAR_VALUE: - var = exp->elts[pc + 2].symbol; -+ /* address_of_variable will call object_address_set for check_typedef. -+ Call it only if required as it can error-out on VAR in register. */ -+ if (TYPE_DYNAMIC (SYMBOL_TYPE (var))) -+ val = address_of_variable (var, exp->elts[pc + 1].block); - type = check_typedef (SYMBOL_TYPE (var)); - if (TYPE_CODE (type) == TYPE_CODE_ARRAY - && !TYPE_VECTOR (type) - && CAST_IS_CONVERSION (exp->language_defn)) - { - (*pos) += 4; -- val = address_of_variable (var, exp->elts[pc + 1].block); -+ if (!val) -+ val = address_of_variable (var, exp->elts[pc + 1].block); - return value_cast (lookup_pointer_type (TYPE_TARGET_TYPE (type)), - val); - } -@@ -3042,9 +3212,13 @@ evaluate_subexp_for_sizeof (struct expression *exp, int *pos) - - case OP_VAR_VALUE: - (*pos) += 4; -- type = check_typedef (SYMBOL_TYPE (exp->elts[pc + 2].symbol)); -- return -- value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); -+ /* We do not need to call read_var_value but the object evaluation may -+ need to have executed object_address_set which needs valid -+ SYMBOL_VALUE_ADDRESS of the symbol. Still VALUE returned by -+ read_var_value we left as lazy. */ -+ type = value_type (read_var_value (exp->elts[pc + 2].symbol, -+ deprecated_safe_get_selected_frame ())); -+ return value_from_longest (size_type, (LONGEST) TYPE_LENGTH (type)); - - default: - val = evaluate_subexp (NULL_TYPE, exp, pos, EVAL_AVOID_SIDE_EFFECTS); -@@ -3075,18 +3249,25 @@ parse_and_eval_type (char *p, int length) - int - calc_f77_array_dims (struct type *array_type) - { -- int ndimen = 1; -- struct type *tmp_type; -+ switch (TYPE_CODE (array_type)) -+ { -+ case TYPE_CODE_STRING: -+ return 1; - -- if ((TYPE_CODE (array_type) != TYPE_CODE_ARRAY)) -- error (_("Can't get dimensions for a non-array type")); -+ case TYPE_CODE_ARRAY: -+ { -+ int ndimen = 1; - -- tmp_type = array_type; -+ while ((array_type = TYPE_TARGET_TYPE (array_type))) -+ { -+ if (TYPE_CODE (array_type) == TYPE_CODE_ARRAY) -+ ++ndimen; -+ } -+ return ndimen; -+ } - -- while ((tmp_type = TYPE_TARGET_TYPE (tmp_type))) -- { -- if (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY) -- ++ndimen; -+ default: -+ error (_("Can't get dimensions for a non-array/non-string type")); - } -- return ndimen; -+ - } -diff --git a/gdb/f-exp.y b/gdb/f-exp.y -index 7a94b15..a6ba784 100644 ---- a/gdb/f-exp.y -+++ b/gdb/f-exp.y -@@ -297,7 +297,9 @@ arglist : subrange - { arglist_len = 1; } - ; - --arglist : arglist ',' exp %prec ABOVE_COMMA -+arglist : arglist ',' exp %prec ABOVE_COMMA -+ { arglist_len++; } -+ | arglist ',' subrange %prec ABOVE_COMMA - { arglist_len++; } - ; - -diff --git a/gdb/f-lang.h b/gdb/f-lang.h -index 2d67a48..4d2f411 100644 ---- a/gdb/f-lang.h -+++ b/gdb/f-lang.h -@@ -29,6 +29,10 @@ extern void f_error (char *); /* Defined in f-exp.y */ - extern void f_print_type (struct type *, const char *, struct ui_file *, int, - int, const struct type_print_options *); - -+extern const char *f_object_address_data_valid_print_to_stream -+ (struct type *type, struct ui_file *stream); -+extern void f_object_address_data_valid_or_error (struct type *type); -+ - extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, - struct ui_file *, int, - const struct value *, -diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c -index 8356aab..5050255 100644 ---- a/gdb/f-typeprint.c -+++ b/gdb/f-typeprint.c -@@ -30,6 +30,7 @@ - #include "gdbcore.h" - #include "target.h" - #include "f-lang.h" -+#include "dwarf2loc.h" - - #include - #include -@@ -47,6 +48,34 @@ void f_type_print_varspec_prefix (struct type *, struct ui_file *, - void f_type_print_base (struct type *, struct ui_file *, int, int); - - -+const char * -+f_object_address_data_valid_print_to_stream (struct type *type, -+ struct ui_file *stream) -+{ -+ const char *msg; -+ -+ msg = object_address_data_not_valid (type); -+ if (msg != NULL) -+ { -+ /* Assuming the content printed to STREAM should not be localized. */ -+ fprintf_filtered (stream, "<%s>", msg); -+ } -+ -+ return msg; -+} -+ -+void -+f_object_address_data_valid_or_error (struct type *type) -+{ -+ const char *msg; -+ -+ msg = object_address_data_not_valid (type); -+ if (msg != NULL) -+ { -+ error (_("Cannot access it because the %s."), _(msg)); -+ } -+} -+ - /* LEVEL is the depth to indent lines by. */ - - void -@@ -56,6 +85,9 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, - enum type_code code; - int demangled_args; - -+ if (f_object_address_data_valid_print_to_stream (type, stream) != NULL) -+ return; -+ - f_type_print_base (type, stream, show, level); - code = TYPE_CODE (type); - if ((varstring != NULL && *varstring != '\0') -@@ -162,6 +194,9 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, - - QUIT; - -+ if (TYPE_CODE (type) != TYPE_CODE_TYPEDEF) -+ CHECK_TYPEDEF (type); -+ - switch (TYPE_CODE (type)) - { - case TYPE_CODE_ARRAY: -diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c -index d8c767f..4aa0d5e 100644 ---- a/gdb/f-valprint.c -+++ b/gdb/f-valprint.c -@@ -51,15 +51,17 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; - /* The following macro gives us the size of the nth dimension, Where - n is 1 based. */ - --#define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1]) -+#define F77_DIM_COUNT(n) (f77_array_offset_tbl[n][1]) - --/* The following gives us the offset for row n where n is 1-based. */ -+/* The following gives us the element size for row n where n is 1-based. */ - --#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0]) -+#define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0]) - - int - f77_get_lowerbound (struct type *type) - { -+ f_object_address_data_valid_or_error (type); -+ - if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) - error (_("Lower bound may not be '*' in F77")); - -@@ -69,14 +71,17 @@ f77_get_lowerbound (struct type *type) - int - f77_get_upperbound (struct type *type) - { -+ f_object_address_data_valid_or_error (type); -+ - if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) - { -- /* We have an assumed size array on our hands. Assume that -- upper_bound == lower_bound so that we show at least 1 element. -- If the user wants to see more elements, let him manually ask for 'em -- and we'll subscript the array and show him. */ -+ /* We have an assumed size array on our hands. As type_length_get -+ already assumes a length zero of arrays with underfined bounds VALADDR -+ passed to the Fortran functions does not contained the real inferior -+ memory content. User should request printing of specific array -+ elements instead. */ - -- return f77_get_lowerbound (type); -+ return f77_get_lowerbound (type) - 1; - } - - return TYPE_ARRAY_UPPER_BOUND_VALUE (type); -@@ -132,24 +137,29 @@ f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) - upper = f77_get_upperbound (tmp_type); - lower = f77_get_lowerbound (tmp_type); - -- F77_DIM_SIZE (ndimen) = upper - lower + 1; -+ F77_DIM_COUNT (ndimen) = upper - lower + 1; -+ -+ F77_DIM_BYTE_STRIDE (ndimen) = -+ TYPE_ARRAY_BYTE_STRIDE_VALUE (tmp_type); - - tmp_type = TYPE_TARGET_TYPE (tmp_type); - ndimen++; - } - -- /* Now we multiply eltlen by all the offsets, so that later we -+ /* Now we multiply eltlen by all the BYTE_STRIDEs, so that later we - can print out array elements correctly. Up till now we -- know an offset to apply to get the item but we also -+ know an eltlen to apply to get the item but we also - have to know how much to add to get to the next item. */ - - ndimen--; - eltlen = TYPE_LENGTH (tmp_type); -- F77_DIM_OFFSET (ndimen) = eltlen; -+ if (F77_DIM_BYTE_STRIDE (ndimen) == 0) -+ F77_DIM_BYTE_STRIDE (ndimen) = eltlen; - while (--ndimen > 0) - { -- eltlen *= F77_DIM_SIZE (ndimen + 1); -- F77_DIM_OFFSET (ndimen) = eltlen; -+ eltlen *= F77_DIM_COUNT (ndimen + 1); -+ if (F77_DIM_BYTE_STRIDE (ndimen) == 0) -+ F77_DIM_BYTE_STRIDE (ndimen) = eltlen; - } - } - -@@ -171,37 +181,35 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, - - if (nss != ndimensions) - { -- for (i = 0; -- (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); -- i++) -+ for (i = 0; (i < F77_DIM_COUNT (nss) && (*elts) < options->print_max); i++) - { - fprintf_filtered (stream, "( "); - f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), - valaddr, -- embedded_offset + i * F77_DIM_OFFSET (nss), -+ embedded_offset + i * F77_DIM_BYTE_STRIDE (nss), - address, - stream, recurse, val, options, elts); - fprintf_filtered (stream, ") "); - } -- if (*elts >= options->print_max && i < F77_DIM_SIZE (nss)) -+ if (*elts >= options->print_max && i < F77_DIM_COUNT (nss)) - fprintf_filtered (stream, "..."); - } - else - { -- for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max; -+ for (i = 0; i < F77_DIM_COUNT (nss) && (*elts) < options->print_max; - i++, (*elts)++) - { - val_print (TYPE_TARGET_TYPE (type), - valaddr, -- embedded_offset + i * F77_DIM_OFFSET (ndimensions), -+ embedded_offset + i * F77_DIM_BYTE_STRIDE (ndimensions), - address, stream, recurse, - val, options, current_language); - -- if (i != (F77_DIM_SIZE (nss) - 1)) -+ if (i != (F77_DIM_COUNT (nss) - 1)) - fprintf_filtered (stream, ", "); - - if ((*elts == options->print_max - 1) -- && (i != (F77_DIM_SIZE (nss) - 1))) -+ && (i != (F77_DIM_COUNT (nss) - 1))) - fprintf_filtered (stream, "..."); - } - } -@@ -267,6 +275,9 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, - CORE_ADDR addr; - int index; - -+ if (f_object_address_data_valid_print_to_stream (type, stream) != NULL) -+ return; -+ - CHECK_TYPEDEF (type); - switch (TYPE_CODE (type)) - { -diff --git a/gdb/findvar.c b/gdb/findvar.c -index 0647c0f..a2a0a4f 100644 ---- a/gdb/findvar.c -+++ b/gdb/findvar.c -@@ -34,6 +34,7 @@ - #include "block.h" - #include "objfiles.h" - #include "language.h" -+#include "dwarf2loc.h" - - /* Basic byte-swapping routines. All 'extract' functions return a - host-format integer from a target-format integer at ADDR which is -@@ -416,7 +417,10 @@ minsym_lookup_iterator_cb (struct objfile *objfile, void *cb_data) - } - - /* A default implementation for the "la_read_var_value" hook in -- the language vector which should work in most situations. */ -+ the language vector which should work in most situations. -+ We have to first find the address of the variable before allocating struct -+ value to return as its size may depend on DW_OP_PUSH_OBJECT_ADDRESS possibly -+ used by its type. */ - - struct value * - default_read_var_value (struct symbol *var, struct frame_info *frame) -@@ -425,13 +429,6 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) - struct type *type = SYMBOL_TYPE (var); - CORE_ADDR addr; - -- /* Call check_typedef on our type to make sure that, if TYPE is -- a TYPE_CODE_TYPEDEF, its length is set to the length of the target type -- instead of zero. However, we do not replace the typedef type by the -- target type, because we want to keep the typedef in order to be able to -- set the returned value type description correctly. */ -- check_typedef (type); -- - if (symbol_read_needs_frame (var)) - gdb_assert (frame); - -@@ -599,6 +596,9 @@ default_read_var_value (struct symbol *var, struct frame_info *frame) - break; - } - -+ /* ADDR is set here for ALLOCATE_VALUE's CHECK_TYPEDEF for -+ DW_OP_PUSH_OBJECT_ADDRESS. */ -+ object_address_set (addr); - v = value_at_lazy (type, addr); - return v; - } -@@ -702,10 +702,11 @@ struct value * - value_from_register (struct type *type, int regnum, struct frame_info *frame) - { - struct gdbarch *gdbarch = get_frame_arch (frame); -- struct type *type1 = check_typedef (type); - struct value *v; - -- if (gdbarch_convert_register_p (gdbarch, regnum, type1)) -+ type = check_typedef (type); -+ -+ if (gdbarch_convert_register_p (gdbarch, regnum, type)) - { - int optim, unavail, ok; - -@@ -720,7 +721,7 @@ value_from_register (struct type *type, int regnum, struct frame_info *frame) - VALUE_LVAL (v) = lval_register; - VALUE_FRAME_ID (v) = get_frame_id (frame); - VALUE_REGNUM (v) = regnum; -- ok = gdbarch_register_to_value (gdbarch, frame, regnum, type1, -+ ok = gdbarch_register_to_value (gdbarch, frame, regnum, type, - value_contents_raw (v), &optim, - &unavail); - -diff --git a/gdb/gdb-gdb.gdb.in b/gdb/gdb-gdb.gdb.in -index 05a38b2..9801fdf 100644 ---- a/gdb/gdb-gdb.gdb.in -+++ b/gdb/gdb-gdb.gdb.in +Index: gdb-7.8/gdb/gdb-gdb.gdb.in +=================================================================== +--- gdb-7.8.orig/gdb/gdb-gdb.gdb.in 2014-07-29 19:29:02.677979672 +0200 ++++ gdb-7.8/gdb/gdb-gdb.gdb.in 2014-07-29 19:29:04.872982795 +0200 @@ -1,5 +1,15 @@ echo Setting up the environment for debugging gdb.\n @@ -2099,947 +110,10 @@ index 05a38b2..9801fdf 100644 if !$gdb_init_done set variable $gdb_init_done = 1 -diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c -index 8e3090d..758b3c5 100644 ---- a/gdb/gdbtypes.c -+++ b/gdb/gdbtypes.c -@@ -40,6 +40,8 @@ - #include "cp-support.h" - #include "bcache.h" - #include "dwarf2loc.h" -+#include "observer.h" -+#include "dwarf2expr.h" - - /* Initialize BADNESS constants. */ - -@@ -188,6 +190,43 @@ alloc_type (struct objfile *objfile) - return type; - } - -+#if 0 -+/* Declare TYPE as discardable on next garbage collection by free_all_types. -+ You must call type_mark_used during each free_all_types to protect TYPE from -+ being deallocated. */ -+ -+static void -+set_type_as_discardable (struct type *type) -+{ -+ void **slot; -+ -+ gdb_assert (!TYPE_DISCARDABLE (type)); -+ -+ TYPE_DISCARDABLE (type) = 1; -+ TYPE_DISCARDABLE_AGE (type) = type_discardable_age_current; -+ -+ slot = htab_find_slot (type_discardable_table, type, INSERT); -+ gdb_assert (!*slot); -+ *slot = type; -+} -+#endif -+ -+/* Allocate a new type like alloc_type but preserve for it the discardability -+ state of PARENT_TYPE. */ -+ -+static struct type * -+alloc_type_as_parent (struct type *parent_type) -+{ -+ struct type *new_type = alloc_type_copy (parent_type); -+ -+#if 0 -+ if (TYPE_DISCARDABLE (parent_type)) -+ set_type_as_discardable (new_type); -+#endif -+ -+ return new_type; -+} -+ - /* Allocate a new GDBARCH-associated type structure and fill it - with some defaults. Space for the type structure is allocated - on the heap. */ -@@ -328,7 +367,7 @@ make_pointer_type (struct type *type, struct type **typeptr) - - if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ - { -- ntype = alloc_type_copy (type); -+ ntype = alloc_type_as_parent (type); - if (typeptr) - *typeptr = ntype; - } -@@ -401,7 +440,7 @@ make_reference_type (struct type *type, struct type **typeptr) - - if (typeptr == 0 || *typeptr == 0) /* We'll need to allocate one. */ - { -- ntype = alloc_type_copy (type); -+ ntype = alloc_type_as_parent (type); - if (typeptr) - *typeptr = ntype; - } -@@ -824,6 +863,7 @@ create_range_type (struct type *result_type, struct type *index_type, - TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); - TYPE_LOW_BOUND (result_type) = low_bound; - TYPE_HIGH_BOUND (result_type) = high_bound; -+ TYPE_BYTE_STRIDE (result_type) = 0; - - if (low_bound >= 0) - TYPE_UNSIGNED (result_type) = 1; -@@ -944,6 +984,10 @@ get_array_bounds (struct type *type, LONGEST *low_bound, LONGEST *high_bound) - return 1; - } - -+static LONGEST type_length_get (struct type *type, struct type *target_type, -+ int full_span); -+ -+ - /* Create an array type using either a blank type supplied in - RESULT_TYPE, or creating a new type, inheriting the objfile from - RANGE_TYPE. -@@ -967,26 +1011,31 @@ create_array_type (struct type *result_type, - - TYPE_CODE (result_type) = TYPE_CODE_ARRAY; - TYPE_TARGET_TYPE (result_type) = element_type; -- if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -- low_bound = high_bound = 0; -- CHECK_TYPEDEF (element_type); -- /* Be careful when setting the array length. Ada arrays can be -- empty arrays with the high_bound being smaller than the low_bound. -- In such cases, the array length should be zero. */ -- if (high_bound < low_bound) -- TYPE_LENGTH (result_type) = 0; -- else -- TYPE_LENGTH (result_type) = -- TYPE_LENGTH (element_type) * (high_bound - low_bound + 1); - TYPE_NFIELDS (result_type) = 1; - TYPE_FIELDS (result_type) = - (struct field *) TYPE_ZALLOC (result_type, sizeof (struct field)); - TYPE_INDEX_TYPE (result_type) = range_type; - TYPE_VPTR_FIELDNO (result_type) = -1; - -- /* TYPE_FLAG_TARGET_STUB will take care of zero length arrays. */ -+ /* DWARF blocks may depend on runtime information like -+ DW_OP_PUSH_OBJECT_ADDRESS not being available during the -+ CREATE_ARRAY_TYPE time. */ -+ if (TYPE_RANGE_DATA (range_type)->low.kind != RANGE_BOUND_KIND_CONSTANT -+ || TYPE_RANGE_DATA (range_type)->high.kind != RANGE_BOUND_KIND_CONSTANT -+ || TYPE_DYNAMIC (element_type)) -+ TYPE_LENGTH (result_type) = 0; -+ else -+ { -+ CHECK_TYPEDEF (element_type); -+ TYPE_LENGTH (result_type) = type_length_get (result_type, element_type, -+ 0); -+ } - if (TYPE_LENGTH (result_type) == 0) -- TYPE_TARGET_STUB (result_type) = 1; -+ { -+ /* The real size will be computed for specific instances by -+ CHECK_TYPEDEF. */ -+ TYPE_TARGET_STUB (result_type) = 1; -+ } - - return result_type; - } -@@ -1508,6 +1557,105 @@ stub_noname_complaint (void) - complaint (&symfile_complaints, _("stub type has NULL name")); - } - -+/* Calculate the memory length of array TYPE. -+ -+ TARGET_TYPE should be set to `check_typedef (TYPE_TARGET_TYPE (type))' as -+ a performance hint. Feel free to pass NULL. Set FULL_SPAN to return the -+ size incl. the possible padding of the last element - it may differ from the -+ cleared FULL_SPAN return value (the expected SIZEOF) for non-zero -+ TYPE_BYTE_STRIDE values. */ -+ -+static LONGEST -+type_length_get (struct type *type, struct type *target_type, int full_span) -+{ -+ struct type *range_type; -+ LONGEST byte_stride = 0; /* `= 0' for a false GCC warning. */ -+ LONGEST count, element_size, retval; -+ -+ if (TYPE_CODE (type) != TYPE_CODE_ARRAY -+ && TYPE_CODE (type) != TYPE_CODE_STRING) -+ return TYPE_LENGTH (type); -+ -+ /* Avoid executing TYPE_HIGH_BOUND for invalid (unallocated/unassociated) -+ Fortran arrays. The allocated data will never be used so they can be -+ zero-length. */ -+ if (object_address_data_not_valid (type)) -+ return 0; -+ -+ range_type = TYPE_INDEX_TYPE (type); -+ if (TYPE_LOW_BOUND_UNDEFINED (range_type) -+ || TYPE_HIGH_BOUND_UNDEFINED (range_type)) -+ return 0; -+ count = TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type) + 1; -+ /* It may happen for wrong DWARF annotations returning garbage data. */ -+ if (count < 0) -+ warning (_("Range for type %s has invalid bounds %s..%s"), -+ TYPE_ERROR_NAME (type), plongest (TYPE_LOW_BOUND (range_type)), -+ plongest (TYPE_HIGH_BOUND (range_type))); -+ /* The code below does not handle count == 0 right. */ -+ if (count <= 0) -+ return 0; -+ if (full_span || count > 1) -+ { -+ /* We do not use TYPE_ARRAY_BYTE_STRIDE_VALUE (type) here as we want to -+ force FULL_SPAN to 1. */ -+ byte_stride = TYPE_BYTE_STRIDE (range_type); -+ if (byte_stride == 0) -+ { -+ if (target_type == NULL) -+ target_type = check_typedef (TYPE_TARGET_TYPE (type)); -+ byte_stride = type_length_get (target_type, NULL, 1); -+ } -+ } -+ -+ /* For now, we conservatively take the array length to be 0 if its length -+ exceeds UINT_MAX. The code below assumes that for x < 0, -+ (ULONGEST) x == -x + ULONGEST_MAX + 1, which is technically not guaranteed -+ by C, but is usually true (because it would be true if x were unsigned -+ with its high-order bit on). It uses the fact that high_bound-low_bound is -+ always representable in ULONGEST and that if high_bound-low_bound+1 -+ overflows, it overflows to 0. We must change these tests if we decide to -+ increase the representation of TYPE_LENGTH from unsigned int to ULONGEST. -+ */ -+ -+ if (full_span) -+ { -+ retval = count * byte_stride; -+ if (count == 0 || retval / count != byte_stride || retval > UINT_MAX) -+ retval = 0; -+ return retval; -+ } -+ if (target_type == NULL) -+ target_type = check_typedef (TYPE_TARGET_TYPE (type)); -+ element_size = type_length_get (target_type, NULL, 1); -+ retval = (count - 1) * byte_stride + element_size; -+ if (retval < element_size -+ || (byte_stride != 0 -+ && (retval - element_size) / byte_stride != count - 1) -+ || retval > UINT_MAX) -+ retval = 0; -+ return retval; -+} -+ -+/* Prepare TYPE after being read in by the backend. Currently this function -+ only propagates the TYPE_DYNAMIC flag. */ -+ -+void -+finalize_type (struct type *type) -+{ -+ int i; -+ -+ for (i = 0; i < TYPE_NFIELDS (type); ++i) -+ if (TYPE_FIELD_TYPE (type, i) && TYPE_DYNAMIC (TYPE_FIELD_TYPE (type, i))) -+ break; -+ -+ /* FIXME: cplus_stuff is ignored here. */ -+ if (i < TYPE_NFIELDS (type) -+ || (TYPE_VPTR_BASETYPE (type) && TYPE_DYNAMIC (TYPE_VPTR_BASETYPE (type))) -+ || (TYPE_TARGET_TYPE (type) && TYPE_DYNAMIC (TYPE_TARGET_TYPE (type)))) -+ TYPE_DYNAMIC (type) = 1; -+} -+ - /* Find the real type of TYPE. This function returns the real type, - after removing all layers of typedefs, and completing opaque or stub - types. Completion changes the TYPE argument, but stripping of -@@ -1674,52 +1822,37 @@ check_typedef (struct type *type) - } - } - -- if (TYPE_TARGET_STUB (type)) -+ /* copy_type_recursive automatically makes the resulting type containing only -+ constant values expected by the callers of this function. */ -+ if (TYPE_DYNAMIC (type)) -+ { -+ htab_t copied_types; -+ -+ copied_types = create_copied_types_hash (NULL); -+ type = copy_type_recursive (type, copied_types); -+ htab_delete (copied_types); -+ -+ gdb_assert (TYPE_DYNAMIC (type) == 0); -+ /* Force TYPE_LENGTH (type) recalculation. */ -+ TYPE_DYNAMIC (type) = 1; -+ } -+ -+ if (TYPE_TARGET_STUB (type) || TYPE_DYNAMIC (type)) - { -- struct type *range_type; - struct type *target_type = check_typedef (TYPE_TARGET_TYPE (type)); - -+ if (TYPE_DYNAMIC (type)) -+ TYPE_TARGET_TYPE (type) = target_type; - if (TYPE_STUB (target_type) || TYPE_TARGET_STUB (target_type)) - { - /* Nothing we can do. */ - } - else if (TYPE_CODE (type) == TYPE_CODE_ARRAY -- && TYPE_NFIELDS (type) == 1 -- && (TYPE_CODE (range_type = TYPE_INDEX_TYPE (type)) -- == TYPE_CODE_RANGE)) -+ || TYPE_CODE (type) == TYPE_CODE_STRING) - { - /* Now recompute the length of the array type, based on its -- number of elements and the target type's length. -- Watch out for Ada null Ada arrays where the high bound -- is smaller than the low bound. */ -- const LONGEST low_bound = TYPE_LOW_BOUND (range_type); -- const LONGEST high_bound = TYPE_HIGH_BOUND (range_type); -- ULONGEST len; -- -- if (high_bound < low_bound) -- len = 0; -- else -- { -- /* For now, we conservatively take the array length to be 0 -- if its length exceeds UINT_MAX. The code below assumes -- that for x < 0, (ULONGEST) x == -x + ULONGEST_MAX + 1, -- which is technically not guaranteed by C, but is usually true -- (because it would be true if x were unsigned with its -- high-order bit on). It uses the fact that -- high_bound-low_bound is always representable in -- ULONGEST and that if high_bound-low_bound+1 overflows, -- it overflows to 0. We must change these tests if we -- decide to increase the representation of TYPE_LENGTH -- from unsigned int to ULONGEST. */ -- ULONGEST ulow = low_bound, uhigh = high_bound; -- ULONGEST tlen = TYPE_LENGTH (target_type); -- -- len = tlen * (uhigh - ulow + 1); -- if (tlen == 0 || (len / tlen - 1 + ulow) != uhigh -- || len > UINT_MAX) -- len = 0; -- } -- TYPE_LENGTH (type) = len; -+ number of elements and the target type's length. */ -+ TYPE_LENGTH (type) = type_length_get (type, target_type, 0); - TYPE_TARGET_STUB (type) = 0; - } - else if (TYPE_CODE (type) == TYPE_CODE_RANGE) -@@ -1727,6 +1860,7 @@ check_typedef (struct type *type) - TYPE_LENGTH (type) = TYPE_LENGTH (target_type); - TYPE_TARGET_STUB (type) = 0; - } -+ TYPE_DYNAMIC (type) = 0; - } - - type = make_qualified_type (type, instance_flags, NULL); -@@ -3632,33 +3766,42 @@ type_pair_eq (const void *item_lhs, const void *item_rhs) - } - - /* Allocate the hash table used by copy_type_recursive to walk -- types without duplicates. We use OBJFILE's obstack, because -- OBJFILE is about to be deleted. */ -+ types without duplicates. */ - - htab_t - create_copied_types_hash (struct objfile *objfile) - { -- return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq, -- NULL, &objfile->objfile_obstack, -- hashtab_obstack_allocate, -- dummy_obstack_deallocate); -+ if (objfile == NULL) -+ { -+ /* NULL OBJFILE is for TYPE_DYNAMIC types already contained in -+ OBJFILE_MALLOC memory, such as those from VALUE_HISTORY_CHAIN. Table -+ element entries get allocated by xmalloc - so use xfree. */ -+ return htab_create (1, type_pair_hash, type_pair_eq, xfree); -+ } -+ else -+ { -+ /* Use OBJFILE's obstack, because OBJFILE is about to be deleted. Table -+ element entries get allocated by xmalloc - so use xfree. */ -+ return htab_create_alloc_ex (1, type_pair_hash, type_pair_eq, -+ xfree, &objfile->objfile_obstack, -+ hashtab_obstack_allocate, -+ dummy_obstack_deallocate); -+ } - } - --/* Recursively copy (deep copy) TYPE, if it is associated with -- OBJFILE. Return a new type allocated using malloc, a saved type if -- we have already visited TYPE (using COPIED_TYPES), or TYPE if it is -- not associated with OBJFILE. */ -+/* A helper for copy_type_recursive. This does all the work. OBJFILE is used -+ only for an assertion checking. */ - --struct type * --copy_type_recursive (struct objfile *objfile, -- struct type *type, -- htab_t copied_types) -+static struct type * -+copy_type_recursive_1 (struct objfile *objfile, -+ struct type *type, -+ htab_t copied_types) - { - struct type_pair *stored, pair; - void **slot; - struct type *new_type; - -- if (! TYPE_OBJFILE_OWNED (type)) -+ if (! TYPE_OBJFILE_OWNED (type) && !TYPE_DYNAMIC (type)) - return type; - - /* This type shouldn't be pointing to any types in other objfiles; -@@ -3673,9 +3816,10 @@ copy_type_recursive (struct objfile *objfile, - new_type = alloc_type_arch (get_type_arch (type)); - - /* We must add the new type to the hash table immediately, in case -- we encounter this type again during a recursive call below. */ -- stored -- = obstack_alloc (&objfile->objfile_obstack, sizeof (struct type_pair)); -+ we encounter this type again during a recursive call below. Memory could -+ be allocated from OBJFILE in the case we will be removing OBJFILE, this -+ optimization is missed and xfree is called for it from COPIED_TYPES. */ -+ stored = xmalloc (sizeof (*stored)); - stored->old = type; - stored->new = new_type; - *slot = stored; -@@ -3686,6 +3830,21 @@ copy_type_recursive (struct objfile *objfile, - TYPE_OBJFILE_OWNED (new_type) = 0; - TYPE_OWNER (new_type).gdbarch = get_type_arch (type); - -+#if 0 -+ /* TYPE_MAIN_TYPE memory copy above rewrote the TYPE_DISCARDABLE flag so we -+ need to initialize it again. And even if TYPE was already discardable -+ NEW_TYPE so far is not registered in TYPE_DISCARDABLE_TABLE. */ -+ TYPE_DISCARDABLE (new_type) = 0; -+ set_type_as_discardable (new_type); -+#endif -+ -+ /* Pre-clear the fields processed by delete_main_type. If DWARF block -+ evaluations below call error we would leave an unfreeable TYPE. */ -+ TYPE_TARGET_TYPE (new_type) = NULL; -+ TYPE_VPTR_BASETYPE (new_type) = NULL; -+ TYPE_NFIELDS (new_type) = 0; -+ TYPE_FIELDS (new_type) = NULL; -+ - if (TYPE_NAME (type)) - TYPE_NAME (new_type) = xstrdup (TYPE_NAME (type)); - if (TYPE_TAG_NAME (type)) -@@ -3694,12 +3853,48 @@ copy_type_recursive (struct objfile *objfile, - TYPE_INSTANCE_FLAGS (new_type) = TYPE_INSTANCE_FLAGS (type); - TYPE_LENGTH (new_type) = TYPE_LENGTH (type); - -+ if (TYPE_ALLOCATED (new_type)) -+ { -+ gdb_assert (!TYPE_NOT_ALLOCATED (new_type)); -+ -+ if (!dwarf_locexpr_baton_eval (TYPE_ALLOCATED (new_type))) -+ TYPE_NOT_ALLOCATED (new_type) = 1; -+ TYPE_ALLOCATED (new_type) = NULL; -+ } -+ -+ if (TYPE_ASSOCIATED (new_type)) -+ { -+ gdb_assert (!TYPE_NOT_ASSOCIATED (new_type)); -+ -+ if (!dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (new_type))) -+ TYPE_NOT_ASSOCIATED (new_type) = 1; -+ TYPE_ASSOCIATED (new_type) = NULL; -+ } -+ -+ if (!TYPE_DATA_LOCATION_IS_ADDR (new_type) -+ && TYPE_DATA_LOCATION_DWARF_BLOCK (new_type)) -+ { -+ if (TYPE_NOT_ALLOCATED (new_type) -+ || TYPE_NOT_ASSOCIATED (new_type)) -+ TYPE_DATA_LOCATION_DWARF_BLOCK (new_type) = NULL; -+ else -+ { -+ TYPE_DATA_LOCATION_IS_ADDR (new_type) = 1; -+ TYPE_DATA_LOCATION_ADDR (new_type) = dwarf_locexpr_baton_eval -+ (TYPE_DATA_LOCATION_DWARF_BLOCK (new_type)); -+ } -+ } -+ - /* Copy the fields. */ - if (TYPE_NFIELDS (type)) - { - int i, nfields; - -+ /* TYPE_CODE_RANGE uses TYPE_RANGE_DATA of the union with TYPE_FIELDS. */ -+ gdb_assert (TYPE_CODE (type) != TYPE_CODE_RANGE); -+ - nfields = TYPE_NFIELDS (type); -+ TYPE_NFIELDS (new_type) = nfields; - TYPE_FIELDS (new_type) = XCALLOC (nfields, struct field); - for (i = 0; i < nfields; i++) - { -@@ -3708,8 +3903,8 @@ copy_type_recursive (struct objfile *objfile, - TYPE_FIELD_BITSIZE (new_type, i) = TYPE_FIELD_BITSIZE (type, i); - if (TYPE_FIELD_TYPE (type, i)) - TYPE_FIELD_TYPE (new_type, i) -- = copy_type_recursive (objfile, TYPE_FIELD_TYPE (type, i), -- copied_types); -+ = copy_type_recursive_1 (objfile, TYPE_FIELD_TYPE (type, i), -+ copied_types); - if (TYPE_FIELD_NAME (type, i)) - TYPE_FIELD_NAME (new_type, i) = - xstrdup (TYPE_FIELD_NAME (type, i)); -@@ -3740,24 +3935,184 @@ copy_type_recursive (struct objfile *objfile, - } - } - -+ /* Both FIELD_LOC_KIND_DWARF_BLOCK and TYPE_RANGE_HIGH_BOUND_IS_COUNT were -+ possibly converted. */ -+ TYPE_DYNAMIC (new_type) = 0; -+ - /* For range types, copy the bounds information. */ -- if (TYPE_CODE (type) == TYPE_CODE_RANGE) -+ if (TYPE_CODE (new_type) == TYPE_CODE_RANGE) - { - TYPE_RANGE_DATA (new_type) = xmalloc (sizeof (struct range_bounds)); - *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type); -+ -+ switch (TYPE_RANGE_DATA (new_type)->low.kind) -+ { -+ case RANGE_BOUND_KIND_CONSTANT: -+ break; -+ case RANGE_BOUND_KIND_DWARF_BLOCK: -+ /* `struct dwarf2_locexpr_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type) -+ || ! has_stack_frames ()) -+ { -+ /* We should set 1 for Fortran but how to find the language? */ -+ TYPE_LOW_BOUND (new_type) = 0; -+ TYPE_LOW_BOUND_UNDEFINED (new_type) = 1; -+ } -+ else -+ { -+ TYPE_LOW_BOUND (new_type) = dwarf_locexpr_baton_eval -+ (TYPE_RANGE_DATA (new_type)->low.u.dwarf_block); -+ if (TYPE_LOW_BOUND (new_type) >= 0) -+ TYPE_UNSIGNED (new_type) = 1; -+ } -+ TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT; -+ break; -+ case RANGE_BOUND_KIND_DWARF_LOCLIST: -+ { -+ CORE_ADDR addr; -+ -+ /* `struct dwarf2_loclist_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (! TYPE_NOT_ALLOCATED (new_type) -+ && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames () -+ && dwarf_loclist_baton_eval -+ (TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.loclist, -+ TYPE_RANGE_DATA (new_type)->low.u.dwarf_loclist.type, &addr)) -+ { -+ TYPE_LOW_BOUND (new_type) = addr; -+ if (TYPE_LOW_BOUND (new_type) >= 0) -+ TYPE_UNSIGNED (new_type) = 1; -+ } -+ else -+ { -+ /* We should set 1 for Fortran but how to find the language? */ -+ TYPE_LOW_BOUND (new_type) = 0; -+ TYPE_LOW_BOUND_UNDEFINED (new_type) = 1; -+ } -+ TYPE_RANGE_DATA (new_type)->low.kind = RANGE_BOUND_KIND_CONSTANT; -+ } -+ break; -+ } -+ -+ switch (TYPE_RANGE_DATA (new_type)->high.kind) -+ { -+ case RANGE_BOUND_KIND_CONSTANT: -+ break; -+ case RANGE_BOUND_KIND_DWARF_BLOCK: -+ /* `struct dwarf2_locexpr_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type) -+ || ! has_stack_frames ()) -+ { -+ TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1; -+ TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1; -+ } -+ else -+ TYPE_HIGH_BOUND (new_type) = dwarf_locexpr_baton_eval -+ (TYPE_RANGE_DATA (new_type)->high.u.dwarf_block); -+ TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT; -+ break; -+ case RANGE_BOUND_KIND_DWARF_LOCLIST: -+ { -+ CORE_ADDR addr; -+ -+ /* `struct dwarf2_loclist_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (! TYPE_NOT_ALLOCATED (new_type) -+ && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames () -+ && dwarf_loclist_baton_eval -+ (TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.loclist, -+ TYPE_RANGE_DATA (new_type)->high.u.dwarf_loclist.type, -+ &addr)) -+ TYPE_HIGH_BOUND (new_type) = addr; -+ else -+ { -+ TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) - 1; -+ TYPE_HIGH_BOUND_UNDEFINED (new_type) = 1; -+ } -+ TYPE_RANGE_DATA (new_type)->high.kind = RANGE_BOUND_KIND_CONSTANT; -+ } -+ break; -+ } -+ -+ switch (TYPE_RANGE_DATA (new_type)->byte_stride.kind) -+ { -+ case RANGE_BOUND_KIND_CONSTANT: -+ break; -+ case RANGE_BOUND_KIND_DWARF_BLOCK: -+ /* `struct dwarf2_locexpr_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (TYPE_NOT_ALLOCATED (new_type) || TYPE_NOT_ASSOCIATED (new_type) -+ || ! has_stack_frames ()) -+ TYPE_BYTE_STRIDE (new_type) = 0; -+ else -+ TYPE_BYTE_STRIDE (new_type) = dwarf_locexpr_baton_eval -+ (TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_block); -+ TYPE_RANGE_DATA (new_type)->byte_stride.kind -+ = RANGE_BOUND_KIND_CONSTANT; -+ break; -+ case RANGE_BOUND_KIND_DWARF_LOCLIST: -+ { -+ CORE_ADDR addr = 0; -+ -+ /* `struct dwarf2_loclist_baton' is too bound to its objfile so -+ it is expected to be made constant by CHECK_TYPEDEF. -+ TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are not valid for TYPE. -+ */ -+ if (! TYPE_NOT_ALLOCATED (new_type) -+ && ! TYPE_NOT_ASSOCIATED (new_type) && has_stack_frames ()) -+ dwarf_loclist_baton_eval -+ (TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.loclist, -+ TYPE_RANGE_DATA (new_type)->byte_stride.u.dwarf_loclist.type, -+ &addr); -+ TYPE_BYTE_STRIDE (new_type) = addr; -+ TYPE_RANGE_DATA (new_type)->byte_stride.kind -+ = RANGE_BOUND_KIND_CONSTANT; -+ } -+ break; -+ } -+ -+ /* Convert TYPE_RANGE_HIGH_BOUND_IS_COUNT into a regular bound. */ -+ if (TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type)) -+ { -+ TYPE_HIGH_BOUND (new_type) = TYPE_LOW_BOUND (new_type) -+ + TYPE_HIGH_BOUND (new_type) - 1; -+ TYPE_RANGE_HIGH_BOUND_IS_COUNT (new_type) = 0; -+ } - } - - /* Copy pointers to other types. */ - if (TYPE_TARGET_TYPE (type)) - TYPE_TARGET_TYPE (new_type) = -- copy_type_recursive (objfile, -- TYPE_TARGET_TYPE (type), -- copied_types); -+ copy_type_recursive_1 (objfile, -+ TYPE_TARGET_TYPE (type), -+ copied_types); - if (TYPE_VPTR_BASETYPE (type)) - TYPE_VPTR_BASETYPE (new_type) = -- copy_type_recursive (objfile, -- TYPE_VPTR_BASETYPE (type), -- copied_types); -+ copy_type_recursive_1 (objfile, -+ TYPE_VPTR_BASETYPE (type), -+ copied_types); -+ -+ if (TYPE_CODE (new_type) == TYPE_CODE_ARRAY) -+ { -+ struct type *new_index_type = TYPE_INDEX_TYPE (new_type); -+ -+ if (TYPE_BYTE_STRIDE (new_index_type) == 0) -+ TYPE_BYTE_STRIDE (new_index_type) -+ = TYPE_LENGTH (TYPE_TARGET_TYPE (new_type)); -+ } -+ - /* Maybe copy the type_specific bits. - - NOTE drow/2005-12-09: We do not copy the C++-specific bits like -@@ -3774,6 +4129,17 @@ copy_type_recursive (struct objfile *objfile, - return new_type; - } - -+/* Recursively copy (deep copy) TYPE. Return a new type allocated using -+ malloc, a saved type if we have already visited TYPE (using COPIED_TYPES), -+ or TYPE if it is not associated with OBJFILE. */ -+ -+struct type * -+copy_type_recursive (struct type *type, -+ htab_t copied_types) -+{ -+ return copy_type_recursive_1 (TYPE_OBJFILE (type), type, copied_types); -+} -+ - /* Make a copy of the given TYPE, except that the pointer & reference - types are not preserved. - -@@ -4330,6 +4696,13 @@ void - _initialize_gdbtypes (void) - { - gdbtypes_data = gdbarch_data_register_post_init (gdbtypes_post_init); -+ -+#if 0 -+ type_discardable_table = htab_create_alloc (20, type_discardable_hash, -+ type_discardable_equal, NULL, -+ xcalloc, xfree); -+#endif -+ - objfile_type_data = register_objfile_data (); - - add_setshow_zuinteger_cmd ("overload", no_class, &overload_debug, -diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h -index 61ddeff..fc6f276 100644 ---- a/gdb/gdbtypes.h -+++ b/gdb/gdbtypes.h -@@ -226,6 +226,11 @@ enum type_instance_flag_value - - #define TYPE_TARGET_STUB(t) (TYPE_MAIN_TYPE (t)->flag_target_stub) - -+/* Type needs to be evaluated on each CHECK_TYPEDEF and its results must not be -+ sticky. */ -+ -+#define TYPE_DYNAMIC(t) (TYPE_MAIN_TYPE (t)->flag_dynamic) -+ - /* Static type. If this is set, the corresponding type had - a static modifier. - Note: This may be unnecessary, since static data members -@@ -309,6 +314,50 @@ enum type_instance_flag_value - - #define TYPE_FLAG_ENUM(t) (TYPE_MAIN_TYPE (t)->flag_flag_enum) - -+#if 0 -+/* Define this type as being reclaimable during free_all_types. Type is -+ required to be have TYPE_OBJFILE set to NULL. Setting this flag requires -+ initializing TYPE_DISCARDABLE_AGE, see alloc_type_discardable. */ -+ -+#define TYPE_DISCARDABLE(t) (TYPE_MAIN_TYPE (t)->flag_discardable) -+ -+/* Marker this type has been visited by the type_mark_used by this -+ mark-and-sweep types garbage collecting pass. Current pass is represented -+ by TYPE_DISCARDABLE_AGE_CURRENT. */ -+ -+#define TYPE_DISCARDABLE_AGE(t) (TYPE_MAIN_TYPE (t)->flag_discardable_age) -+#endif -+ -+/* Is HIGH_BOUND a low-bound relative count (1) or the high bound itself (0)? */ -+ -+#define TYPE_RANGE_HIGH_BOUND_IS_COUNT(range_type) \ -+ (TYPE_MAIN_TYPE (range_type)->flag_range_high_bound_is_count) -+ -+/* Not allocated. TYPE_ALLOCATED(t) must be NULL in such case. If this flag -+ is unset and TYPE_ALLOCATED(t) is NULL then the type is allocated. If this -+ flag is unset and TYPE_ALLOCATED(t) is not NULL then its DWARF block -+ determines the actual allocation state. */ -+ -+#define TYPE_NOT_ALLOCATED(t) (TYPE_MAIN_TYPE (t)->flag_not_allocated) -+ -+/* Not associated. TYPE_ASSOCIATED(t) must be NULL in such case. If this flag -+ is unset and TYPE_ASSOCIATED(t) is NULL then the type is associated. If -+ this flag is unset and TYPE_ASSOCIATED(t) is not NULL then its DWARF block -+ determines the actual association state. */ -+ -+#define TYPE_NOT_ASSOCIATED(t) (TYPE_MAIN_TYPE (t)->flag_not_associated) -+ -+/* Address of the actual data as for DW_AT_data_location. Its dwarf block must -+ not be evaluated unless both TYPE_NOT_ALLOCATED and TYPE_NOT_ASSOCIATED are -+ false. If TYPE_DATA_LOCATION_IS_ADDR set then TYPE_DATA_LOCATION_ADDR value -+ is the actual data address value. If unset and -+ TYPE_DATA_LOCATION_DWARF_BLOCK is NULL then the value is the normal -+ value_raw_address. If unset and TYPE_DATA_LOCATION_DWARF_BLOCK is not NULL -+ then its DWARF block determines the actual data address. */ -+ -+#define TYPE_DATA_LOCATION_IS_ADDR(t) \ -+ (TYPE_MAIN_TYPE (t)->flag_data_location_is_addr) -+ - /* Constant type. If this is set, the corresponding type has a - const modifier. */ - -@@ -425,6 +474,15 @@ struct main_type - /* True if this type was declared with "class" rather than - "struct". */ - unsigned int flag_declared_class : 1; -+#if 0 -+ unsigned int flag_discardable : 1; -+ unsigned int flag_discardable_age : 1; -+#endif -+ unsigned int flag_dynamic : 1; -+ unsigned int flag_range_high_bound_is_count : 1; -+ unsigned int flag_not_allocated : 1; -+ unsigned int flag_not_associated : 1; -+ unsigned int flag_data_location_is_addr : 1; - - /* True if this is an enum type with disjoint values. This affects - how the enum is printed. */ -@@ -505,6 +563,20 @@ struct main_type - - struct type *target_type; - -+ /* For DW_AT_data_location. */ -+ union -+ { -+ struct dwarf2_locexpr_baton *dwarf_block; -+ CORE_ADDR addr; -+ } -+ data_location; -+ -+ /* For DW_AT_allocated. */ -+ struct dwarf2_locexpr_baton *allocated; -+ -+ /* For DW_AT_associated. */ -+ struct dwarf2_locexpr_baton *associated; -+ - /* For structure and union types, a description of each field. - For set and pascal array types, there is one "field", - whose type is the domain type of the set or array. -@@ -587,13 +659,34 @@ struct main_type - - struct range_bounds - { -+ struct -+ { -+ union -+ { -+ LONGEST constant; -+ struct dwarf2_locexpr_baton *dwarf_block; -+ struct -+ { -+ struct dwarf2_loclist_baton *loclist; -+ struct type *type; -+ } -+ dwarf_loclist; -+ } -+ u; -+ enum range_bound_kind -+ { -+ RANGE_BOUND_KIND_CONSTANT, -+ RANGE_BOUND_KIND_DWARF_BLOCK, -+ RANGE_BOUND_KIND_DWARF_LOCLIST -+ } -+ kind; -+ } - /* Low bound of range. */ -- -- LONGEST low; -- -+ low, - /* High bound of range. */ -- -- LONGEST high; -+ high, -+ /* Byte stride of range. */ -+ byte_stride; - - /* Flags indicating whether the values of low and high are - valid. When true, the respective range value is -@@ -1053,9 +1146,9 @@ extern void allocate_gnat_aux_type (struct type *); - #define TYPE_POINTER_TYPE(thistype) (thistype)->pointer_type - #define TYPE_REFERENCE_TYPE(thistype) (thistype)->reference_type - #define TYPE_CHAIN(thistype) (thistype)->chain --/* Note that if thistype is a TYPEDEF type, you have to call check_typedef. -- But check_typedef does set the TYPE_LENGTH of the TYPEDEF type, -- so you only have to call check_typedef once. Since allocate_value -+/* Note that if thistype is a TYPEDEF, ARRAY or STRING type, you have to call -+ check_typedef. But check_typedef does set the TYPE_LENGTH of the TYPEDEF -+ type, so you only have to call check_typedef once. Since allocate_value - calls check_typedef, TYPE_LENGTH (VALUE_TYPE (X)) is safe. */ - #define TYPE_LENGTH(thistype) (thistype)->length - /* Note that TYPE_CODE can be TYPE_CODE_TYPEDEF, so if you want the real -@@ -1063,11 +1156,16 @@ extern void allocate_gnat_aux_type (struct type *); - #define TYPE_CODE(thistype) TYPE_MAIN_TYPE(thistype)->code - #define TYPE_NFIELDS(thistype) TYPE_MAIN_TYPE(thistype)->nfields - #define TYPE_FIELDS(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.fields -+#define TYPE_DATA_LOCATION_DWARF_BLOCK(thistype) TYPE_MAIN_TYPE (thistype)->data_location.dwarf_block -+#define TYPE_DATA_LOCATION_ADDR(thistype) TYPE_MAIN_TYPE (thistype)->data_location.addr -+#define TYPE_ALLOCATED(thistype) TYPE_MAIN_TYPE (thistype)->allocated -+#define TYPE_ASSOCIATED(thistype) TYPE_MAIN_TYPE (thistype)->associated - - #define TYPE_INDEX_TYPE(type) TYPE_FIELD_TYPE (type, 0) - #define TYPE_RANGE_DATA(thistype) TYPE_MAIN_TYPE(thistype)->flds_bnds.bounds --#define TYPE_LOW_BOUND(range_type) TYPE_RANGE_DATA(range_type)->low --#define TYPE_HIGH_BOUND(range_type) TYPE_RANGE_DATA(range_type)->high -+#define TYPE_LOW_BOUND(range_type) TYPE_RANGE_DATA(range_type)->low.u.constant -+#define TYPE_HIGH_BOUND(range_type) TYPE_RANGE_DATA(range_type)->high.u.constant -+#define TYPE_BYTE_STRIDE(range_type) TYPE_RANGE_DATA(range_type)->byte_stride.u.constant - #define TYPE_LOW_BOUND_UNDEFINED(range_type) \ - TYPE_RANGE_DATA(range_type)->low_undefined - #define TYPE_HIGH_BOUND_UNDEFINED(range_type) \ -@@ -1084,7 +1182,14 @@ extern void allocate_gnat_aux_type (struct type *); - (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) - - #define TYPE_ARRAY_LOWER_BOUND_VALUE(arraytype) \ -- (TYPE_LOW_BOUND(TYPE_INDEX_TYPE((arraytype)))) -+ TYPE_LOW_BOUND (TYPE_INDEX_TYPE (arraytype)) -+ -+/* TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) with a fallback to the -+ element size if no specific stride value is known. */ -+#define TYPE_ARRAY_BYTE_STRIDE_VALUE(arraytype) \ -+ (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype)) == 0 \ -+ ? TYPE_LENGTH (TYPE_TARGET_TYPE (arraytype)) \ -+ : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (arraytype))) - - /* C++ */ - -@@ -1533,6 +1638,18 @@ extern struct type *create_array_type (struct type *, struct type *, - struct type *); - extern struct type *lookup_array_range_type (struct type *, LONGEST, LONGEST); - -+extern CORE_ADDR type_range_any_field_internal (struct type *range_type, -+ int fieldno); -+ -+extern int type_range_high_bound_internal (struct type *range_type); -+ -+extern int type_range_count_bound_internal (struct type *range_type); -+ -+extern CORE_ADDR type_range_byte_stride_internal (struct type *range_type, -+ struct type *element_type); -+ -+extern void finalize_type (struct type *type); -+ - extern struct type *create_string_type (struct type *, struct type *, - struct type *); - extern struct type *lookup_string_range_type (struct type *, LONGEST, LONGEST); -@@ -1578,6 +1695,10 @@ extern int is_public_ancestor (struct type *, struct type *); - - extern int is_unique_ancestor (struct type *, struct value *); - -+#if 0 -+extern void type_mark_used (struct type *type); -+#endif -+ - /* Overload resolution */ - - #define LENGTH_MATCH(bv) ((bv)->rank[0]) -@@ -1656,8 +1777,7 @@ extern void maintenance_print_type (char *, int); - - extern htab_t create_copied_types_hash (struct objfile *objfile); - --extern struct type *copy_type_recursive (struct objfile *objfile, -- struct type *type, -+extern struct type *copy_type_recursive (struct type *type, - htab_t copied_types); - - extern struct type *copy_type (const struct type *type); -diff --git a/gdb/main.c b/gdb/main.c -index 0c8349e..a07f41a 100644 ---- a/gdb/main.c -+++ b/gdb/main.c +Index: gdb-7.8/gdb/main.c +=================================================================== +--- gdb-7.8.orig/gdb/main.c 2014-07-29 19:29:02.678979673 +0200 ++++ gdb-7.8/gdb/main.c 2014-07-29 19:29:04.872982795 +0200 @@ -37,6 +37,7 @@ #include "interps.h" @@ -3047,8 +121,8 @@ index 0c8349e..a07f41a 100644 +#include "python/python.h" #include "source.h" #include "cli/cli-cmds.h" - #include "python/python.h" -@@ -325,6 +326,8 @@ captured_main (void *data) + #include "objfiles.h" +@@ -417,6 +418,8 @@ captured_main (void *data) char *cdarg = NULL; char *ttyarg = NULL; @@ -3057,7 +131,7 @@ index 0c8349e..a07f41a 100644 /* These are static so that we can take their address in an initializer. */ static int print_help; -@@ -531,10 +534,14 @@ captured_main (void *data) +@@ -624,10 +627,14 @@ captured_main (void *data) {"args", no_argument, &set_args, 1}, {"l", required_argument, 0, 'l'}, {"return-child-result", no_argument, &return_child_result, 1}, @@ -3073,7 +147,7 @@ index 0c8349e..a07f41a 100644 { int option_index; -@@ -552,6 +559,9 @@ captured_main (void *data) +@@ -645,6 +652,9 @@ captured_main (void *data) case 0: /* Long option that just sets a flag. */ break; @@ -3083,7 +157,7 @@ index 0c8349e..a07f41a 100644 case OPT_SE: symarg = optarg; execarg = optarg; -@@ -761,7 +771,31 @@ captured_main (void *data) +@@ -849,7 +859,31 @@ captured_main (void *data) /* Now that gdb_init has created the initial inferior, we're in position to set args for that inferior. */ @@ -3116,7 +190,7 @@ index 0c8349e..a07f41a 100644 { /* The remaining options are the command-line options for the inferior. The first one is the sym/exec file, and the rest -@@ -1047,7 +1081,8 @@ captured_main (void *data) +@@ -1135,7 +1169,8 @@ captured_main (void *data) /* Read in the old history after all the command files have been read. */ @@ -3126,7 +200,7 @@ index 0c8349e..a07f41a 100644 if (batch_flag) { -@@ -1058,13 +1093,25 @@ captured_main (void *data) +@@ -1146,13 +1181,25 @@ captured_main (void *data) /* Show time and/or space usage. */ do_cleanups (pre_stat_chain); @@ -3158,7 +232,7 @@ index 0c8349e..a07f41a 100644 } /* No exit -- exit is through quit_command. */ } -@@ -1099,6 +1146,12 @@ print_gdb_help (struct ui_file *stream) +@@ -1186,6 +1233,12 @@ print_gdb_help (struct ui_file *stream) fputs_unfiltered (_("\ This is the GNU debugger. Usage:\n\n\ gdb [options] [executable-file [core-file or process-id]]\n\ @@ -3171,7 +245,7 @@ index 0c8349e..a07f41a 100644 gdb [options] --args executable-file [inferior-arguments ...]\n\n\ "), stream); fputs_unfiltered (_("\ -@@ -1144,6 +1197,13 @@ Output and user interface control:\n\n\ +@@ -1231,6 +1284,13 @@ Output and user interface control:\n\n\ fputs_unfiltered (_("\ --dbx DBX compatibility mode.\n\ --xdb XDB compatibility mode.\n\ @@ -3182,303 +256,13 @@ index 0c8349e..a07f41a 100644 + arguments are passed to script.\n"), stream); +#endif + fputs_unfiltered (_("\ - --quiet Do not print version number on startup.\n\n\ + -q, --quiet, --silent\n\ + Do not print version number on startup.\n\n\ "), stream); - fputs_unfiltered (_("\ -diff --git a/gdb/p-valprint.c b/gdb/p-valprint.c -index a87f1f4..0f93271 100644 ---- a/gdb/p-valprint.c -+++ b/gdb/p-valprint.c -@@ -38,6 +38,7 @@ - #include "cp-abi.h" - #include "cp-support.h" - #include "exceptions.h" -+#include "dwarf2loc.h" - - - /* Decorations for Pascal. */ -@@ -73,8 +74,31 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - struct type *char_type; - CORE_ADDR addr; - int want_space = 0; -+ struct cleanup *back_to; -+ struct type *saved_type = type; -+ CORE_ADDR saved_address = address; -+ -+ back_to = make_cleanup (null_cleanup, 0); -+ address += embedded_offset; -+ type = object_address_get_data (type, &address); -+ if (type == NULL) -+ { -+ fputs_filtered (object_address_data_not_valid (saved_type), stream); -+ gdb_flush (stream); -+ do_cleanups (back_to); -+ return; -+ } -+ if (address != saved_address + embedded_offset) -+ { -+ size_t length = TYPE_LENGTH (type); - -- CHECK_TYPEDEF (type); -+ valaddr = xmalloc (length); -+ make_cleanup (xfree, (gdb_byte *) valaddr); -+ read_memory (address, (gdb_byte *) valaddr, length); -+ embedded_offset = 0; -+ } -+ else -+ address -= embedded_offset; - switch (TYPE_CODE (type)) - { - case TYPE_CODE_ARRAY: -@@ -130,8 +154,8 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - { - i = 0; - } -- val_print_array_elements (type, valaddr, embedded_offset, -- address, stream, recurse, -+ val_print_array_elements (saved_type, valaddr, embedded_offset, -+ saved_address, stream, recurse, - original_value, options, i); - fprintf_filtered (stream, "}"); - } -@@ -169,6 +193,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - { - /* Try to print what function it points to. */ - print_address_demangle (options, gdbarch, addr, stream, demangle); -+ do_cleanups (back_to); - return; - } - -@@ -271,6 +296,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - } - } - -+ do_cleanups (back_to); - return; - - case TYPE_CODE_REF: -@@ -411,6 +437,7 @@ pascal_val_print (struct type *type, const gdb_byte *valaddr, - TYPE_CODE (type)); - } - gdb_flush (stream); -+ do_cleanups (back_to); - } - - void -diff --git a/gdb/parse.c b/gdb/parse.c -index 1171289..2afdb85 100644 ---- a/gdb/parse.c -+++ b/gdb/parse.c -@@ -1773,6 +1773,7 @@ parser_fprintf (FILE *x, const char *y, ...) - - int - operator_check_standard (struct expression *exp, int pos, -+ int (*type_func) (struct type *type, void *data), - int (*objfile_func) (struct objfile *objfile, - void *data), - void *data) -@@ -1812,7 +1813,7 @@ operator_check_standard (struct expression *exp, int pos, - struct type *type = elts[pos + 2 + arg].type; - struct objfile *objfile = TYPE_OBJFILE (type); - -- if (objfile && (*objfile_func) (objfile, data)) -+ if (objfile && objfile_func && (*objfile_func) (objfile, data)) - return 1; - } - } -@@ -1830,7 +1831,8 @@ operator_check_standard (struct expression *exp, int pos, - - /* Check objfile where the variable itself is placed. - SYMBOL_OBJ_SECTION (symbol) may be NULL. */ -- if ((*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data)) -+ if (objfile_func -+ && (*objfile_func) (SYMBOL_SYMTAB (symbol)->objfile, data)) - return 1; - - /* Check objfile where is placed the code touching the variable. */ -@@ -1843,24 +1845,27 @@ operator_check_standard (struct expression *exp, int pos, - - /* Invoke callbacks for TYPE and OBJFILE if they were set as non-NULL. */ - -- if (type && TYPE_OBJFILE (type) -+ if (type && type_func && (*type_func) (type, data)) -+ return 1; -+ if (type && TYPE_OBJFILE (type) && objfile_func - && (*objfile_func) (TYPE_OBJFILE (type), data)) - return 1; -- if (objfile && (*objfile_func) (objfile, data)) -+ if (objfile && objfile_func && (*objfile_func) (objfile, data)) - return 1; - - return 0; - } - --/* Call OBJFILE_FUNC for any TYPE and OBJFILE found being referenced by EXP. -- The functions are never called with NULL OBJFILE. Functions get passed an -- arbitrary caller supplied DATA pointer. If any of the functions returns -- non-zero value then (any other) non-zero value is immediately returned to -- the caller. Otherwise zero is returned after iterating through whole EXP. -- */ -+/* Call TYPE_FUNC and OBJFILE_FUNC for any TYPE and OBJFILE found being -+ referenced by EXP. The functions are never called with NULL TYPE or NULL -+ OBJFILE. Functions get passed an arbitrary caller supplied DATA pointer. -+ If any of the functions returns non-zero value then (any other) non-zero -+ value is immediately returned to the caller. Otherwise zero is returned -+ after iterating through whole EXP. */ - - static int - exp_iterate (struct expression *exp, -+ int (*type_func) (struct type *type, void *data), - int (*objfile_func) (struct objfile *objfile, void *data), - void *data) - { -@@ -1875,7 +1880,9 @@ exp_iterate (struct expression *exp, - - pos = endpos - oplen; - if (exp->language_defn->la_exp_desc->operator_check (exp, pos, -- objfile_func, data)) -+ type_func, -+ objfile_func, -+ data)) - return 1; - - endpos = pos; -@@ -1906,8 +1913,29 @@ exp_uses_objfile (struct expression *exp, struct objfile *objfile) - { - gdb_assert (objfile->separate_debug_objfile_backlink == NULL); - -- return exp_iterate (exp, exp_uses_objfile_iter, objfile); -+ return exp_iterate (exp, NULL, exp_uses_objfile_iter, objfile); -+} -+ -+/* Helper for exp_types_mark_used. */ -+ -+#if 0 -+static int -+exp_types_mark_used_iter (struct type *type, void *unused) -+{ -+ type_mark_used (type); -+ -+ /* Continue the traversal. */ -+ return 0; -+} -+ -+/* Call type_mark_used for any type contained in EXP. */ -+ -+void -+exp_types_mark_used (struct expression *exp) -+{ -+ exp_iterate (exp, exp_types_mark_used_iter, NULL, NULL); - } -+#endif - - void - _initialize_parse (void) -diff --git a/gdb/parser-defs.h b/gdb/parser-defs.h -index c3f2607..fa0af7b 100644 ---- a/gdb/parser-defs.h -+++ b/gdb/parser-defs.h -@@ -245,6 +245,8 @@ extern void operator_length_standard (const struct expression *, int, int *, - int *); - - extern int operator_check_standard (struct expression *exp, int pos, -+ int (*type_func) (struct type *type, -+ void *data), - int (*objfile_func) - (struct objfile *objfile, void *data), - void *data); -@@ -331,6 +333,7 @@ struct exp_descriptor - value should be immediately returned to the caller. Otherwise zero - should be returned. */ - int (*operator_check) (struct expression *exp, int pos, -+ int (*type_func) (struct type *type, void *data), - int (*objfile_func) (struct objfile *objfile, - void *data), - void *data); -diff --git a/gdb/printcmd.c b/gdb/printcmd.c -index 10d3c23..5759d5c 100644 ---- a/gdb/printcmd.c -+++ b/gdb/printcmd.c -@@ -50,6 +50,7 @@ - #include "cli/cli-utils.h" - #include "format.h" - #include "source.h" -+#include "dwarf2loc.h" - - #ifdef TUI - #include "tui/tui.h" /* For tui_active et al. */ -@@ -979,6 +980,11 @@ print_command_1 (const char *exp, int voidprint) - else - val = access_value_history (0); - -+ /* Do not try to OBJECT_ADDRESS_SET here anything. We are interested in the -+ source variable base addresses as found by READ_VAR_VALUE. The value here -+ can be already a calculated expression address inappropriate for -+ DW_OP_push_object_address. */ -+ - if (voidprint || (val && value_type (val) && - TYPE_CODE (value_type (val)) != TYPE_CODE_VOID)) - { -@@ -1060,6 +1066,9 @@ output_command_const (const char *exp, int from_tty) - - val = evaluate_expression (expr); - -+ if (VALUE_LVAL (val) == lval_memory) -+ object_address_set (value_raw_address (val)); -+ - annotate_value_begin (value_type (val)); - - get_formatted_print_options (&opts, format); -@@ -1494,6 +1503,24 @@ x_command (char *exp, int from_tty) - set_internalvar (lookup_internalvar ("__"), last_examine_value); - } - } -+ -+#if 0 -+/* Call type_mark_used for any TYPEs referenced from this GDB source file. */ -+ -+static void -+print_types_mark_used (void) -+{ -+ struct display *d; -+ -+ if (last_examine_value) -+ type_mark_used (value_type (last_examine_value)); -+ -+ for (d = display_chain; d; d = d->next) -+ if (d->exp) -+ exp_types_mark_used (d->exp); -+} -+#endif -+ - - - /* Add an expression to the auto-display chain. -@@ -1995,6 +2022,10 @@ print_variable_and_value (const char *name, struct symbol *var, - struct value_print_options opts; - - val = read_var_value (var, frame); -+ -+ make_cleanup_restore_selected_frame (); -+ select_frame (frame); -+ - get_user_print_options (&opts); - opts.deref_ref = 1; - common_val_print (val, stream, indent, &opts, current_language); -@@ -2651,4 +2682,8 @@ Show printing of source filename and line number with ."), NULL, - add_com ("eval", no_class, eval_command, _("\ - Convert \"printf format string\", arg1, arg2, arg3, ..., argn to\n\ - a command line, and call it.")); -+ -+#if 0 -+ observer_attach_mark_used (print_types_mark_used); -+#endif - } -diff --git a/gdb/python/lib/gdb/command/ignore_errors.py b/gdb/python/lib/gdb/command/ignore_errors.py -new file mode 100644 -index 0000000..6fa48ff ---- /dev/null -+++ b/gdb/python/lib/gdb/command/ignore_errors.py +Index: gdb-7.8/gdb/python/lib/gdb/command/ignore_errors.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.8/gdb/python/lib/gdb/command/ignore_errors.py 2014-07-29 19:29:04.872982795 +0200 @@ -0,0 +1,37 @@ +# Ignore errors in user commands. + @@ -3517,11 +301,10 @@ index 0000000..6fa48ff + pass + +IgnoreErrorsCommand () -diff --git a/gdb/python/lib/gdb/command/pahole.py b/gdb/python/lib/gdb/command/pahole.py -new file mode 100644 -index 0000000..636f99d ---- /dev/null -+++ b/gdb/python/lib/gdb/command/pahole.py +Index: gdb-7.8/gdb/python/lib/gdb/command/pahole.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.8/gdb/python/lib/gdb/command/pahole.py 2014-07-29 19:29:04.873982797 +0200 @@ -0,0 +1,81 @@ +# pahole command for gdb + @@ -3604,11 +387,10 @@ index 0000000..636f99d + self.pahole (type, 0, '') + +Pahole() -diff --git a/gdb/python/lib/gdb/function/caller_is.py b/gdb/python/lib/gdb/function/caller_is.py -new file mode 100644 -index 0000000..2b9c5c7 ---- /dev/null -+++ b/gdb/python/lib/gdb/function/caller_is.py +Index: gdb-7.8/gdb/python/lib/gdb/function/caller_is.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.8/gdb/python/lib/gdb/function/caller_is.py 2014-07-29 19:29:04.873982797 +0200 @@ -0,0 +1,58 @@ +# Caller-is functions. + @@ -3668,11 +450,10 @@ index 0000000..2b9c5c7 + +CallerIs() +CallerMatches() -diff --git a/gdb/python/lib/gdb/function/in_scope.py b/gdb/python/lib/gdb/function/in_scope.py -new file mode 100644 -index 0000000..debb3bb ---- /dev/null -+++ b/gdb/python/lib/gdb/function/in_scope.py +Index: gdb-7.8/gdb/python/lib/gdb/function/in_scope.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.8/gdb/python/lib/gdb/function/in_scope.py 2014-07-29 19:29:04.873982797 +0200 @@ -0,0 +1,47 @@ +# In-scope function. + @@ -3721,238 +502,11 @@ index 0000000..debb3bb + return wanted == found + +InScope () -diff --git a/gdb/python/py-type.c b/gdb/python/py-type.c -index 16bb442..8cf6deb 100644 ---- a/gdb/python/py-type.c -+++ b/gdb/python/py-type.c -@@ -29,6 +29,8 @@ - #include "language.h" - #include "vec.h" - #include "typeprint.h" -+#include "observer.h" -+#include "gdb_assert.h" - - typedef struct pyty_type_object - { -@@ -37,11 +39,19 @@ typedef struct pyty_type_object - - /* If a Type object is associated with an objfile, it is kept on a - doubly-linked list, rooted in the objfile. This lets us copy the -- underlying struct type when the objfile is deleted. */ -+ underlying struct type when the objfile is deleted. -+ -+ With NULL objfile Type still can be doubly-linked in the list -+ PYTY_OBJECTS_DISCARDABLE. */ - struct pyty_type_object *prev; - struct pyty_type_object *next; - } type_object; - -+#if 0 -+/* First element of a doubly-linked list of TYPE_DISCARDABLE Types. */ -+static type_object *pyty_objects_discardable; -+#endif -+ - static PyTypeObject type_object_type - CPYCHECKER_TYPE_OBJECT_FOR_TYPEDEF ("type_object"); - -@@ -1024,8 +1034,63 @@ typy_richcompare (PyObject *self, PyObject *other, int op) - - - -+/* Key associated with each objfile pointing to the first element of -+ a doubly-linked list of Types associated with this objfile. */ - static const struct objfile_data *typy_objfile_data_key; - -+/* Link TYPE_OBJ to its appropriate list. Either to its objfile associated one -+ or at least to the global list for TYPE_DISCARDABLE Types. Permanent types -+ do not get linked anywhere. */ -+static void -+typy_link (type_object *type_obj) -+{ -+ type_obj->prev = NULL; -+ -+ if (type_obj->type && TYPE_OBJFILE (type_obj->type)) -+ { -+ struct objfile *objfile = TYPE_OBJFILE (type_obj->type); -+ -+ type_obj->next = objfile_data (objfile, typy_objfile_data_key); -+ if (type_obj->next) -+ type_obj->next->prev = type_obj; -+ set_objfile_data (objfile, typy_objfile_data_key, type_obj); -+ } -+#if 0 -+ else if (type_obj->type && TYPE_DISCARDABLE (type_obj->type)) -+ { -+ type_obj->next = pyty_objects_discardable; -+ if (type_obj->next) -+ type_obj->next->prev = type_obj; -+ pyty_objects_discardable = type_obj; -+ } -+#endif -+ else -+ type_obj->next = NULL; -+} -+ -+/* Unlink TYPE_OBJ from its current list. Permanent types are not linked -+ anywhere and this function has no effect on them. */ -+static void -+typy_unlink (type_object *type_obj) -+{ -+ if (type_obj->prev) -+ type_obj->prev->next = type_obj->next; -+ else if (type_obj->type && TYPE_OBJFILE (type_obj->type)) -+ { -+ /* Must reset head of list. */ -+ struct objfile *objfile = TYPE_OBJFILE (type_obj->type); -+ -+ set_objfile_data (objfile, typy_objfile_data_key, type_obj->next); -+ } -+#if 0 -+ else if (pyty_objects_discardable == type_obj) -+ pyty_objects_discardable = type_obj->next; -+#endif -+ -+ if (type_obj->next) -+ type_obj->next->prev = type_obj->prev; -+} -+ - static void - save_objfile_types (struct objfile *objfile, void *datum) - { -@@ -1046,12 +1111,13 @@ save_objfile_types (struct objfile *objfile, void *datum) - { - type_object *next = obj->next; - -- htab_empty (copied_types); -+ gdb_assert (TYPE_OBJFILE (obj->type) == objfile); -+ typy_unlink (obj); - -- obj->type = copy_type_recursive (objfile, obj->type, copied_types); -+ obj->type = copy_type_recursive (obj->type, copied_types); - -- obj->next = NULL; -- obj->prev = NULL; -+ gdb_assert (TYPE_OBJFILE (obj->type) == NULL); -+ typy_link (obj); - - obj = next; - } -@@ -1062,43 +1128,28 @@ save_objfile_types (struct objfile *objfile, void *datum) - } - - static void --set_type (type_object *obj, struct type *type) -+typy_dealloc (PyObject *obj) - { -- obj->type = type; -- obj->prev = NULL; -- if (type && TYPE_OBJFILE (type)) -- { -- struct objfile *objfile = TYPE_OBJFILE (type); -+ type_object *type_obj = (type_object *) obj; - -- obj->next = objfile_data (objfile, typy_objfile_data_key); -- if (obj->next) -- obj->next->prev = obj; -- set_objfile_data (objfile, typy_objfile_data_key, obj); -- } -- else -- obj->next = NULL; -+ typy_unlink (type_obj); -+ -+ type_obj->ob_type->tp_free (obj); - } - -+#if 0 -+/* Call type_mark_used for any TYPEs referenced from this GDB source file. */ - static void --typy_dealloc (PyObject *obj) -+typy_types_mark_used (void) - { -- type_object *type = (type_object *) obj; -- -- if (type->prev) -- type->prev->next = type->next; -- else if (type->type && TYPE_OBJFILE (type->type)) -- { -- /* Must reset head of list. */ -- struct objfile *objfile = TYPE_OBJFILE (type->type); -- -- if (objfile) -- set_objfile_data (objfile, typy_objfile_data_key, type->next); -- } -- if (type->next) -- type->next->prev = type->prev; -+ type_object *type_obj; - -- Py_TYPE (type)->tp_free (type); -+ for (type_obj = pyty_objects_discardable; -+ type_obj != NULL; -+ type_obj = type_obj->next) -+ type_mark_used (type_obj->type); - } -+#endif - - /* Return number of fields ("length" of the field dictionary). */ - -@@ -1318,7 +1369,10 @@ type_to_type_object (struct type *type) - - type_obj = PyObject_New (type_object, &type_object_type); - if (type_obj) -- set_type (type_obj, type); -+ { -+ type_obj->type = type; -+ typy_link (type_obj); -+ } - - return (PyObject *) type_obj; - } -diff --git a/gdb/python/py-value.c b/gdb/python/py-value.c -index 4ab782d..eed91b878 100644 ---- a/gdb/python/py-value.c -+++ b/gdb/python/py-value.c -@@ -29,6 +29,7 @@ - #include "expression.h" - #include "cp-abi.h" - #include "python.h" -+#include "observer.h" - - #ifdef HAVE_PYTHON - -@@ -1503,12 +1504,28 @@ gdbpy_is_value_object (PyObject *obj) - return PyObject_TypeCheck (obj, &value_object_type); - } - -+#if 0 -+/* Call type_mark_used for any TYPEs referenced from this GDB source file. */ -+ -+static void -+python_types_mark_used (void) -+{ -+ value_object *iter; -+ -+ for (iter = values_in_python; iter; iter = iter->next) -+ type_mark_used (value_type (iter->value)); -+} -+#endif -+ - int - gdbpy_initialize_values (void) - { - if (PyType_Ready (&value_object_type) < 0) - return -1; - -+#if 0 -+ observer_attach_mark_used (python_types_mark_used); -+#endif - return gdb_pymodule_addobject (gdb_module, "Value", - (PyObject *) &value_object_type); - } -diff --git a/gdb/python/python.c b/gdb/python/python.c -index 337c170..873c0dc 100644 ---- a/gdb/python/python.c -+++ b/gdb/python/python.c -@@ -67,6 +67,8 @@ static const char *gdbpy_should_print_stack = python_excp_message; +Index: gdb-7.8/gdb/python/python.c +=================================================================== +--- gdb-7.8.orig/gdb/python/python.c 2014-07-29 19:29:02.679979674 +0200 ++++ gdb-7.8/gdb/python/python.c 2014-07-29 19:29:04.873982797 +0200 +@@ -95,6 +95,8 @@ const struct extension_language_defn ext #include "linespec.h" #include "source.h" #include "version.h" @@ -3960,8 +514,8 @@ index 337c170..873c0dc 100644 +#include "gdbthread.h" #include "target.h" #include "gdbthread.h" - #include "observer.h" -@@ -1116,6 +1118,56 @@ gdbpy_print_stack (void) + #include "interps.h" +@@ -1222,6 +1224,56 @@ gdbpy_print_stack (void) /* Return the current Progspace. There always is one. */ @@ -4018,7 +572,7 @@ index 337c170..873c0dc 100644 static PyObject * gdbpy_get_current_progspace (PyObject *unused1, PyObject *unused2) -@@ -1831,6 +1883,8 @@ static PyMethodDef GdbMethods[] = +@@ -1910,6 +1962,8 @@ static PyMethodDef GdbMethods[] = Evaluate command, a string, as a gdb CLI command. Optionally returns\n\ a Python String containing the output of the command if to_string is\n\ set to True." }, @@ -4027,3101 +581,21 @@ index 337c170..873c0dc 100644 { "parameter", gdbpy_parameter, METH_VARARGS, "Return a gdb parameter's value" }, -diff --git a/gdb/python/python.h b/gdb/python/python.h -index 96bf7c2..79ad6c9 100644 ---- a/gdb/python/python.h -+++ b/gdb/python/python.h -@@ -108,6 +108,8 @@ void eval_python_from_control_command (struct command_line *); +Index: gdb-7.8/gdb/python/python.h +=================================================================== +--- gdb-7.8.orig/gdb/python/python.h 2014-07-29 19:29:02.679979674 +0200 ++++ gdb-7.8/gdb/python/python.h 2014-07-29 19:29:04.873982797 +0200 +@@ -25,4 +25,6 @@ + /* This is all that python exports to gdb. */ + extern const struct extension_language_defn extension_language_python; - void source_python_script (FILE *file, const char *filename); - -+void run_python_script (int argc, char **argv); ++extern void run_python_script (int argc, char **argv); + - int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, -diff --git a/gdb/stack.c b/gdb/stack.c -index 314e4da..d07a9c2 100644 ---- a/gdb/stack.c -+++ b/gdb/stack.c -@@ -537,6 +537,10 @@ print_frame_args (struct symbol *func, struct frame_info *frame, - stb = mem_fileopen (); - old_chain = make_cleanup_ui_file_delete (stb); - -+ /* Frame may be needed for check_typedef of TYPE_DYNAMIC. */ -+ make_cleanup_restore_selected_frame (); -+ select_frame (frame); -+ - if (func) - { - struct block *b = SYMBOL_BLOCK_VALUE (func); -diff --git a/gdb/testsuite/gdb.ada/packed_array.exp b/gdb/testsuite/gdb.ada/packed_array.exp -index afc1475..7e94c49 100644 ---- a/gdb/testsuite/gdb.ada/packed_array.exp -+++ b/gdb/testsuite/gdb.ada/packed_array.exp -@@ -56,5 +56,11 @@ gdb_test_multiple "$test" "$test" { - # are. Observed with (FSF GNU Ada 4.5.3 20110124). - xfail $test - } -+ -re "= \\(\\)\[\r\n\]+$gdb_prompt $" { -+ # archer-jankratochvil-vla resolves it as a dynamic type resolved as an -+ # empty array [0..-1]. -+ # DW_AT_upper_bound : (DW_OP_fbreg: -48; DW_OP_deref) -+ xfail $test -+ } - } - -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S -new file mode 100644 -index 0000000..83faaf6 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer-foo.S -@@ -0,0 +1,457 @@ -+ .file "x86_64-vla-pointer.c" -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .text -+.Ltext0: -+.globl foo -+ .type foo, @function -+foo: -+.LFB2: -+ .file 1 "x86_64-vla-pointer.c" -+ .loc 1 22 0 -+ pushq %rbp -+.LCFI0: -+ movq %rsp, %rbp -+.LCFI1: -+ subq $64, %rsp -+.LCFI2: -+ movl %edi, -36(%rbp) -+ .loc 1 22 0 -+ movq %rsp, %rax -+ movq %rax, -48(%rbp) -+ .loc 1 23 0 -+ movl -36(%rbp), %edx -+ movslq %edx,%rax -+ subq $1, %rax -+ movq %rax, -24(%rbp) -+ .loc 1 24 0 -+ movslq %edx,%rax -+ addq $15, %rax -+ addq $15, %rax -+ shrq $4, %rax -+ salq $4, %rax -+ subq %rax, %rsp -+ movq %rsp, -56(%rbp) -+ movq -56(%rbp), %rax -+ addq $15, %rax -+ shrq $4, %rax -+ salq $4, %rax -+ movq %rax, -56(%rbp) -+ movq -56(%rbp), %rax -+ movq %rax, -16(%rbp) -+ .loc 1 27 0 -+ movl $0, -4(%rbp) -+ jmp .L2 -+.L3: -+ .loc 1 28 0 -+ movl -4(%rbp), %esi -+ movl -4(%rbp), %eax -+ movl %eax, %ecx -+ movq -16(%rbp), %rdx -+ movslq %esi,%rax -+ movb %cl, (%rdx,%rax) -+ .loc 1 27 0 -+ addl $1, -4(%rbp) -+.L2: -+ movl -4(%rbp), %eax -+ cmpl -36(%rbp), %eax -+ jl .L3 -+ .loc 1 30 0 -+ .globl break_here -+break_here: -+ movq -16(%rbp), %rax -+ movb $0, (%rax) -+ movq -48(%rbp), %rsp -+ .loc 1 31 0 -+ leave -+ ret -+.LFE2: -+ .size foo, .-foo -+ .section .debug_frame,"",@progbits -+.Lframe0: -+ .long .LECIE0-.LSCIE0 -+.LSCIE0: -+ .long 0xffffffff -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE0: -+.LSFDE0: -+ .long .LEFDE0-.LASFDE0 -+.LASFDE0: -+ .long .Lframe0 -+ .quad .LFB2 -+ .quad .LFE2-.LFB2 -+ .byte 0x4 -+ .long .LCFI0-.LFB2 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x86 -+ .uleb128 0x2 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xd -+ .uleb128 0x6 -+ .align 8 -+.LEFDE0: -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "zR" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .uleb128 0x1 -+ .byte 0x3 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .long .LFB2 -+ .long .LFE2-.LFB2 -+ .uleb128 0x0 -+ .byte 0x4 -+ .long .LCFI0-.LFB2 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x86 -+ .uleb128 0x2 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xd -+ .uleb128 0x6 -+ .align 8 -+.LEFDE1: -+ .text -+.Letext0: -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .quad .LFB2-.Ltext0 -+ .quad .LCFI0-.Ltext0 -+ .value 0x2 -+ .byte 0x77 -+ .sleb128 8 -+ .quad .LCFI0-.Ltext0 -+ .quad .LCFI1-.Ltext0 -+ .value 0x2 -+ .byte 0x77 -+ .sleb128 16 -+ .quad .LCFI1-.Ltext0 -+ .quad .LFE2-.Ltext0 -+ .value 0x2 -+ .byte 0x76 -+ .sleb128 16 -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_info -+.Ldebug_relative: -+ .long .Ldebug_end - .Ldebug_start -+.Ldebug_start: -+ .value 0x2 -+ .long .Ldebug_abbrev0 -+ .byte 0x8 -+ .uleb128 0x1 -+ .long .LASF2 -+ .byte 0x1 -+ .long .LASF3 -+ .long .LASF4 -+ .quad .Ltext0 -+ .quad .Letext0 -+ .long .Ldebug_line0 -+ .uleb128 0x2 -+ .byte 0x1 -+ .string "foo" -+ .byte 0x1 -+ .byte 0x16 -+ .byte 0x1 -+ .quad .LFB2 -+ .quad .LFE2 -+ .long .LLST0 -+ .long .Ltype_int - .Ldebug_relative -+ .uleb128 0x3 -+ .long .LASF5 -+ .byte 0x1 -+ .byte 0x15 -+ .long .Ltype_int - .Ldebug_relative -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 -52 -+.Ltag_pointer: -+ .uleb128 0x4 -+ .byte 0x8 /* DW_AT_byte_size */ -+ .long .Ltag_array_type - .debug_info /* DW_AT_type */ -+ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */ -+ .long .LASF0 -+ .byte 0x1 -+ .byte 0x18 -+#if 1 -+ .long .Ltag_pointer - .debug_info -+#else -+ /* Debugging only: Skip the typedef indirection. */ -+ .long .Ltag_array_type - .debug_info -+#endif -+ /* DW_AT_location: DW_FORM_block1: start */ -+ .byte 0x3 -+ .byte 0x91 -+ .sleb128 -32 -+#if 0 -+ .byte 0x6 /* DW_OP_deref */ -+#else -+ .byte 0x96 /* DW_OP_nop */ -+#endif -+ /* DW_AT_location: DW_FORM_block1: end */ -+ .uleb128 0x6 -+ .string "i" -+ .byte 0x1 -+ .byte 0x19 -+ .long .Ltype_int - .Ldebug_relative -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 -20 -+ .byte 0x0 -+.Ltype_int: -+ .uleb128 0x7 -+ .byte 0x4 -+ .byte 0x5 -+ .string "int" -+.Ltag_array_type: -+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ -+ .long .Ltype_char - .Ldebug_relative -+ .long .Ltype_ulong - .Ldebug_relative /* DW_AT_sibling: DW_FORM_ref4 */ -+1: /* DW_AT_data_location: DW_FORM_block1: start */ -+ .byte 2f - 3f /* length */ -+3: -+ .byte 0x97 /* DW_OP_push_object_address */ -+#if 1 -+ .byte 0x6 /* DW_OP_deref */ -+#else -+ .byte 0x96 /* DW_OP_nop */ -+#endif -+2: /* DW_AT_data_location: DW_FORM_block1: end */ -+ .uleb128 0x9 -+ .long .Ltype_char - .Ldebug_relative /* DW_AT_type: DW_FORM_ref4 */ -+ .byte 0x3 -+ .byte 0x91 -+ .sleb128 -40 -+ .byte 0x6 -+ .byte 0x0 -+.Ltype_ulong: -+ .uleb128 0xa -+ .byte 0x8 -+ .byte 0x7 -+.Ltype_char: -+ .uleb128 0xb -+ .byte 0x1 -+ .byte 0x6 -+ .long .LASF1 -+ .byte 0x0 -+.Ldebug_end: -+ .section .debug_abbrev -+ .uleb128 0x1 -+ .uleb128 0x11 -+ .byte 0x1 -+ .uleb128 0x25 -+ .uleb128 0xe -+ .uleb128 0x13 -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x1b -+ .uleb128 0xe -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x10 -+ .uleb128 0x6 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x2 -+ .uleb128 0x2e -+ .byte 0x1 -+ .uleb128 0x3f -+ .uleb128 0xc -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x27 -+ .uleb128 0xc -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x40 -+ .uleb128 0x6 -+ .uleb128 0x1 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x5 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x4 /* .Ltag_pointer abbrev */ -+ .uleb128 0x0f /* DW_TAG_pointer_type */ -+ .byte 0x0 -+ .uleb128 0x0b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x5 -+ .uleb128 0x34 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x6 -+ .uleb128 0x34 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x7 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ -+ .uleb128 0x1 -+ .byte 0x1 -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x1 /* DW_AT_sibling */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x50 /* DW_AT_data_location */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x9 -+ .uleb128 0x21 -+ .byte 0x0 -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x2f -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0xa -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0xe -+ .byte 0x0 -+ .byte 0x0 -+ .byte 0x0 -+ .section .debug_pubnames,"",@progbits -+ .long 0x16 -+ .value 0x2 -+ .long .Ldebug_info0 -+ .long 0xa8 -+ .long 0x2d -+ .string "foo" -+ .long 0x0 -+ .section .debug_aranges,"",@progbits -+ .long 0x2c -+ .value 0x2 -+ .long .Ldebug_info0 -+ .byte 0x8 -+ .byte 0x0 -+ .value 0x0 -+ .value 0x0 -+ .quad .Ltext0 -+ .quad .Letext0-.Ltext0 -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_str,"MS",@progbits,1 -+.LASF0: -+ .string "array" -+.LASF5: -+ .string "size" -+.LASF3: -+ .string "x86_64-vla-pointer.c" -+.LASF6: -+ .string "array_t" -+.LASF1: -+ .string "char" -+.LASF4: -+ .string "gdb.arch" -+.LASF2: -+ .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 -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c -new file mode 100644 -index 0000000..fe2c8f7 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.c -@@ -0,0 +1,43 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 . */ -+ -+#if 0 -+ -+void -+foo (int size) -+{ -+ typedef char array_t[size]; -+ array_t array; -+ int i; -+ -+ for (i = 0; i < size; i++) -+ array[i] = i; -+ -+ array[0] = 0; /* break-here */ -+} -+ -+#else -+ -+int -+main (void) -+{ -+ foo (26); -+ foo (78); -+ return 0; -+} -+ -+#endif -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp -new file mode 100644 -index 0000000..d243cf1 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-pointer.exp -@@ -0,0 +1,66 @@ -+# Copyright 2009 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 . -+ -+if ![istarget "x86_64-*-*"] then { -+ verbose "Skipping over gdb.arch/x86_64-vla-pointer.exp test made only for x86_64." -+ return -+} -+ -+set testfile x86_64-vla-pointer -+set srcasmfile ${testfile}-foo.S -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+set binobjfile ${objdir}/${subdir}/${testfile}-foo.o -+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] { -+ untested x86_64-vla-pointer -+ return -1 -+} -+ -+gdb_breakpoint "break_here" -+ -+gdb_continue_to_breakpoint "break_here" -+ -+gdb_test "whatis array" "type = char \\(\\*\\)\\\[variable\\\]" "first: whatis array" -+gdb_test "ptype array" "type = char \\(\\*\\)\\\[26\\\]" "first: ptype array" -+ -+gdb_test "whatis *array" "type = char \\\[26\\\]" "first: whatis *array" -+gdb_test "ptype *array" "type = char \\\[26\\\]" "first: ptype *array" -+ -+gdb_test "p (*array)\[1\]" "\\$\[0-9\] = 1 '\\\\001'" -+gdb_test "p (*array)\[2\]" "\\$\[0-9\] = 2 '\\\\002'" -+gdb_test "p (*array)\[3\]" "\\$\[0-9\] = 3 '\\\\003'" -+gdb_test "p (*array)\[4\]" "\\$\[0-9\] = 4 '\\\\004'" -+ -+gdb_continue_to_breakpoint "break_here" -+ -+gdb_test "whatis array" "type = char \\(\\*\\)\\\[variable\\\]" "second: whatis array" -+gdb_test "ptype array" "type = char \\(\\*\\)\\\[78\\\]" "second: ptype array" -+ -+gdb_test "whatis *array" "type = char \\\[78\\\]" "second: whatis *array" -+gdb_test "ptype *array" "type = char \\\[78\\\]" "second: ptype *array" -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S -new file mode 100644 -index 0000000..66f7a39 ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef-foo.S -@@ -0,0 +1,455 @@ -+ .file "x86_64-vla-typedef.c" -+ .section .debug_abbrev,"",@progbits -+.Ldebug_abbrev0: -+ .section .debug_info,"",@progbits -+.Ldebug_info0: -+ .section .debug_line,"",@progbits -+.Ldebug_line0: -+ .text -+.Ltext0: -+.globl foo -+ .type foo, @function -+foo: -+.LFB2: -+ .file 1 "x86_64-vla-typedef.c" -+ .loc 1 22 0 -+ pushq %rbp -+.LCFI0: -+ movq %rsp, %rbp -+.LCFI1: -+ subq $64, %rsp -+.LCFI2: -+ movl %edi, -36(%rbp) -+ .loc 1 22 0 -+ movq %rsp, %rax -+ movq %rax, -48(%rbp) -+ .loc 1 23 0 -+ movl -36(%rbp), %edx -+ movslq %edx,%rax -+ subq $1, %rax -+ movq %rax, -24(%rbp) -+ .loc 1 24 0 -+ movslq %edx,%rax -+ addq $15, %rax -+ addq $15, %rax -+ shrq $4, %rax -+ salq $4, %rax -+ subq %rax, %rsp -+ movq %rsp, -56(%rbp) -+ movq -56(%rbp), %rax -+ addq $15, %rax -+ shrq $4, %rax -+ salq $4, %rax -+ movq %rax, -56(%rbp) -+ movq -56(%rbp), %rax -+ movq %rax, -16(%rbp) -+ .loc 1 27 0 -+ movl $0, -4(%rbp) -+ jmp .L2 -+.L3: -+ .loc 1 28 0 -+ movl -4(%rbp), %esi -+ movl -4(%rbp), %eax -+ movl %eax, %ecx -+ movq -16(%rbp), %rdx -+ movslq %esi,%rax -+ movb %cl, (%rdx,%rax) -+ .loc 1 27 0 -+ addl $1, -4(%rbp) -+.L2: -+ movl -4(%rbp), %eax -+ cmpl -36(%rbp), %eax -+ jl .L3 -+ .loc 1 30 0 -+ .globl break_here -+break_here: -+ movq -16(%rbp), %rax -+ movb $0, (%rax) -+ movq -48(%rbp), %rsp -+ .loc 1 31 0 -+ leave -+ ret -+.LFE2: -+ .size foo, .-foo -+ .section .debug_frame,"",@progbits -+.Lframe0: -+ .long .LECIE0-.LSCIE0 -+.LSCIE0: -+ .long 0xffffffff -+ .byte 0x1 -+ .string "" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE0: -+.LSFDE0: -+ .long .LEFDE0-.LASFDE0 -+.LASFDE0: -+ .long .Lframe0 -+ .quad .LFB2 -+ .quad .LFE2-.LFB2 -+ .byte 0x4 -+ .long .LCFI0-.LFB2 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x86 -+ .uleb128 0x2 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xd -+ .uleb128 0x6 -+ .align 8 -+.LEFDE0: -+ .section .eh_frame,"a",@progbits -+.Lframe1: -+ .long .LECIE1-.LSCIE1 -+.LSCIE1: -+ .long 0x0 -+ .byte 0x1 -+ .string "zR" -+ .uleb128 0x1 -+ .sleb128 -8 -+ .byte 0x10 -+ .uleb128 0x1 -+ .byte 0x3 -+ .byte 0xc -+ .uleb128 0x7 -+ .uleb128 0x8 -+ .byte 0x90 -+ .uleb128 0x1 -+ .align 8 -+.LECIE1: -+.LSFDE1: -+ .long .LEFDE1-.LASFDE1 -+.LASFDE1: -+ .long .LASFDE1-.Lframe1 -+ .long .LFB2 -+ .long .LFE2-.LFB2 -+ .uleb128 0x0 -+ .byte 0x4 -+ .long .LCFI0-.LFB2 -+ .byte 0xe -+ .uleb128 0x10 -+ .byte 0x86 -+ .uleb128 0x2 -+ .byte 0x4 -+ .long .LCFI1-.LCFI0 -+ .byte 0xd -+ .uleb128 0x6 -+ .align 8 -+.LEFDE1: -+ .text -+.Letext0: -+ .section .debug_loc,"",@progbits -+.Ldebug_loc0: -+.LLST0: -+ .quad .LFB2-.Ltext0 -+ .quad .LCFI0-.Ltext0 -+ .value 0x2 -+ .byte 0x77 -+ .sleb128 8 -+ .quad .LCFI0-.Ltext0 -+ .quad .LCFI1-.Ltext0 -+ .value 0x2 -+ .byte 0x77 -+ .sleb128 16 -+ .quad .LCFI1-.Ltext0 -+ .quad .LFE2-.Ltext0 -+ .value 0x2 -+ .byte 0x76 -+ .sleb128 16 -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_info -+ .long .Ldebug_end - .Ldebug_start -+.Ldebug_start: -+ .value 0x2 -+ .long .Ldebug_abbrev0 -+ .byte 0x8 -+ .uleb128 0x1 -+ .long .LASF2 -+ .byte 0x1 -+ .long .LASF3 -+ .long .LASF4 -+ .quad .Ltext0 -+ .quad .Letext0 -+ .long .Ldebug_line0 -+ .uleb128 0x2 -+ .byte 0x1 -+ .string "foo" -+ .byte 0x1 -+ .byte 0x16 -+ .byte 0x1 -+ .quad .LFB2 -+ .quad .LFE2 -+ .long .LLST0 -+ .long 0x83 -+ .uleb128 0x3 -+ .long .LASF5 -+ .byte 0x1 -+ .byte 0x15 -+ .long 0x83 -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 -52 -+.Ltag_typedef: -+ .uleb128 0x4 -+ .long .LASF6 -+ .byte 0x1 -+ .byte 0x17 -+ .long .Ltag_array_type - .debug_info -+ .uleb128 0x5 /* Abbrev Number: 5 (DW_TAG_variable) */ -+ .long .LASF0 -+ .byte 0x1 -+ .byte 0x18 -+#if 1 -+ .long .Ltag_typedef - .debug_info -+#else -+ /* Debugging only: Skip the typedef indirection. */ -+ .long .Ltag_array_type - .debug_info -+#endif -+ /* DW_AT_location: DW_FORM_block1: start */ -+ .byte 0x3 -+ .byte 0x91 -+ .sleb128 -32 -+#if 0 -+ .byte 0x6 /* DW_OP_deref */ -+#else -+ .byte 0x96 /* DW_OP_nop */ -+#endif -+ /* DW_AT_location: DW_FORM_block1: end */ -+ .uleb128 0x6 -+ .string "i" -+ .byte 0x1 -+ .byte 0x19 -+ .long 0x83 -+ .byte 0x2 -+ .byte 0x91 -+ .sleb128 -20 -+ .byte 0x0 -+ .uleb128 0x7 -+ .byte 0x4 -+ .byte 0x5 -+ .string "int" -+.Ltag_array_type: -+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ -+ .long 0xa0 + (2f - 1f) /* DW_AT_type: DW_FORM_ref4 */ -+ .long 0x9d + (2f - 1f) /* DW_AT_sibling: DW_FORM_ref4 */ -+1: /* DW_AT_data_location: DW_FORM_block1: start */ -+ .byte 2f - 3f /* length */ -+3: -+ .byte 0x97 /* DW_OP_push_object_address */ -+ .byte 0x6 /* DW_OP_deref */ -+2: /* DW_AT_data_location: DW_FORM_block1: end */ -+ .uleb128 0x9 -+ .long 0x9d + (2b - 1b) /* DW_AT_type: DW_FORM_ref4 */ -+ .byte 0x3 -+ .byte 0x91 -+ .sleb128 -40 -+ .byte 0x6 -+ .byte 0x0 -+ .uleb128 0xa -+ .byte 0x8 -+ .byte 0x7 -+ .uleb128 0xb -+ .byte 0x1 -+ .byte 0x6 -+ .long .LASF1 -+ .byte 0x0 -+.Ldebug_end: -+ .section .debug_abbrev -+ .uleb128 0x1 -+ .uleb128 0x11 -+ .byte 0x1 -+ .uleb128 0x25 -+ .uleb128 0xe -+ .uleb128 0x13 -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x1b -+ .uleb128 0xe -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x10 -+ .uleb128 0x6 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x2 -+ .uleb128 0x2e -+ .byte 0x1 -+ .uleb128 0x3f -+ .uleb128 0xc -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x27 -+ .uleb128 0xc -+ .uleb128 0x11 -+ .uleb128 0x1 -+ .uleb128 0x12 -+ .uleb128 0x1 -+ .uleb128 0x40 -+ .uleb128 0x6 -+ .uleb128 0x1 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x5 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x4 -+ .uleb128 0x16 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x5 -+ .uleb128 0x34 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0xe -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x6 -+ .uleb128 0x34 -+ .byte 0x0 -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .uleb128 0x3a -+ .uleb128 0xb -+ .uleb128 0x3b -+ .uleb128 0xb -+ .uleb128 0x49 -+ .uleb128 0x13 -+ .uleb128 0x2 -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x7 -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0x8 -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x8 /* Abbrev Number: 8 (DW_TAG_array_type) */ -+ .uleb128 0x1 -+ .byte 0x1 -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x1 /* DW_AT_sibling */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x50 /* DW_AT_data_location */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0x9 -+ .uleb128 0x21 -+ .byte 0x0 -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x2f -+ .uleb128 0xa -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0xa -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .byte 0x0 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0x24 -+ .byte 0x0 -+ .uleb128 0xb -+ .uleb128 0xb -+ .uleb128 0x3e -+ .uleb128 0xb -+ .uleb128 0x3 -+ .uleb128 0xe -+ .byte 0x0 -+ .byte 0x0 -+ .byte 0x0 -+ .section .debug_pubnames,"",@progbits -+ .long 0x16 -+ .value 0x2 -+ .long .Ldebug_info0 -+ .long 0xa8 -+ .long 0x2d -+ .string "foo" -+ .long 0x0 -+ .section .debug_aranges,"",@progbits -+ .long 0x2c -+ .value 0x2 -+ .long .Ldebug_info0 -+ .byte 0x8 -+ .byte 0x0 -+ .value 0x0 -+ .value 0x0 -+ .quad .Ltext0 -+ .quad .Letext0-.Ltext0 -+ .quad 0x0 -+ .quad 0x0 -+ .section .debug_str,"MS",@progbits,1 -+.LASF0: -+ .string "array" -+.LASF5: -+ .string "size" -+.LASF3: -+ .string "x86_64-vla-typedef.c" -+.LASF6: -+ .string "array_t" -+.LASF1: -+ .string "char" -+.LASF4: -+ .string "gdb.arch" -+.LASF2: -+ .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 -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c -new file mode 100644 -index 0000000..b809c4e ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.c -@@ -0,0 +1,43 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 . */ -+ -+#if 0 -+ -+void -+foo (int size) -+{ -+ typedef char array_t[size]; -+ array_t array; -+ int i; -+ -+ for (i = 0; i < size; i++) -+ array[i] = i; -+ -+ array[0] = 0; /* break-here */ -+} -+ -+#else -+ -+int -+main (void) -+{ -+ foo (26); -+ foo (78); -+ return 0; -+} -+ -+#endif -diff --git a/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp -new file mode 100644 -index 0000000..b05411e ---- /dev/null -+++ b/gdb/testsuite/gdb.arch/x86_64-vla-typedef.exp -@@ -0,0 +1,64 @@ -+# Copyright 2009 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 . -+ -+# Test DW_AT_data_location accessed through DW_TAG_typedef intermediate. -+ -+if ![istarget "x86_64-*-*"] then { -+ verbose "Skipping over gdb.arch/x86_64-vla-typedef.exp test made only for x86_64." -+ return -+} -+ -+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 -+if { [gdb_compile "${srcdir}/${subdir}/${srcasmfile}" "${binobjfile}" object {}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${binobjfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] { -+ untested x86_64-vla-typedef -+ return -1 -+} -+ -+gdb_breakpoint "break_here" -+ -+gdb_continue_to_breakpoint "break_here" -+ -+gdb_test "whatis array" "type = array_t" "first: whatis array" -+ -+gdb_test "ptype array" "type = char \\\[26\\\]" "first: ptype array" -+ -+gdb_test "p array\[1\]" "\\$\[0-9\] = 1 '\\\\001'" -+gdb_test "p array\[2\]" "\\$\[0-9\] = 2 '\\\\002'" -+gdb_test "p array\[3\]" "\\$\[0-9\] = 3 '\\\\003'" -+gdb_test "p array\[4\]" "\\$\[0-9\] = 4 '\\\\004'" -+ -+gdb_continue_to_breakpoint "break_here" -+ -+gdb_test "whatis array" "type = array_t" "second: whatis array" -+ -+gdb_test "ptype array" "type = char \\\[78\\\]" "second: ptype array" -diff --git a/gdb/testsuite/gdb.base/arrayidx.c b/gdb/testsuite/gdb.base/arrayidx.c -index 58be08c..04e36cd 100644 ---- a/gdb/testsuite/gdb.base/arrayidx.c -+++ b/gdb/testsuite/gdb.base/arrayidx.c -@@ -17,6 +17,13 @@ - - int array[] = {1, 2, 3, 4}; - -+#ifdef __GNUC__ -+struct -+ { -+ int a[0]; -+ } unbound; -+#endif -+ - int - main (void) - { -diff --git a/gdb/testsuite/gdb.base/arrayidx.exp b/gdb/testsuite/gdb.base/arrayidx.exp -index 35454e3..6144d36 100644 ---- a/gdb/testsuite/gdb.base/arrayidx.exp -+++ b/gdb/testsuite/gdb.base/arrayidx.exp -@@ -49,4 +49,12 @@ gdb_test "print array" \ - "\\{\\\[0\\\] = 1, \\\[1\\\] = 2, \\\[2\\\] = 3, \\\[3\\\] = 4\\}" \ - "Print array with array-indexes on" - -- -+set test "p unbound.a == &unbound.a\[0\]" -+gdb_test_multiple $test $test { -+ -re " = 1\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "No symbol \"unbound\" in current context.\r\n$gdb_prompt $" { -+ unsupported "$test (no GCC)" -+ } -+} -diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.c b/gdb/testsuite/gdb.base/internal-var-field-address.c -new file mode 100644 -index 0000000..eeb7b85 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/internal-var-field-address.c -@@ -0,0 +1,20 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 . */ -+ -+struct { -+ int field; -+} staticstruct = { 1 }; -diff --git a/gdb/testsuite/gdb.base/internal-var-field-address.exp b/gdb/testsuite/gdb.base/internal-var-field-address.exp -new file mode 100644 -index 0000000..33c9e94 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/internal-var-field-address.exp -@@ -0,0 +1,26 @@ -+# Copyright 2009 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 . -+ -+set test internal-var-field-address -+set binfile ${test}.x -+if { [gdb_compile "${srcdir}/${subdir}/${test}.c" "[standard_output_file ${binfile}]" object {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+clean_restart $binfile -+ -+gdb_test {set $varstruct = staticstruct} -+gdb_test {p $varstruct.field} " = 1" -diff --git a/gdb/testsuite/gdb.base/vla-frame.c b/gdb/testsuite/gdb.base/vla-frame.c -new file mode 100644 -index 0000000..5750f68 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-frame.c -@@ -0,0 +1,31 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2011 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 . */ -+ -+#include -+ -+int -+main (int argc, char **argv) -+{ -+ char s[2 + argc]; -+ void (*f) (char *) = 0; -+ -+ memset (s, 0, sizeof (s)); -+ s[0] = 'X'; -+ -+ f (s); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/vla-frame.exp b/gdb/testsuite/gdb.base/vla-frame.exp -new file mode 100644 -index 0000000..47736c7 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-frame.exp -@@ -0,0 +1,38 @@ -+# Copyright 2011 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 . -+ -+set testfile vla-frame -+set executable ${testfile} -+ -+if { [prepare_for_testing ${testfile}.exp ${executable}] } { -+ return -1 -+} -+ -+if ![runto_main] { -+ return -1 -+} -+ -+set test "continue" -+gdb_test_multiple $test $test { -+ -re "Continuing\\.\r\n\r\nProgram received signal SIGSEGV, Segmentation fault\\.\r\n0x0+ in \\?\\? \\(\\)\r\n$gdb_prompt $" { -+ pass $test -+ } -+ -re "\r\n$gdb_prompt $" { -+ untested ${testfile}.exp -+ return -+ } -+} -+ -+gdb_test "bt full" "\r\n +s = \"X\\\\000\"\r\n.*" -diff --git a/gdb/testsuite/gdb.base/vla-overflow.c b/gdb/testsuite/gdb.base/vla-overflow.c -new file mode 100644 -index 0000000..c5d5ee0 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-overflow.c -@@ -0,0 +1,30 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 . */ -+ -+#include -+ -+int -+main (int argc, char **argv) -+{ -+ int array[argc]; -+ -+ array[0] = array[0]; -+ -+ abort (); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/vla-overflow.exp b/gdb/testsuite/gdb.base/vla-overflow.exp -new file mode 100644 -index 0000000..24a608f ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla-overflow.exp -@@ -0,0 +1,109 @@ -+# Copyright 2008 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 . -+ -+# We could crash in: -+# #0 block_linkage_function (bl=0x0) at ../../gdb/block.c:69 -+# #1 in dwarf_block_get_frame_base (...) at ../../gdb/dwarf2block.c:97 -+# 97 framefunc = block_linkage_function (get_frame_block (frame, NULL)); -+# #2 in execute_stack_op (...) at ../../gdb/dwarf2expr.c:496 -+# #3 in dwarf_block_exec_core () at ../../gdb/dwarf2block.c:156 -+# #4 dwarf_block_exec (...) at ../../gdb/dwarf2block.c:206 -+# #5 in range_type_count_bound_internal (...) at ../../gdb/gdbtypes.c:1430 -+# #6 in create_array_type (...) at ../../gdb/gdbtypes.c:840 -+# ... -+# #21 in psymtab_to_symtab (...) at ../../gdb/symfile.c:292 -+# ... -+# #29 in backtrace_command_1 () at ../../gdb/stack.c:1273 -+ -+set testfile vla-overflow -+set shfile ${objdir}/${subdir}/${testfile}-gdb.sh -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+set f [open "|getconf PAGESIZE" "r"] -+gets $f pagesize -+close $f -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set pid_of_gdb [exp_pid -i [board_info host fileid]] -+ -+if { [runto_main] < 0 } { -+ untested vla-overflow -+ return -1 -+} -+ -+# Get the GDB memory size when we stay at main. -+ -+proc memory_v_pages_get {} { -+ global pid_of_gdb pagesize -+ set fd [open "/proc/$pid_of_gdb/statm"] -+ gets $fd line -+ close $fd -+ # number of pages of virtual memory -+ scan $line "%d" drs -+ return $drs -+} -+ -+set pages_found [memory_v_pages_get] -+ -+# s390x with glibc-debuginfo.s390x installed used approx. 16MB. -+set mb_reserve 40 -+verbose -log "pages_found = $pages_found, mb_reserve = $mb_reserve" -+set kb_found [expr $pages_found * $pagesize / 1024] -+set kb_permit [expr $kb_found + 1 * 1024 + $mb_reserve * 1024] -+verbose -log "kb_found = $kb_found, kb_permit = $kb_permit" -+ -+# Create the ulimit wrapper. -+set f [open $shfile "w"] -+puts $f "#! /bin/sh" -+puts $f "ulimit -v $kb_permit" -+puts $f "exec $GDB \"\$@\"" -+close $f -+remote_exec host "chmod +x $shfile" -+ -+gdb_exit -+set GDBold $GDB -+set GDB "$shfile" -+gdb_start -+set GDB $GDBold -+ -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+set pid_of_gdb [exp_pid -i [board_info host fileid]] -+ -+# Check the size again after the second run. -+# We must not stop in main as it would cache `array' and never crash later. -+ -+gdb_run_cmd -+ -+verbose -log "kb_found before abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -+ -+gdb_test "" "Program received signal SIGABRT, Aborted..*" "Enter abort()" -+ -+verbose -log "kb_found in abort() = [expr [memory_v_pages_get] * $pagesize / 1024]" -+ -+# `abort' can get expressed as `*__GI_abort'. -+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]" -diff --git a/gdb/testsuite/gdb.base/vla.c b/gdb/testsuite/gdb.base/vla.c -new file mode 100644 -index 0000000..e1f3ed1 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla.c -@@ -0,0 +1,55 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2008 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 . */ -+ -+#include -+ -+void -+marker (void) -+{ -+} -+ -+void -+bar (char *a, char *b, char *c, int size) -+{ -+ memset (a, '1', size); -+ memset (b, '2', size); -+ memset (c, '3', 48); -+} -+ -+void -+foo (int size) -+{ -+ char temp1[size]; -+ char temp3[48]; -+ -+ temp1[size - 1] = '\0'; -+ { -+ char temp2[size]; -+ -+ bar (temp1, temp2, temp3, size); -+ -+ marker (); /* break-here */ -+ } -+} -+ -+int -+main (void) -+{ -+ foo (26); -+ foo (78); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.base/vla.exp b/gdb/testsuite/gdb.base/vla.exp -new file mode 100644 -index 0000000..5da7378 ---- /dev/null -+++ b/gdb/testsuite/gdb.base/vla.exp -@@ -0,0 +1,62 @@ -+# Copyright 2008 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 . -+ -+set testfile vla -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile} -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug}] != "" } { -+ untested "Couldn't compile test program" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto_main] { -+ untested vla -+ return -1 -+} -+ -+gdb_breakpoint [gdb_get_line_number "break-here"] -+ -+gdb_continue_to_breakpoint "break-here" -+ -+gdb_test "whatis temp1" "type = char \\\[variable\\\]" "first: whatis temp1" -+gdb_test "whatis temp2" "type = char \\\[variable\\\]" "first: whatis temp2" -+gdb_test "whatis temp3" "type = char \\\[48\\\]" "first: whatis temp3" -+ -+gdb_test "ptype temp1" "type = char \\\[26\\\]" "first: ptype temp1" -+gdb_test "ptype temp2" "type = char \\\[26\\\]" "first: ptype temp2" -+gdb_test "ptype temp3" "type = char \\\[48\\\]" "first: ptype temp3" -+ -+gdb_test "p temp1" " = '1' " "first: print temp1" -+gdb_test "p temp2" " = '2' " "first: print temp2" -+gdb_test "p temp3" " = '3' " "first: print temp3" -+ -+gdb_continue_to_breakpoint "break-here" -+ -+gdb_test "whatis temp1" "type = char \\\[variable\\\]" "second: whatis temp1" -+gdb_test "whatis temp2" "type = char \\\[variable\\\]" "second: whatis temp2" -+gdb_test "whatis temp3" "type = char \\\[48\\\]" "second: whatis temp3" -+ -+gdb_test "ptype temp1" "type = char \\\[78\\\]" "second: ptype temp1" -+gdb_test "ptype temp2" "type = char \\\[78\\\]" "second: ptype temp2" -+gdb_test "ptype temp3" "type = char \\\[48\\\]" "second: ptype temp3" -+ -+gdb_test "p temp1" " = '1' " "second: print temp1" -+gdb_test "p temp2" " = '2' " "second: print temp2" -+gdb_test "p temp3" " = '3' " "second: print temp3" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S -new file mode 100644 -index 0000000..aac3baa ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.S -@@ -0,0 +1,246 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2010 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 . */ -+ -+/* Debug information */ -+ -+/* We will `break *main' at the very first instruction. */ -+#define main_length 1 -+ -+ .section .data -+vardata: -+ /* See DW_OP_lit3 + 1 (0-based). */ -+ .string "seennotseen" -+ -+ .section .debug_info -+.Lcu1_begin: -+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -+.Lcu1_start: -+ .2byte 2 /* DWARF version number */ -+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ -+ .byte 4 /* Pointer Size (in bytes) */ -+ -+ /* CU die */ -+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ -+ .4byte .Lproducer /* DW_AT_producer */ -+ /* Use C++ to exploit a bug in parsing DW_AT_name "". */ -+ .byte 4 /* DW_AT_language (C++) - */ -+ .4byte main /* DW_AT_low_pc */ -+ .byte main_length /* DW_AT_high_pc */ -+ -+.Larray_type: -+ .uleb128 2 /* Abbrev: DW_TAG_array_type */ -+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ -+ -+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */ -+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 0 /* DW_AT_lower_bound */ -+ .4byte .Llen_var-.Lcu1_begin /* DW_AT_upper_bound */ -+ .byte 0 /* End of children of die */ -+ -+ /* DW_AT_upper_bound is referencing an optimized-out variable. */ -+.Larrayb_type: -+ .uleb128 2 /* Abbrev: DW_TAG_array_type */ -+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ -+ -+ .uleb128 3 /* Abbrev: DW_TAG_subrange_type */ -+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 0 /* DW_AT_lower_bound */ -+ .4byte .Llenb_var-.Lcu1_begin /* DW_AT_upper_bound */ -+ .byte 0 /* End of children of die */ -+ -+ /* DW_AT_upper_bound is referencing register. */ -+.Larrayreg_type: -+ .uleb128 2 /* Abbrev: DW_TAG_array_type */ -+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ -+ -+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type with block */ -+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 0 /* DW_AT_lower_bound */ -+ .byte 2f - 1f /* DW_AT_upper_bound */ -+1: .byte 0x50 /* DW_OP_reg0 */ -+2: -+ .byte 0 /* End of children of die */ -+ -+.Luint_type: -+ .uleb128 4 /* Abbrev: DW_TAG_base_type */ -+ .4byte .Luint_str /* DW_AT_name */ -+ .byte 4 /* DW_AT_byte_size */ -+ .byte 7 /* DW_AT_encoding */ -+ -+.Lchar_type: -+ .uleb128 4 /* Abbrev: DW_TAG_base_type */ -+ .4byte .Lchar_str /* DW_AT_name */ -+ .byte 1 /* DW_AT_byte_size */ -+ .byte 6 /* DW_AT_encoding */ -+ -+.Llen_var: -+ .uleb128 5 /* Abbrev: DW_TAG_variable artificial */ -+ .byte 1 /* DW_AT_artificial */ -+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ -+ .4byte .Llen_loclist-.Lloclist /* DW_AT_location */ -+ -+ /* optimized-out variable for b_string. */ -+.Llenb_var: -+ .uleb128 7 /* Abbrev: DW_TAG_variable artificial no DW_AT_location */ -+ .byte 1 /* DW_AT_artificial */ -+ .4byte .Luint_type-.Lcu1_begin /* DW_AT_type */ -+ -+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ -+ .string "a_string" /* DW_AT_name */ -+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 2f - 1f /* DW_AT_location */ -+1: .byte 3 /* DW_OP_addr */ -+ .4byte vardata /* */ -+2: -+ -+ /* DW_AT_upper_bound is referencing an optimized-out variable. */ -+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ -+ .string "b_string" /* DW_AT_name */ -+ .4byte .Larrayb_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 2f - 1f /* DW_AT_location */ -+1: .byte 3 /* DW_OP_addr */ -+ .4byte vardata /* */ -+2: -+ -+ /* DW_AT_upper_bound is referencing register. */ -+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ -+ .string "reg_string" /* DW_AT_name */ -+ .4byte .Larrayreg_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 2f - 1f /* DW_AT_location */ -+1: .byte 3 /* DW_OP_addr */ -+ .4byte vardata /* */ -+2: -+ -+ .byte 0 /* End of children of CU */ -+.Lcu1_end: -+ -+ .section .debug_loc -+.Lloclist: -+.Llen_loclist: -+ .4byte 0 # Location list begin address -+ .4byte main_length # Location list end address -+ .value 2f-1f # Location expression size -+1: .byte 0x33 # DW_OP_lit3 -+ .byte 0x9f # DW_OP_stack_value -+2: -+ .quad 0x0 # Location list terminator begin (*.LLST2) -+ .quad 0x0 # Location list terminator end (*.LLST2) -+ -+ .section .debug_abbrev -+.Ldebug_abbrev0: -+ .uleb128 1 /* Abbrev code */ -+ .uleb128 0x11 /* DW_TAG_compile_unit */ -+ .byte 0x1 /* has_children */ -+ .uleb128 0x25 /* DW_AT_producer */ -+ .uleb128 0xe /* DW_FORM_strp */ -+ .uleb128 0x13 /* DW_AT_language */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x11 /* DW_AT_low_pc */ -+ .uleb128 0x1 /* DW_FORM_addr */ -+ .uleb128 0x12 /* DW_AT_high_pc */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 2 /* Abbrev code */ -+ .uleb128 0x1 /* TAG: DW_TAG_array_type */ -+ .byte 0x1 /* DW_children_yes */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 3 /* Abbrev code */ -+ .uleb128 0x21 /* DW_TAG_subrange_type */ -+ .byte 0x0 /* no children */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x22 /* DW_AT_lower_bound */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x2f /* DW_AT_upper_bound */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 4 /* Abbrev code */ -+ .uleb128 0x24 /* DW_TAG_base_type */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0xe /* DW_FORM_strp */ -+ .uleb128 0xb /* DW_AT_byte_size */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x3e /* DW_AT_encoding */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 5 /* Abbrev code */ -+ .uleb128 0x34 /* DW_TAG_variable */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x34 /* DW_AT_artificial */ -+ .uleb128 0x0c /* DW_FORM_flag */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x02 /* DW_AT_location */ -+ .uleb128 0x06 /* DW_FORM_data4 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 6 /* Abbrev code */ -+ .uleb128 0x34 /* DW_TAG_variable */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x2 /* DW_AT_location */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 7 /* Abbrev code */ -+ .uleb128 0x34 /* DW_TAG_variable */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x34 /* DW_AT_artificial */ -+ .uleb128 0x0c /* DW_FORM_flag */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 8 /* Abbrev code */ -+ .uleb128 0x21 /* DW_TAG_subrange_type with block */ -+ .byte 0x0 /* no children */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x22 /* DW_AT_lower_bound */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x2f /* DW_AT_upper_bound */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .byte 0x0 /* Terminator */ -+ -+/* String table */ -+ .section .debug_str -+.Lproducer: -+ .string "GNU C 3.3.3" -+.Lchar_str: -+ .string "char" -+.Luint_str: -+ .string "unsigned int" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp -new file mode 100644 -index 0000000..815ed93 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-bound-loclist.exp -@@ -0,0 +1,54 @@ -+# Copyright 2010 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 . -+ -+# Test printing variable with dynamic bounds which reference a different -+# (artificial in the GCC case) variable containing loclist as its location. -+# This testcase uses value (not address) of the referenced variable: -+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43762 -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+set testfile dw2-bound-loclist -+if { [prepare_for_testing ${testfile}.exp ${testfile} [list ${testfile}.S main.c] {}] } { -+ return -1 -+} -+ -+# Verify it behaves at least as an unbound array without inferior. -+ -+gdb_test "p a_string" { = 0x[0-9a-f]+ "seennotseen"} -+gdb_test "ptype a_string" {type = char \[\]} -+ -+# Not runto_main as dw2-bound-loclist.S handles only the first byte of main. -+if ![runto "*main"] { -+ return -1 -+} -+ -+gdb_test "p a_string" { = "seen"} -+gdb_test "ptype a_string" {type = char \[4\]} -+ -+gdb_test "p b_string" { = (0x[0-9a-f]+ )?"seennotseen"} -+gdb_test "ptype b_string" {type = char \[\]} -+ -+# The register contains unpredictable value - the array size. -+gdb_test "ptype reg_string" {type = char \[-?[0-9]+\]} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.c b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c -new file mode 100644 -index 0000000..1f02d90 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.c -@@ -0,0 +1,42 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2004 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. */ -+ -+ -+/* The function `func1' traced into must have debug info on offset > 0; -+ (DW_UNSND (attr)). This is the reason of `func0' existence. */ -+ -+void -+func0(int a, int b) -+{ -+} -+ -+/* `func1' being traced into must have some arguments to dump. */ -+ -+void -+func1(int a, int b) -+{ -+ func0 (a,b); -+} -+ -+int -+main(void) -+{ -+ func1 (1, 2); -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp -new file mode 100644 -index 0000000..1c6e84a ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp -@@ -0,0 +1,79 @@ -+# Copyright 2006 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. -+ -+# Minimal DWARF-2 unit test -+ -+# This test can only be run on targets which support DWARF-2. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+set testfile "dw2-stripped" -+set srcfile ${testfile}.c -+set binfile ${objdir}/${subdir}/${testfile}.x -+ -+remote_exec build "rm -f ${binfile}" -+ -+# get the value of gcc_compiled -+if [get_compiler_info ${binfile}] { -+ return -1 -+} -+ -+# This test can only be run on gcc as we use additional_flags=FIXME -+if {$gcc_compiled == 0} { -+ return 0 -+} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-ggdb3}] != "" } { -+ return -1 -+} -+ -+remote_exec build "objcopy -R .debug_loc ${binfile}" -+set strip_output [remote_exec build "objdump -h ${binfile}"] -+ -+set test "stripping test file preservation" -+if [ regexp ".debug_info " $strip_output] { -+ pass "$test (.debug_info preserved)" -+} else { -+ fail "$test (.debug_info got also stripped)" -+} -+ -+set test "stripping test file functionality" -+if [ regexp ".debug_loc " $strip_output] { -+ fail "$test (.debug_loc still present)" -+} else { -+ pass "$test (.debug_loc stripped)" -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+# For C programs, "start" should stop in main(). -+ -+gdb_test "start" \ -+ ".*main \\(\\) at .*" \ -+ "start" -+gdb_test "step" \ -+ "func.* \\(.*\\) at .*" \ -+ "step" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S -new file mode 100644 -index 0000000..5fcdd84 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.S -@@ -0,0 +1,83 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 . */ -+ -+/* Debug information */ -+ -+ .section .debug_info -+.Lcu1_begin: -+ /* CU header */ -+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -+.Lcu1_start: -+ .2byte 2 /* DWARF Version */ -+ .4byte .Labbrev1_begin /* Offset into abbrev section */ -+ .byte 4 /* Pointer size */ -+ -+ /* CU die */ -+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ -+ .ascii "dw2-struct-member-data-location.c\0" /* DW_AT_name */ -+ .ascii "GNU C 4.3.2\0" /* DW_AT_producer */ -+ .byte 1 /* DW_AT_language (C) */ -+ -+.Ltype_uchar: -+ .uleb128 2 /* Abbrev: DW_TAG_structure_type */ -+ .ascii "some_struct\0" /* DW_AT_name */ -+ -+ .uleb128 3 /* Abbrev: DW_TAG_member */ -+ .ascii "field\0" /* DW_AT_name */ -+ .byte 0 /* DW_AT_data_member_location */ -+ -+ .byte 0 /* End of children of some_struct */ -+ -+ .byte 0 /* End of children of CU */ -+ -+.Lcu1_end: -+ -+/* Abbrev table */ -+ .section .debug_abbrev -+.Labbrev1_begin: -+ .uleb128 1 /* Abbrev code */ -+ .uleb128 0x11 /* DW_TAG_compile_unit */ -+ .byte 1 /* has_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x25 /* DW_AT_producer */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x13 /* DW_AT_language */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 2 /* Abbrev code */ -+ .uleb128 0x13 /* DW_TAG_structure_type */ -+ .byte 1 /* has_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 3 /* Abbrev code */ -+ .uleb128 0x0d /* DW_TAG_member */ -+ .byte 0 /* has_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x38 /* DW_AT_data_member_location */ -+ .uleb128 0x0b /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp -new file mode 100644 -index 0000000..bc35209 ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-struct-member-data-location.exp -@@ -0,0 +1,37 @@ -+# Copyright 2009 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 . -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+# For now pick a sampling of likely targets. -+if {![istarget *-*-linux*] -+ && ![istarget *-*-gnu*] -+ && ![istarget *-*-elf*] -+ && ![istarget *-*-openbsd*] -+ && ![istarget arm-*-eabi*] -+ && ![istarget powerpc-*-eabi*]} { -+ return 0 -+} -+ -+set testfile "dw2-struct-member-data-location" -+set srcfile ${testfile}.S -+set binfile ${testfile}.x -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "[standard_output_file ${binfile}]" object {nodebug}] != "" } { -+ return -1 -+} -+ -+clean_restart $binfile -+ -+gdb_test "ptype struct some_struct" "type = struct some_struct {\[\r\n \t\]*void field;\[\r\n \t\]*}" -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S -new file mode 100644 -index 0000000..9dbbf3c ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.S -@@ -0,0 +1,121 @@ -+/* This testcase is part of GDB, the GNU debugger. -+ -+ Copyright 2012 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 . */ -+ -+/* Debug information */ -+ -+ .section .data -+vardata: -+ .rept 129 -+ .ascii "x" -+ .endr -+ .ascii "UNSEEN\0" -+ -+ .section .debug_info -+.Lcu1_begin: -+ .4byte .Lcu1_end - .Lcu1_start /* Length of Compilation Unit */ -+.Lcu1_start: -+ .2byte 2 /* DWARF version number */ -+ .4byte .Ldebug_abbrev0 /* Offset Into Abbrev. Section */ -+ .byte 4 /* Pointer Size (in bytes) */ -+ -+ /* CU die */ -+ .uleb128 1 /* Abbrev: DW_TAG_compile_unit */ -+ .ascii "GNU C 3.3.3\0" /* DW_AT_producer */ -+ .byte 2 /* DW_AT_language (C) - */ -+ -+.Larray_type: -+ .uleb128 2 /* Abbrev: DW_TAG_array_type */ -+ .4byte .Lchar_type-.Lcu1_begin /* DW_AT_type */ -+ -+ .uleb128 8 /* Abbrev: DW_TAG_subrange_type without DW_AT_type */ -+ .byte 0 /* DW_AT_lower_bound */ -+ .byte 128 /* DW_AT_upper_bound */ -+ -+ .byte 0 /* End of children of die */ -+ -+.Lchar_type: -+ .uleb128 4 /* Abbrev: DW_TAG_base_type */ -+ .ascii "char\0" /* DW_AT_name */ -+ .byte 1 /* DW_AT_byte_size */ -+ .byte 6 /* DW_AT_encoding */ -+ -+ .uleb128 6 /* Abbrev: DW_TAG_variable DW_FORM_string */ -+ .ascii "notype_string\0" /* DW_AT_name */ -+ .4byte .Larray_type-.Lcu1_begin /* DW_AT_type */ -+ .byte 2f - 1f /* DW_AT_location */ -+1: .byte 3 /* DW_OP_addr */ -+ .4byte vardata /* */ -+2: -+ -+ .byte 0 /* End of children of CU */ -+.Lcu1_end: -+ -+ .section .debug_abbrev -+.Ldebug_abbrev0: -+ .uleb128 1 /* Abbrev code */ -+ .uleb128 0x11 /* DW_TAG_compile_unit */ -+ .byte 0x1 /* has_children */ -+ .uleb128 0x25 /* DW_AT_producer */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x13 /* DW_AT_language */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 2 /* Abbrev code */ -+ .uleb128 0x1 /* TAG: DW_TAG_array_type */ -+ .byte 0x1 /* DW_children_yes */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 4 /* Abbrev code */ -+ .uleb128 0x24 /* DW_TAG_base_type */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0xb /* DW_AT_byte_size */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x3e /* DW_AT_encoding */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 6 /* Abbrev code */ -+ .uleb128 0x34 /* DW_TAG_variable */ -+ .byte 0x0 /* no_children */ -+ .uleb128 0x3 /* DW_AT_name */ -+ .uleb128 0x8 /* DW_FORM_string */ -+ .uleb128 0x49 /* DW_AT_type */ -+ .uleb128 0x13 /* DW_FORM_ref4 */ -+ .uleb128 0x2 /* DW_AT_location */ -+ .uleb128 0xa /* DW_FORM_block1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .uleb128 8 /* Abbrev code */ -+ .uleb128 0x21 /* DW_TAG_subrange_type without DW_AT_type */ -+ .byte 0x0 /* no children */ -+ .uleb128 0x22 /* DW_AT_lower_bound */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .uleb128 0x2f /* DW_AT_upper_bound */ -+ .uleb128 0xb /* DW_FORM_data1 */ -+ .byte 0x0 /* Terminator */ -+ .byte 0x0 /* Terminator */ -+ -+ .byte 0x0 /* Terminator */ -diff --git a/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp -new file mode 100644 -index 0000000..cec673c ---- /dev/null -+++ b/gdb/testsuite/gdb.dwarf2/dw2-subrange-no-type.exp -@@ -0,0 +1,39 @@ -+# Copyright 2012 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 . -+load_lib dwarf.exp -+ -+# https://bugzilla.redhat.com/show_bug.cgi?id=806920 -+# read_subrange_type reinitialization -+# of BASE_TYPE was done too late, it affects DW_TAG_subrange_type without -+# specified DW_AT_type, present only in XLF produced code. -+ -+# This test can only be run on targets which support DWARF-2 and use gas. -+if {![dwarf2_support]} { -+ return 0 -+} -+ -+set testfile dw2-subrange-no-type -+set srcfile ${testfile}.S -+set executable ${testfile}.x -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" object {}] != "" } { -+ return -1 -+} -+ -+clean_restart $executable -+ -+gdb_test "ptype notype_string" {type = char \[129\]} -+gdb_test "p notype_string" " = 'x' " -diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.exp b/gdb/testsuite/gdb.fortran/dwarf-stride.exp -new file mode 100644 -index 0000000..d7b8bea ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dwarf-stride.exp -@@ -0,0 +1,42 @@ -+# Copyright 2009 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. -+ -+# This file was written by Jan Kratochvil . -+ -+# This file is part of the gdb testsuite. Array element stride must not be -+# specified in the number of elements but in a number of bytes instead. -+# Original problem: -+# (gdb) p c40pt(1) -+# $1 = '0-hello', ' ' -+# (gdb) p c40pt(2) -+# warning: Fortran array stride not divisible by the element size -+ -+set testfile dwarf-stride -+set srcfile ${testfile}.f90 -+ -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "break-here"] -+gdb_continue_to_breakpoint "break-here" ".*break-here.*" -+gdb_test "p c40pt(1)" " = '0-hello.*" -+gdb_test "p c40pt(2)" " = '1-hello.*" -diff --git a/gdb/testsuite/gdb.fortran/dwarf-stride.f90 b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 -new file mode 100644 -index 0000000..e492b3a ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dwarf-stride.f90 -@@ -0,0 +1,40 @@ -+! Copyright 2009 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. -+! -+! File written by Alan Matsuoka. -+ -+program repro -+ -+ type small_stride -+ character*40 long_string -+ integer small_pad -+ end type small_stride -+ -+ type(small_stride), dimension (20), target :: unpleasant -+ character*40, pointer, dimension(:):: c40pt -+ -+ integer i -+ -+ do i = 0,19 -+ unpleasant(i+1)%small_pad = i+1 -+ unpleasant(i+1)%long_string = char (ichar('0') + i) // '-hello' -+ end do -+ -+ c40pt => unpleasant%long_string -+ -+ print *, c40pt ! break-here -+ -+end program repro -diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 -new file mode 100644 -index 0000000..261ce17 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 -@@ -0,0 +1,24 @@ -+! Copyright 2010 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+subroutine bar -+ real :: dummy -+ dummy = 1 -+end subroutine bar -diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp -new file mode 100644 -index 0000000..e5a82ee ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp -@@ -0,0 +1,37 @@ -+# Copyright 2010 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. -+ -+set testfile "dynamic-other-frame" -+set srcfile1 ${testfile}.f90 -+set srcfile2 ${testfile}-stub.f90 -+set objfile2 [standard_output_file ${testfile}-stub.o] -+set executable ${testfile} -+set binfile [standard_output_file ${executable}] -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != "" -+ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } { -+ untested "Couldn't compile ${srcfile1} or ${srcfile2}" -+ return -1 -+} -+ -+clean_restart ${executable} -+ -+if ![runto bar_] then { -+ perror "couldn't run to bar_" -+ continue -+} -+ -+gdb_test "bt" {foo \(string='hello'.*} -diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 -new file mode 100644 -index 0000000..2bc637d ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 -@@ -0,0 +1,36 @@ -+! Copyright 2010 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+subroutine foo (string) -+ interface -+ subroutine bar -+ end subroutine -+ end interface -+ character string*(*) -+ call bar ! stop-here -+end subroutine foo -+program test -+ interface -+ subroutine foo (string) -+ character string*(*) -+ end subroutine -+ end interface -+ call foo ('hello') -+end -diff --git a/gdb/testsuite/gdb.fortran/dynamic.exp b/gdb/testsuite/gdb.fortran/dynamic.exp -new file mode 100644 -index 0000000..e79e94a ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dynamic.exp -@@ -0,0 +1,152 @@ -+# Copyright 2007 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. -+ -+# This file was written by Jan Kratochvil . -+ -+# This file is part of the gdb testsuite. It contains tests for dynamically -+# allocated Fortran arrays. -+# It depends on the GCC dynamic Fortran arrays DWARF support: -+# http://gcc.gnu.org/bugzilla/show_bug.cgi?id=22244 -+ -+set testfile "dynamic" -+set srcfile ${testfile}.f90 -+set binfile ${objdir}/${subdir}/${testfile} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { -+ untested "Couldn't compile ${srcfile}" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "varx-init"] -+gdb_continue_to_breakpoint "varx-init" -+gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx unallocated" -+gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx unallocated" -+gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) unallocated" -+gdb_test "p varx(1,5,17)=1" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17)=1 unallocated" -+gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) unallocated" -+ -+gdb_breakpoint [gdb_get_line_number "varx-allocated"] -+gdb_continue_to_breakpoint "varx-allocated" -+# $1 = (( ( 0, 0, 0, 0, 0, 0) ( 0, 0, 0, 0, 0, 0) --- , 0) ) ( ( 0, 0, ...) ...) ...) -+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx allocated" -+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. -+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varx allocated" -+ -+gdb_breakpoint [gdb_get_line_number "varx-filled"] -+gdb_continue_to_breakpoint "varx-filled" -+gdb_test "p varx(2, 5, 17)" "\\$\[0-9\]* = 6" -+gdb_test "p varx(1, 5, 17)" "\\$\[0-9\]* = 7" -+gdb_test "p varx(2, 6, 18)" "\\$\[0-9\]* = 8" -+gdb_test "p varx(6, 15, 28)" "\\$\[0-9\]* = 9" -+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type. -+gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv unassociated" -+gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "ptype varv unassociated" -+ -+set test "output varx" -+gdb_test_multiple $test $test { -+ -re "^output varx\r\n\[() ,6789.\]*$gdb_prompt $" { -+ pass $test -+ } -+} -+ -+gdb_breakpoint [gdb_get_line_number "varv-associated"] -+gdb_continue_to_breakpoint "varv-associated" -+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 6" "p varx(3, 7, 19) with varv associated" -+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 6" "p varv(3, 7, 19) associated" -+# Intel Fortran Compiler 10.1.008 uses -1 there, GCC uses 1. -+gdb_test "p l" "\\$\[0-9\]* = (\\.TRUE\\.|4294967295)" "p l if varv associated" -+gdb_test "ptype varx" "type = real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)" "ptype varx with varv associated" -+# Intel Fortran Compiler 10.1.008 uses the pointer type. -+gdb_test "ptype varv" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(6,5:15,17:28\\)\\)?" "ptype varv associated" -+ -+gdb_breakpoint [gdb_get_line_number "varv-filled"] -+gdb_continue_to_breakpoint "varv-filled" -+gdb_test "p varx(3, 7, 19)" "\\$\[0-9\]* = 10" "p varx(3, 7, 19) with varv filled" -+gdb_test "p varv(3, 7, 19)" "\\$\[0-9\]* = 10" "p varv(3, 7, 19) filled" -+ -+gdb_breakpoint [gdb_get_line_number "varv-deassociated"] -+gdb_continue_to_breakpoint "varv-deassociated" -+# The latter one is for the Intel Fortran Compiler 10.1.008 pointer type. -+gdb_test "p varv" "\\$\[0-9\]* = (<(object|the array) is not associated>|.*(Cannot access it|Unable to access the object) because the object is not associated.)" "p varv deassociated" -+gdb_test "ptype varv" "type = (<(object|the array) is not associated>|.*(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)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\." -+gdb_test "ptype varv(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not associated\\." -+ -+gdb_breakpoint [gdb_get_line_number "varx-deallocated"] -+gdb_continue_to_breakpoint "varx-deallocated" -+gdb_test "p varx" "\\$\[0-9\]* = <(object|the array) is not allocated>" "p varx deallocated" -+gdb_test "ptype varx" "type = <(object|the array) is not allocated>" "ptype varx deallocated" -+gdb_test "p l" "\\$\[0-9\]* = \\.FALSE\\." "p l if varx deallocated" -+gdb_test "p varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "p varx(1,5,17) deallocated" -+gdb_test "ptype varx(1,5,17)" "(Cannot access it|Unable to access the object) because the (object|array) is not allocated\\." "ptype varx(1,5,17) deallocated" -+ -+gdb_breakpoint [gdb_get_line_number "vary-passed"] -+gdb_continue_to_breakpoint "vary-passed" -+# $1 = (( ( 1, 1, 1, 1, 1, 1) ( 1, 1, 1, 1, 1, 1) --- , 1) ) ( ( 1, 1, ...) ...) ...) -+gdb_test "p vary" "\\$\[0-9\]* = \\(\[()1, .\]*\\)" -+ -+gdb_breakpoint [gdb_get_line_number "vary-filled"] -+gdb_continue_to_breakpoint "vary-filled" -+gdb_test "ptype vary" "type = real(\\(kind=4\\)|\\*4) \\(10,10\\)" -+gdb_test "p vary(1, 1)" "\\$\[0-9\]* = 8" -+gdb_test "p vary(2, 2)" "\\$\[0-9\]* = 9" -+gdb_test "p vary(1, 3)" "\\$\[0-9\]* = 10" -+# $1 = (( ( 3, 3, 3, 3, 3, 3) ( 3, 3, 3, 3, 3, 3) --- , 3) ) ( ( 3, 3, ...) ...) ...) -+gdb_test "p varw" "\\$\[0-9\]* = \\(\[()3, .\]*\\)" -+ -+gdb_breakpoint [gdb_get_line_number "varw-almostfilled"] -+gdb_continue_to_breakpoint "varw-almostfilled" -+gdb_test "ptype varw" "type = real(\\(kind=4\\)|\\*4) \\(5,4,3\\)" -+gdb_test "p varw(3,1,1)=1" "\\$\[0-9\]* = 1" -+# $1 = (( ( 6, 5, 1, 5, 5, 5) ( 5, 5, 5, 5, 5, 5) --- , 5) ) ( ( 5, 5, ...) ...) ...) -+gdb_test "p varw" "\\$\[0-9\]* = \\( *\\( *\\( *6, *5, *1,\[()5, .\]*\\)" "p varw filled" -+# "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_test "finish" ".*(call bar \\(y, x\\)|call foo \\(x, z\\(2:6, 4:7, 6:8\\)\\))" -+gdb_test "p z(2,4,5)" "\\$\[0-9\]* = 3" -+gdb_test "p z(2,4,6)" "\\$\[0-9\]* = 6" -+gdb_test "p z(2,4,7)" "\\$\[0-9\]* = 5" -+gdb_test "p z(4,4,6)" "\\$\[0-9\]* = 1" -+ -+gdb_breakpoint [gdb_get_line_number "varz-almostfilled"] -+gdb_continue_to_breakpoint "varz-almostfilled" -+# GCC uses the pointer type here, Intel Fortran Compiler 10.1.008 does not. -+gdb_test "ptype varz" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(\\*\\)\\)?" -+# Intel Fortran Compiler 10.1.008 has a bug here - (2:11,7:7) -+# as it produces DW_AT_lower_bound == DW_AT_upper_bound == 7. -+gdb_test "ptype vart" "type = (PTR TO -> \\( )?real(\\(kind=4\\)|\\*4) \\(2:11,7:\\*\\)\\)?" -+gdb_test "p varz" "\\$\[0-9\]* = \\(\\)" -+gdb_test "p vart" "\\$\[0-9\]* = \\(\\)" -+gdb_test "p varz(3)" "\\$\[0-9\]* = 4" -+# maps to foo::vary(1,1) -+gdb_test "p vart(2,7)" "\\$\[0-9\]* = 8" -+# maps to foo::vary(2,2) -+gdb_test "p vart(3,8)" "\\$\[0-9\]* = 9" -+# maps to foo::vary(1,3) -+gdb_test "p vart(2,9)" "\\$\[0-9\]* = 10" -diff --git a/gdb/testsuite/gdb.fortran/dynamic.f90 b/gdb/testsuite/gdb.fortran/dynamic.f90 -new file mode 100644 -index 0000000..0f43564 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/dynamic.f90 -@@ -0,0 +1,98 @@ -+! Copyright 2007 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+subroutine baz -+ real, target, allocatable :: varx (:, :, :) -+ real, pointer :: varv (:, :, :) -+ real, target :: varu (1, 2, 3) -+ logical :: l -+ allocate (varx (1:6, 5:15, 17:28)) ! varx-init -+ l = allocated (varx) -+ varx(:, :, :) = 6 ! varx-allocated -+ varx(1, 5, 17) = 7 -+ varx(2, 6, 18) = 8 -+ varx(6, 15, 28) = 9 -+ varv => varx ! varx-filled -+ l = associated (varv) -+ varv(3, 7, 19) = 10 ! varv-associated -+ varv => null () ! varv-filled -+ l = associated (varv) -+ deallocate (varx) ! varv-deassociated -+ l = allocated (varx) -+ varu(:, :, :) = 10 ! varx-deallocated -+ allocate (varv (1:6, 5:15, 17:28)) -+ l = associated (varv) -+ varv(:, :, :) = 6 -+ varv(1, 5, 17) = 7 -+ varv(2, 6, 18) = 8 -+ varv(6, 15, 28) = 9 -+ deallocate (varv) -+ l = associated (varv) -+ varv => varu -+ varv(1, 1, 1) = 6 -+ varv(1, 2, 3) = 7 -+ l = associated (varv) -+end subroutine baz -+subroutine foo (vary, varw) -+ real :: vary (:, :) -+ real :: varw (:, :, :) -+ vary(:, :) = 4 ! vary-passed -+ vary(1, 1) = 8 -+ vary(2, 2) = 9 -+ vary(1, 3) = 10 -+ varw(:, :, :) = 5 ! vary-filled -+ varw(1, 1, 1) = 6 -+ varw(2, 2, 2) = 7 ! varw-almostfilled -+end subroutine foo -+subroutine bar (varz, vart) -+ real :: varz (*) -+ real :: vart (2:11, 7:*) -+ varz(1:3) = 4 -+ varz(2) = 5 ! varz-almostfilled -+ vart(2,7) = vart(2,7) -+end subroutine bar -+program test -+ interface -+ subroutine foo (vary, varw) -+ real :: vary (:, :) -+ real :: varw (:, :, :) -+ end subroutine -+ end interface -+ interface -+ subroutine bar (varz, vart) -+ real :: varz (*) -+ real :: vart (2:11, 7:*) -+ end subroutine -+ end interface -+ real :: x (10, 10), y (5), z(8, 8, 8) -+ x(:,:) = 1 -+ y(:) = 2 -+ z(:,:,:) = 3 -+ call baz -+ call foo (x, z(2:6, 4:7, 6:8)) -+ call bar (y, x) -+ if (x (1, 1) .ne. 8 .or. x (2, 2) .ne. 9 .or. x (1, 2) .ne. 4) call abort -+ if (x (1, 3) .ne. 10) call abort -+ if (z (2, 4, 6) .ne. 6 .or. z (3, 5, 7) .ne. 7 .or. z (2, 4, 7) .ne. 5) call abort -+ if (any (y .ne. (/4, 5, 4, 2, 2/))) call abort -+ call foo (transpose (x), z) -+ 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 -diff --git a/gdb/testsuite/gdb.fortran/string.exp b/gdb/testsuite/gdb.fortran/string.exp -new file mode 100644 -index 0000000..39de2c4 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/string.exp -@@ -0,0 +1,59 @@ -+# Copyright 2008 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. -+ -+# This file was written by Jan Kratochvil . -+ -+# This file is part of the gdb testsuite. It contains tests for Fortran -+# strings with dynamic length. -+ -+set testfile "string" -+set srcfile ${testfile}.f90 -+set binfile ${objdir}/${subdir}/${testfile} -+ -+if { [gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug f90 quiet}] != "" } { -+ untested "Couldn't compile ${srcfile}" -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+ -+if ![runto MAIN__] then { -+ perror "couldn't run to breakpoint MAIN__" -+ continue -+} -+ -+gdb_breakpoint [gdb_get_line_number "var-init"] -+gdb_continue_to_breakpoint "var-init" -+gdb_test "ptype c" "type = character(\\(kind=1\\)|\\*1)" -+gdb_test "ptype d" "type = character(\\(kind=8\\)|\\*8)" -+gdb_test "ptype e" "type = character(\\(kind=4\\)|\\*4)" -+gdb_test "ptype f" "type = character(\\(kind=4\\)|\\*4) \\(7,8:10\\)" -+gdb_test "ptype *e" "Attempt to take contents of a non-pointer value." -+gdb_test "ptype *f" "type = character(\\(kind=4\\)|\\*4) \\(7\\)" -+gdb_test "p c" "\\$\[0-9\]* = 'c'" -+gdb_test "p d" "\\$\[0-9\]* = 'd '" -+gdb_test "p e" "\\$\[0-9\]* = 'g '" -+gdb_test "p f" "\\$\[0-9\]* = \\(\\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\( 'h ', 'h ', 'h ', 'h ', 'h ', 'h ', 'h '\\) \\)" -+gdb_test "p *e" "Attempt to take contents of a non-pointer value." -+gdb_test "p *f" "Attempt to take contents of a non-pointer value." -+ -+gdb_breakpoint [gdb_get_line_number "var-finish"] -+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" -diff --git a/gdb/testsuite/gdb.fortran/string.f90 b/gdb/testsuite/gdb.fortran/string.f90 -new file mode 100644 -index 0000000..226dc5d ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/string.f90 -@@ -0,0 +1,37 @@ -+! Copyright 2008 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. -+! -+! Ihis file is the Fortran source file for dynamic.exp. -+! Original file written by Jakub Jelinek . -+! Modified for the GDB testcase by Jan Kratochvil . -+ -+subroutine foo (e, f) -+ character (len=1) :: c -+ character (len=8) :: d -+ character (len=*) :: e -+ character (len=*) :: f (1:7, 8:10) -+ c = 'c' -+ d = 'd' -+ e = 'e' ! var-init -+ f = 'f' -+ f(1,9) = 'f2' -+ c = 'c' ! var-finish -+end subroutine foo -+ character (len=4) :: g, h (1:7, 8:10) -+ g = 'g' -+ h = 'h' -+ call foo (g, h) -+end -diff --git a/gdb/testsuite/gdb.fortran/subrange.exp b/gdb/testsuite/gdb.fortran/subrange.exp -new file mode 100644 -index 0000000..c819e23 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/subrange.exp -@@ -0,0 +1,60 @@ -+# Copyright 2011 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 . -+ -+if { [skip_fortran_tests] } { return -1 } -+ -+set testfile "subrange" -+set srcfile ${testfile}.f90 -+if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { -+ return -1 -+} -+ -+if ![runto MAIN__] { -+ perror "Couldn't run to MAIN__" -+ continue -+} -+ -+# Depending on the compiler version being used, the name of the 4-byte integer -+# and real types can be printed differently. For instance, gfortran-4.1 uses -+# "int4" whereas gfortran-4.3 uses "int(kind=4)". -+set int4 "(int4|integer\\(kind=4\\))" -+ -+gdb_breakpoint [gdb_get_line_number "break-static"] -+gdb_continue_to_breakpoint "break-static" ".*break-static.*" -+ -+foreach var {a alloc ptr} { -+ global pf_prefix -+ set old_prefix $pf_prefix -+ lappend pf_prefix "$var:" -+ -+ gdb_test "p $var (2, 2:3)" { = \(22, 32\)} -+ gdb_test "p $var (2:3, 3)" { = \(32, 33\)} -+ gdb_test "p $var (1, 2:)" { = \(21, 31\)} -+ gdb_test "p $var (2, :2)" { = \(12, 22\)} -+ gdb_test "p $var (3, 2:2)" { = \(23\)} -+ gdb_test "ptype $var (3, 2:2)" " = $int4 \\(2:2\\)" -+ gdb_test "p $var (4, :)" { = \(14, 24, 34\)} -+ gdb_test "p $var (:, :)" { = \(\( *11, 12, 13, 14\) \( *21, 22, 23, 24\) \( *31, 32, 33, 34\) *\)} -+ gdb_test "ptype $var (:, :)" " = $int4 \\(4,3\\)" -+ gdb_test "p $var (:)" "Wrong number of subscripts" -+ gdb_test "p $var (:, :, :)" "Wrong number of subscripts" -+ -+ set pf_prefix $old_prefix -+} -+ -+gdb_test_no_output {set $a=a} -+delete_breakpoints -+gdb_unload -+gdb_test {p $a (3, 2:2)} { = \(23\)} -diff --git a/gdb/testsuite/gdb.fortran/subrange.f90 b/gdb/testsuite/gdb.fortran/subrange.f90 -new file mode 100644 -index 0000000..4747ea9 ---- /dev/null -+++ b/gdb/testsuite/gdb.fortran/subrange.f90 -@@ -0,0 +1,28 @@ -+! Copyright 2011 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 test -+ integer, target :: a (4, 3) -+ integer, allocatable :: alloc (:, :) -+ integer, pointer :: ptr (:, :) -+ do 1 i = 1, 4 -+ do 1 j = 1, 3 -+ a (i, j) = j * 10 + i -+1 continue -+ allocate (alloc (4, 3)) -+ alloc = a -+ ptr => a -+ write (*,*) a ! break-static -+end -diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp -index 1d02779..f9f5be4 100644 ---- a/gdb/testsuite/gdb.gdb/selftest.exp -+++ b/gdb/testsuite/gdb.gdb/selftest.exp + #endif /* GDB_PYTHON_H */ +Index: gdb-7.8/gdb/testsuite/gdb.gdb/selftest.exp +=================================================================== +--- gdb-7.8.orig/gdb/testsuite/gdb.gdb/selftest.exp 2014-07-29 19:29:02.679979674 +0200 ++++ gdb-7.8/gdb/testsuite/gdb.gdb/selftest.exp 2014-07-29 19:29:04.874982798 +0200 @@ -92,6 +92,10 @@ proc do_steps_and_nexts {} { set description "step over cmdarg_vec initialization" set command "step" @@ -7133,414 +607,20 @@ index 1d02779..f9f5be4 100644 -re ".*pre_stat_chain = make_command_stats_cleanup.*$gdb_prompt $" { set description "next over make_command_stats_cleanup and everything it calls" set command "next" -diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.c b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c -new file mode 100644 -index 0000000..ebced3c ---- /dev/null -+++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.c -@@ -0,0 +1,26 @@ -+/* Copyright 2011 Free Software Foundation, Inc. -+ -+ This file is part of GDB. -+ -+ 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 . */ -+ -+int -+main (int argc, char **argv) -+{ -+ char vla[argc]; -+ -+ vla[0] = 0; /* break-here */ -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp -new file mode 100644 -index 0000000..88326c0 ---- /dev/null -+++ b/gdb/testsuite/gdb.mi/mi2-var-stale-type.exp -@@ -0,0 +1,57 @@ -+# Copyright 2011 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 . -+ -+load_lib mi-support.exp -+set MIFLAGS "-i=mi2" -+ -+gdb_exit -+if [mi_gdb_start] { -+ continue -+} -+ -+set testfile "mi2-var-stale-type" -+set srcfile ${testfile}.c -+set binfile [standard_output_file ${testfile}] -+if {[build_executable ${testfile}.exp $testfile $srcfile] == -1} { -+ return -1 -+} -+ -+mi_delete_breakpoints -+mi_gdb_reinitialize_dir $srcdir/$subdir -+mi_gdb_load ${binfile} -+ -+mi_gdb_test {-interpreter-exec console "maintenance set internal-error quit yes"} \ -+ {\^done} \ -+ "maintenance set internal-error quit yes" -+ -+mi_gdb_test {-interpreter-exec console "maintenance set internal-error corefile yes"} \ -+ {\^done} \ -+ "maintenance set internal-error corefile yes" -+ -+set line [gdb_get_line_number "break-here"] -+set func "main" -+ -+mi_gdb_test "-break-insert -t $srcfile:$line" \ -+ "\\^done,bkpt=\{number=\"\[0-9\]+\",type=\"breakpoint\",disp=\"del\",enabled=\"y\",addr=\"$hex\",func=\"$func\(\\\(.*\\\)\)?\",file=\".*\",fullname=\".*\",line=\"$line\",\[^\r\n\]*,original-location=\".*\"\}" \ -+ "breakpoint at $func" -+ -+if { [mi_run_cmd] < 0 } { -+ return -1 -+} -+mi_expect_stop "breakpoint-hit" $func ".*" ".*" "\[0-9\]+" { "" "disp=\"del\"" } "stop after initializing vla" -+ -+mi_create_varobj "vla" "vla" "create local variable vla" -+ -+mi_gdb_test "-var-update *" "\\^done,changelist=.*" "-var-update *" -diff --git a/gdb/testsuite/gdb.opt/array-from-register-func.c b/gdb/testsuite/gdb.opt/array-from-register-func.c -new file mode 100644 -index 0000000..729f457 ---- /dev/null -+++ b/gdb/testsuite/gdb.opt/array-from-register-func.c -@@ -0,0 +1,22 @@ -+/* This file is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 . */ -+ -+int -+func (int *arr) -+{ -+ return arr[0]; -+} -diff --git a/gdb/testsuite/gdb.opt/array-from-register.c b/gdb/testsuite/gdb.opt/array-from-register.c -new file mode 100644 -index 0000000..3090e7e ---- /dev/null -+++ b/gdb/testsuite/gdb.opt/array-from-register.c -@@ -0,0 +1,28 @@ -+/* This file is part of GDB, the GNU debugger. -+ -+ Copyright 2009 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 . */ -+ -+extern int func (int *arr); -+ -+int -+main (void) -+{ -+ int arr[] = { 42 }; -+ -+ func (arr); -+ -+ return 0; -+} -diff --git a/gdb/testsuite/gdb.opt/array-from-register.exp b/gdb/testsuite/gdb.opt/array-from-register.exp -new file mode 100644 -index 0000000..f2de718 ---- /dev/null -+++ b/gdb/testsuite/gdb.opt/array-from-register.exp -@@ -0,0 +1,33 @@ -+# Copyright 2009 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. -+# -+# This file is part of the gdb testsuite. -+ -+if { [prepare_for_testing array-from-register.exp "array-from-register" \ -+ {array-from-register.c array-from-register-func.c} \ -+ {debug optimize=-O2}] } { -+ return -1 -+} -+ -+if ![runto func] then { -+ return -1 -+} -+ -+gdb_test "p arr" "\\$\[0-9\]+ = \\(int \\*\\) *0x\[0-9a-f\]+" -+ -+# Seen regression: -+# Address requested for identifier "arr" which is in register $rdi -+gdb_test "p arr\[0\]" "\\$\[0-9\]+ = 42" -diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arrays.exp -new file mode 100644 -index 0000000..ccc6e1e ---- /dev/null -+++ b/gdb/testsuite/gdb.pascal/arrays.exp -@@ -0,0 +1,104 @@ -+# Copyright 2008, 2009 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 . -+ -+if $tracelevel then { -+ strace $tracelevel -+} -+ -+load_lib "pascal.exp" -+ -+set testfile "arrays" -+set srcfile ${testfile}.pas -+set binfile ${objdir}/${subdir}/${testfile}$EXEEXT -+ -+# These tests only work with fpc, using the -gw3 compile-option -+pascal_init -+if { $pascal_compiler_is_fpc != 1 } { -+ return -1 -+} -+ -+# Detect if the fpc version is below 2.3.0 -+set fpc_generates_dwarf_for_dynamic_arrays 1 -+if { ($fpcversion_major < 2) || ( ($fpcversion_major == 2) && ($fpcversion_minor < 3))} { -+ set fpc_generates_dwarf_for_dynamic_arrays 0 -+} -+ -+ -+if {[gdb_compile_pascal "-gw3 ${srcdir}/${subdir}/${srcfile}" "${binfile}" executable [list debug ]] != "" } { -+ return -1 -+} -+ -+gdb_exit -+gdb_start -+gdb_reinitialize_dir $srcdir/$subdir -+gdb_load ${binfile} -+set bp_location1 [gdb_get_line_number "set breakpoint 1 here"] -+set bp_location2 [gdb_get_line_number "set breakpoint 2 here"] -+ -+ -+if { [gdb_breakpoint ${srcfile}:${bp_location1}] } { -+ pass "setting breakpoint 1" -+} -+if { [gdb_breakpoint ${srcfile}:${bp_location2}] } { -+ pass "setting breakpoint 2" -+} -+ -+# Verify that "start" lands inside the right procedure. -+if { [gdb_start_cmd] < 0 } { -+ untested start -+ return -1 -+} -+ -+gdb_test "" ".* at .*${srcfile}.*" "start" -+ -+gdb_test "cont" "Breakpoint .*:${bp_location1}.*" "Going to first breakpoint" -+ -+gdb_test "print StatArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer type" -+gdb_test "print StatArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61\\}" "Print static array of integer" -+ -+gdb_test "cont" "Breakpoint .*:${bp_location2}.*" "Going to second breakpoint" -+ -+gdb_test "print StatArrChar" ".* = 'abcdefghijkl'" "Print static array of char" -+gdb_test "print Stat2dArrInt" ".* = \\{\\{0, 1, 2, 3, 4\\}, \\{1, 2, 3, 4, 5\\}, \\{2, 3, 4, 5, 6\\}, \\{3, 4, 5, 6, 7\\}, \\{4, 5, 6, 7, 8\\}, \\{5, 6, 7, 8, 9\\}, \\{6, 7, 8, 9, 10\\}, \\{7, 8, 9, 10, 11\\}, \\{8, 9, 10, 11, 12\\}, \\{9, 10, 11, 12, 13\\}, \\{10, 11, 12, 13, 14\\}, \\{11, 12, 13, 14, 15\\}\\}" "Print static 2-dimensional array of integer" -+ -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print DynArrInt" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer type" -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print DynArrInt_" ".* = \\{50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62\\}" "Print dynamic array of integer" -+ -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print s" ".* = 'test'#0'string'" "Print string containing null-char" -+ -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print DynArrStr" ".* = \\{'dstr0', 'dstr1', 'dstr2', 'dstr3', 'dstr4', 'dstr5', 'dstr6', 'dstr7', 'dstr8', 'dstr9', 'dstr10', 'dstr11', 'dstr12'\\}" "Print dynamic array of string" -+ -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string" -+ -+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} { -+ setup_xfail "*-*-*" -+} -+gdb_test "print DynArrChar" ".* = 'abcdefghijklm'" "Print dynamic array of char" -+ -diff --git a/gdb/testsuite/gdb.pascal/arrays.pas b/gdb/testsuite/gdb.pascal/arrays.pas -new file mode 100644 -index 0000000..295602d ---- /dev/null -+++ b/gdb/testsuite/gdb.pascal/arrays.pas -@@ -0,0 +1,82 @@ -+{ -+ Copyright 2008, 2009 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 arrays; -+ -+{$mode objfpc}{$h+} -+ -+uses sysutils; -+ -+type TStatArrInt= array[0..11] of integer; -+ TDynArrInt= array of integer; -+ TStatArrStr= array[0..12] of string; -+ TDynArrStr= array of string; -+ TDynArrChar = array of char; -+ TStatArrChar = array [0..11] of char; -+ -+ TStat2dArrInt = array[0..11,0..4] of integer; -+ -+var StatArrInt: TStatArrInt; -+ StatArrInt_: Array[0..11] of integer; -+ DynArrInt: TDynArrInt; -+ DynArrInt_: Array of integer; -+ StatArrStr: TStatArrStr; -+ DynArrStr: TDynArrStr; -+ StatArrChar: TStatArrChar; -+ DynArrChar: TDynArrChar; -+ -+ Stat2dArrInt: TStat2dArrInt; -+ -+ s: string; -+ -+ i,j : integer; -+ -+begin -+ for i := 0 to 11 do -+ begin -+ StatArrInt[i]:= i+50; -+ StatArrInt_[i]:= i+50; -+ StatArrChar[i]:= chr(ord('a')+i); -+ for j := 0 to 4 do -+ Stat2dArrInt[i,j]:=i+j; -+ end; -+ writeln(StatArrInt_[0]); -+ writeln(StatArrInt[0]); { set breakpoint 1 here } -+ writeln(StatArrChar[0]); -+ writeln(Stat2dArrInt[0,0]); -+ -+ setlength(DynArrInt,13); -+ setlength(DynArrInt_,13); -+ setlength(DynArrStr,13); -+ setlength(DynArrChar,13); -+ for i := 0 to 12 do -+ begin -+ DynArrInt[i]:= i+50; -+ DynArrInt_[i]:= i+50; -+ DynArrChar[i]:= chr(ord('a')+i); -+ StatArrStr[i]:='str'+inttostr(i); -+ DynArrStr[i]:='dstr'+inttostr(i); -+ end; -+ writeln(DynArrInt_[1]); -+ writeln(DynArrInt[1]); -+ writeln(DynArrStr[1]); -+ writeln(StatArrStr[1]); -+ writeln(DynArrChar[1]); -+ -+ s := 'test'#0'string'; -+ writeln(s); { set breakpoint 2 here } -+end. -diff --git a/gdb/testsuite/gdb.python/py-frame.exp b/gdb/testsuite/gdb.python/py-frame.exp -index 3517824..4fa2bd8 100644 ---- a/gdb/testsuite/gdb.python/py-frame.exp -+++ b/gdb/testsuite/gdb.python/py-frame.exp -@@ -94,3 +94,5 @@ gdb_test "python print ('result = %s' % f0.read_var ('variable_which_surely_does +Index: gdb-7.8/gdb/testsuite/gdb.python/py-frame.exp +=================================================================== +--- gdb-7.8.orig/gdb/testsuite/gdb.python/py-frame.exp 2014-07-29 19:29:02.680979676 +0200 ++++ gdb-7.8/gdb/testsuite/gdb.python/py-frame.exp 2014-07-29 19:29:04.874982798 +0200 +@@ -94,3 +94,5 @@ gdb_test "python print ('result = %s' % gdb_test "python print ('result = %s' % f0.read_var ('a'))" " = 1" "test Frame.read_var - success" gdb_test "python print ('result = %s' % (gdb.selected_frame () == f1))" " = True" "test gdb.selected_frame" + +gdb_test "python print ('result = %s' % (f0.block ()))" "" "test Frame.block" -diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp -index ed332db..06466ec 100644 ---- a/gdb/testsuite/gdb.python/py-value.exp -+++ b/gdb/testsuite/gdb.python/py-value.exp +Index: gdb-7.8/gdb/testsuite/gdb.python/py-value.exp +=================================================================== +--- gdb-7.8.orig/gdb/testsuite/gdb.python/py-value.exp 2014-07-29 19:29:02.680979676 +0200 ++++ gdb-7.8/gdb/testsuite/gdb.python/py-value.exp 2014-07-29 19:29:04.874982798 +0200 @@ -385,6 +385,15 @@ proc test_value_after_death {} { "print value's type" } @@ -7557,7 +637,7 @@ index ed332db..06466ec 100644 # Regression test for invalid subscript operations. The bug was that # the type of the value was not being checked before allowing a # subscript operation to proceed. -@@ -512,6 +521,7 @@ test_value_in_inferior +@@ -514,6 +523,7 @@ test_value_in_inferior test_inferior_function_call test_lazy_strings test_value_after_death @@ -7565,618 +645,3 @@ index ed332db..06466ec 100644 # Test either C or C++ values. -diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp -index 2713ddf..533b81b 100644 ---- a/gdb/testsuite/lib/gdb.exp -+++ b/gdb/testsuite/lib/gdb.exp -@@ -150,6 +150,11 @@ proc gdb_unload {} { - send_gdb "y\n" - exp_continue - } -+ -re "A program is being debugged already..*Are you sure you want to change the file.*y or n. $"\ -+ { send_gdb "y\n" -+ verbose "\t\tUnloading symbols for program being debugged" -+ exp_continue -+ } - -re "Discard symbol table from .*y or n.*$" { - send_gdb "y\n" - exp_continue -diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp -index 1b494ee..3bb8ad9 100644 ---- a/gdb/testsuite/lib/pascal.exp -+++ b/gdb/testsuite/lib/pascal.exp -@@ -37,6 +37,9 @@ proc pascal_init {} { - global pascal_compiler_is_fpc - global gpc_compiler - global fpc_compiler -+ global fpcversion_major -+ global fpcversion_minor -+ global fpcversion_release - global env - - if { $pascal_init_done == 1 } { -@@ -64,6 +67,20 @@ proc pascal_init {} { - set pascal_compiler_is_fpc 1 - verbose -log "Free Pascal compiler found" - } -+ -+ # Detect the fpc-version -+ if { $pascal_compiler_is_fpc == 1 } { -+ set fpcversion_major 1 -+ set fpcversion_minor 0 -+ set fpcversion_release 0 -+ set fpcversion [ remote_exec host $fpc_compiler "-iV" ] -+ if [regexp {.*([0-9]+)\.([0-9]+)\.([0-9]+).?} $fpcversion] { -+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\1} fpcversion_major -+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\2} fpcversion_minor -+ regsub {.*([0-9]+)\.([0-9]+)\.([0-9]+).?\n?.?} $fpcversion {\3} fpcversion_release -+ } -+ verbose -log "Freepascal version: $fpcversion_major.$fpcversion_minor.$fpcversion_release" -+ } - } - set pascal_init_done 1 - } -diff --git a/gdb/top.c b/gdb/top.c -index d068450..e2b4110 100644 ---- a/gdb/top.c -+++ b/gdb/top.c -@@ -331,6 +331,9 @@ prepare_execute_command (void) - - mark = value_mark (); - cleanup = make_cleanup_value_free_to_mark (mark); -+#if 0 -+ free_all_types (); -+#endif - - /* With multiple threads running while the one we're examining is - stopped, the dcache can get stale without us being able to detect -diff --git a/gdb/typeprint.c b/gdb/typeprint.c -index 09993dd..9fcb3b3 100644 ---- a/gdb/typeprint.c -+++ b/gdb/typeprint.c -@@ -34,6 +34,7 @@ - #include - #include "exceptions.h" - #include "valprint.h" -+#include "dwarf2loc.h" - #include - #include - #include "cli/cli-utils.h" -@@ -363,6 +364,9 @@ void - type_print (struct type *type, const char *varstring, struct ui_file *stream, - int show) - { -+ if (show >= 0 && current_language->la_language != language_ada) -+ type = check_typedef (type); -+ - LA_PRINT_TYPE (type, varstring, stream, show, 0, &default_ptype_flags); - } - -@@ -410,6 +414,7 @@ whatis_exp (char *exp, int show) - struct value_print_options opts; - struct type_print_options flags = default_ptype_flags; - -+ /* Required at least for the object_address_set call. */ - old_chain = make_cleanup (null_cleanup, NULL); - - if (exp) -@@ -457,6 +462,7 @@ whatis_exp (char *exp, int show) - else - val = access_value_history (0); - -+ object_address_set (value_raw_address (val)); - type = value_type (val); - - get_user_print_options (&opts); -diff --git a/gdb/utils.c b/gdb/utils.c -index e062e89..773242d 100644 ---- a/gdb/utils.c -+++ b/gdb/utils.c -@@ -1745,6 +1745,36 @@ set_batch_flag_and_make_cleanup_restore_page_info (void) - return back_to; - } - -+/* Helper for make_cleanup_restore_page_info. */ -+ -+static void -+do_restore_selected_frame_cleanup (void *arg) -+{ -+ struct frame_id *frame_idp = arg; -+ -+ select_frame (frame_find_by_id (*frame_idp)); -+ -+ xfree (frame_idp); -+} -+ -+/* Provide cleanup for restoring currently selected frame. Use frame_id for -+ the case the current frame becomes stale in the meantime. */ -+ -+struct cleanup * -+make_cleanup_restore_selected_frame (void) -+{ -+ struct frame_id *frame_idp; -+ -+ /* get_selected_frame->get_current_frame would error otherwise. */ -+ if (!has_stack_frames ()) -+ return make_cleanup (null_cleanup, NULL); -+ -+ frame_idp = xmalloc (sizeof (*frame_idp)); -+ *frame_idp = get_frame_id (get_selected_frame (NULL)); -+ -+ return make_cleanup (do_restore_selected_frame_cleanup, frame_idp); -+} -+ - /* Set the screen size based on LINES_PER_PAGE and CHARS_PER_LINE. */ - - static void -diff --git a/gdb/utils.h b/gdb/utils.h -index 8bbcc5f..1342d68 100644 ---- a/gdb/utils.h -+++ b/gdb/utils.h -@@ -382,4 +382,6 @@ extern ULONGEST align_down (ULONGEST v, int n); - - extern LONGEST gdb_sign_extend (LONGEST value, int bit); - -+extern struct cleanup *make_cleanup_restore_selected_frame (void); -+ - #endif /* UTILS_H */ -diff --git a/gdb/valarith.c b/gdb/valarith.c -index 8e863e3..97a8b0f 100644 ---- a/gdb/valarith.c -+++ b/gdb/valarith.c -@@ -195,7 +195,10 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) - 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_offs = elt_size * longest_to_int (index - lowerbound); -+ unsigned int elt_stride -+ = (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)) == 0 -+ ? elt_size : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type))); -+ unsigned int elt_offs = elt_stride * longest_to_int (index - lowerbound); - struct value *v; - - if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -@@ -255,6 +258,10 @@ int - binop_user_defined_p (enum exp_opcode op, - struct value *arg1, struct value *arg2) - { -+ /* FIXME: We should support user defined ops for dynamic types. */ -+ if (TYPE_DYNAMIC (value_type (arg1)) || TYPE_DYNAMIC (value_type (arg2))) -+ return 0; -+ - return binop_types_user_defined_p (op, value_type (arg1), value_type (arg2)); - } - -diff --git a/gdb/valops.c b/gdb/valops.c -index 5382c49..0de8009 100644 ---- a/gdb/valops.c -+++ b/gdb/valops.c -@@ -42,6 +42,7 @@ - #include "observer.h" - #include "objfiles.h" - #include "exceptions.h" -+#include "dwarf2loc.h" - - extern unsigned int overload_debug; - /* Local functions. */ -@@ -900,6 +901,65 @@ value_one (struct type *type) - return val; - } - -+/* object_address_set must be already called before this function. */ -+ -+const char * -+object_address_data_not_valid (struct type *type) -+{ -+ /* Attributes are present only at the target type of a typedef. Make the -+ call conditional as it would otherwise loop through type_length_get. */ -+ if (TYPE_CODE (type) == TYPE_CODE_TYPEDEF) -+ CHECK_TYPEDEF (type); -+ -+ /* DW_AT_associated has a preference over DW_AT_allocated. */ -+ if (TYPE_NOT_ASSOCIATED (type) -+ || (TYPE_ASSOCIATED (type) != NULL -+ && 0 == dwarf_locexpr_baton_eval (TYPE_ASSOCIATED (type)))) -+ return N_("object is not associated"); -+ -+ if (TYPE_NOT_ALLOCATED (type) -+ || (TYPE_ALLOCATED (type) != NULL -+ && 0 == dwarf_locexpr_baton_eval (TYPE_ALLOCATED (type)))) -+ return N_("object is not allocated"); -+ -+ return NULL; -+} -+ -+/* Return non-NULL check_typedef result on TYPE if the variable is valid. If -+ it is valid the function may store the data address (DW_AT_DATA_LOCATION) of -+ TYPE at *ADDRESS_RETURN. You must set *ADDRESS_RETURN from -+ value_raw_address (VAL) before calling this function. If no -+ DW_AT_DATA_LOCATION is present for TYPE the address at *ADDRESS_RETURN is -+ left unchanged. ADDRESS_RETURN must not be NULL, use -+ object_address_data_not_valid () for just the data validity check. */ -+ -+struct type * -+object_address_get_data (struct type *type, CORE_ADDR *address_return) -+{ -+ gdb_assert (address_return != NULL); -+ -+ object_address_set (*address_return); -+ -+ /* TYPE_DATA_LOCATION_DWARF_BLOCK / TYPE_DATA_LOCATION_ADDR are present only -+ at the target type of a typedef. */ -+ CHECK_TYPEDEF (type); -+ -+ if (object_address_data_not_valid (type) != NULL) -+ { -+ /* Do not try to evaluate DW_AT_data_location as it may even crash -+ (it would just return the value zero in the gfortran case). */ -+ return NULL; -+ } -+ -+ if (TYPE_DATA_LOCATION_IS_ADDR (type)) -+ *address_return = TYPE_DATA_LOCATION_ADDR (type); -+ else if (TYPE_DATA_LOCATION_DWARF_BLOCK (type) != NULL) -+ *address_return -+ = dwarf_locexpr_baton_eval (TYPE_DATA_LOCATION_DWARF_BLOCK (type)); -+ -+ return type; -+} -+ - /* Helper function for value_at, value_at_lazy, and value_at_lazy_stack. */ - - static struct value * -@@ -1365,7 +1425,18 @@ address_of_variable (struct symbol *var, const struct block *b) - if ((VALUE_LVAL (val) == lval_memory && value_lazy (val)) - || TYPE_CODE (type) == TYPE_CODE_FUNC) - { -- CORE_ADDR addr = value_address (val); -+ CORE_ADDR addr; -+ -+ if (VALUE_LVAL (val) == lval_memory) -+ { -+ addr = value_raw_address (val); -+ if (!object_address_get_data (type, &addr)) -+ error (_("Can't take address of memory lvalue \"%s\"."), -+ SYMBOL_PRINT_NAME (var)); -+ set_value_address (val, addr); -+ } -+ -+ addr = value_address (val); - - return value_from_pointer (lookup_pointer_type (type), addr); - } -@@ -1472,6 +1543,7 @@ struct value * - value_coerce_array (struct value *arg1) - { - struct type *type = check_typedef (value_type (arg1)); -+ CORE_ADDR address; - - /* If the user tries to do something requiring a pointer with an - array that has not yet been pushed to the target, then this would -@@ -1481,8 +1553,12 @@ value_coerce_array (struct value *arg1) - if (VALUE_LVAL (arg1) != lval_memory) - error (_("Attempt to take address of value not located in memory.")); - -+ address = value_raw_address (arg1); -+ if (!object_address_get_data (type, &address)) -+ error (_("Attempt to take address of non-valid value.")); -+ - return value_from_pointer (lookup_pointer_type (TYPE_TARGET_TYPE (type)), -- value_address (arg1)); -+ address + value_offset (arg1)); - } - - /* Given a value which is a function, return a value which is a pointer -@@ -3571,6 +3647,8 @@ value_slice (struct value *array, int lowbound, int length) - TYPE_TARGET_TYPE (range_type), - lowbound, - lowbound + length - 1); -+ TYPE_BYTE_STRIDE (slice_range_type) = TYPE_BYTE_STRIDE (range_type); -+ - - { - struct type *element_type = TYPE_TARGET_TYPE (array_type); -diff --git a/gdb/valprint.c b/gdb/valprint.c -index 01889c5..e25e3c8 100644 ---- a/gdb/valprint.c -+++ b/gdb/valprint.c -@@ -37,6 +37,7 @@ - #include "gdb_obstack.h" - #include "charset.h" - #include -+#include "dwarf2loc.h" - - #include - -@@ -290,7 +291,6 @@ val_print_scalar_type_p (struct type *type) - case TYPE_CODE_STRUCT: - case TYPE_CODE_UNION: - case TYPE_CODE_SET: -- case TYPE_CODE_STRING: - return 0; - default: - return 1; -@@ -1625,6 +1625,7 @@ val_print_array_elements (struct type *type, - { - unsigned int things_printed = 0; - unsigned len; -+ struct type *saved_type = type; - struct type *elttype, *index_type; - unsigned eltlen; - /* Position of the array element we are examining to see -@@ -1633,9 +1634,33 @@ val_print_array_elements (struct type *type, - /* Number of repetitions we have detected so far. */ - unsigned int reps; - LONGEST low_bound, high_bound; -+ struct cleanup *back_to; -+ CORE_ADDR saved_address = address; -+ -+ back_to = make_cleanup (null_cleanup, 0); -+ type = object_address_get_data (type, &address); -+ if (!type) -+ { -+ fputs_filtered (object_address_data_not_valid (type), stream); -+ do_cleanups (back_to); -+ return; -+ } -+ if (address != saved_address) -+ { -+ size_t length = TYPE_LENGTH (type); - -- elttype = TYPE_TARGET_TYPE (type); -- eltlen = TYPE_LENGTH (check_typedef (elttype)); -+ valaddr = xmalloc (length); -+ make_cleanup (xfree, (gdb_byte *) valaddr); -+ read_memory (address, (gdb_byte *) valaddr, length); -+ } -+ -+ /* Skip typedefs but do not resolve TYPE_DYNAMIC. */ -+ elttype = saved_type; -+ while (TYPE_CODE (elttype) == TYPE_CODE_TYPEDEF) -+ elttype = TYPE_TARGET_TYPE (elttype); -+ elttype = TYPE_TARGET_TYPE (elttype); -+ -+ eltlen = TYPE_ARRAY_BYTE_STRIDE_VALUE (type); - index_type = TYPE_INDEX_TYPE (type); - - if (get_array_bounds (type, &low_bound, &high_bound)) -@@ -1722,6 +1747,8 @@ val_print_array_elements (struct type *type, - { - fprintf_filtered (stream, "..."); - } -+ -+ do_cleanups (back_to); - } - - /* Read LEN bytes of target memory at address MEMADDR, placing the -diff --git a/gdb/value.c b/gdb/value.c -index 8542316..f75cf37 100644 ---- a/gdb/value.c -+++ b/gdb/value.c -@@ -43,6 +43,7 @@ - #include "tracepoint.h" - #include "cp-abi.h" - #include "user-regs.h" -+#include "observer.h" - - /* Prototypes for exported functions. */ - -@@ -1623,12 +1624,15 @@ void - set_value_component_location (struct value *component, - const struct value *whole) - { -+ CORE_ADDR addr; -+ - if (whole->lval == lval_internalvar) - VALUE_LVAL (component) = lval_internalvar_component; - else - VALUE_LVAL (component) = whole->lval; - - component->location = whole->location; -+ - if (whole->lval == lval_computed) - { - const struct lval_funcs *funcs = whole->location.computed.funcs; -@@ -1636,6 +1640,12 @@ set_value_component_location (struct value *component, - if (funcs->copy_closure) - component->location.computed.closure = funcs->copy_closure (whole); - } -+ -+ addr = value_raw_address (component); -+ object_address_get_data (value_type (whole), &addr); -+ if (component->lval != lval_internalvar -+ && component->lval != lval_internalvar_component) -+ set_value_address (component, addr); - } - - -@@ -1769,6 +1779,31 @@ show_values (char *num_exp, int from_tty) - num_exp[1] = '\0'; - } - } -+ -+/* Sanity check for memory leaks and proper types reference counting. */ -+ -+static void -+value_history_cleanup (void *unused) -+{ -+ while (value_history_chain) -+ { -+ struct value_history_chunk *chunk = value_history_chain; -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE (chunk->values); i++) -+ value_free (chunk->values[i]); -+ -+ value_history_chain = chunk->next; -+ xfree (chunk); -+ } -+ value_history_count = 0; -+ -+ /* Free the unreferenced types above. */ -+ free_all_values (); -+#if 0 -+ free_all_types (); -+#endif -+} - - /* Internal variables. These are variables within the debugger - that hold values assigned by debugger commands. -@@ -2304,6 +2339,38 @@ call_internal_function (struct gdbarch *gdbarch, - return (*ifn->handler) (gdbarch, language, ifn->cookie, argc, argv); - } - -+#if 0 -+/* Call type_mark_used for any TYPEs referenced from this GDB source file. */ -+ -+static void -+value_types_mark_used (void) -+{ -+ struct internalvar *var; -+ struct value_history_chunk *chunk; -+ -+ for (var = internalvars; var != NULL; var = var->next) -+ switch (var->kind) -+ { -+ case INTERNALVAR_VALUE: -+ type_mark_used (value_type (var->u.value)); -+ break; -+ -+ case INTERNALVAR_INTEGER: -+ type_mark_used (var->u.integer.type); -+ break; -+ } -+ -+ for (chunk = value_history_chain; chunk != NULL; chunk = chunk->next) -+ { -+ int i; -+ -+ for (i = 0; i < ARRAY_SIZE (chunk->values); i++) -+ if (chunk->values[i]) -+ type_mark_used (value_type (chunk->values[i])); -+ } -+} -+#endif -+ - /* The 'function' command. This does nothing -- it is just a - placeholder to let "help function NAME" work. This is also used as - the implementation of the sub-command that is created when -@@ -2351,11 +2418,10 @@ preserve_one_value (struct value *value, struct objfile *objfile, - htab_t copied_types) - { - if (TYPE_OBJFILE (value->type) == objfile) -- value->type = copy_type_recursive (objfile, value->type, copied_types); -+ value->type = copy_type_recursive (value->type, copied_types); - - if (TYPE_OBJFILE (value->enclosing_type) == objfile) -- value->enclosing_type = copy_type_recursive (objfile, -- value->enclosing_type, -+ value->enclosing_type = copy_type_recursive (value->enclosing_type, - copied_types); - } - -@@ -2370,7 +2436,7 @@ preserve_one_internalvar (struct internalvar *var, struct objfile *objfile, - case INTERNALVAR_INTEGER: - if (var->u.integer.type && TYPE_OBJFILE (var->u.integer.type) == objfile) - var->u.integer.type -- = copy_type_recursive (objfile, var->u.integer.type, copied_types); -+ = copy_type_recursive (var->u.integer.type, copied_types); - break; - - case INTERNALVAR_VALUE: -@@ -3479,10 +3545,27 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type, - struct value * - coerce_ref (struct value *arg) - { -- struct type *value_type_arg_tmp = check_typedef (value_type (arg)); -+ struct type *value_type_arg_tmp; - struct value *retval; - struct type *enc_type; - -+ if (TYPE_DYNAMIC (value_type (arg))) -+ { -+ struct cleanup *cleanups = make_cleanup (null_cleanup, NULL); -+ CORE_ADDR address; -+ -+ value_type_arg_tmp = value_type (arg); -+ address = value_raw_address (arg); -+ value_type_arg_tmp = object_address_get_data (value_type_arg_tmp, -+ &address); -+ if (! value_type_arg_tmp) -+ error (_("Attempt to coerce non-valid value.")); -+ arg = value_at_lazy (value_type_arg_tmp, address); -+ do_cleanups (cleanups); -+ } -+ else -+ value_type_arg_tmp = check_typedef (value_type (arg)); -+ - retval = coerce_ref_if_computed (arg); - if (retval) - return retval; -@@ -3590,7 +3673,8 @@ int - value_fetch_lazy (struct value *val) - { - gdb_assert (value_lazy (val)); -- allocate_value_contents (val); -+ if (VALUE_LVAL (val) != lval_memory) -+ allocate_value_contents (val); - if (value_bitsize (val)) - { - /* To read a lazy bitfield, read the entire enclosing value. This -@@ -3625,13 +3709,24 @@ value_fetch_lazy (struct value *val) - } - else if (VALUE_LVAL (val) == lval_memory) - { -- CORE_ADDR addr = value_address (val); -- struct type *type = check_typedef (value_enclosing_type (val)); -+ CORE_ADDR addr = value_raw_address (val); -+ -+ if (object_address_get_data (value_type (val), &addr)) -+ { -+ struct type *type = value_enclosing_type (val); -+ int length = TYPE_LENGTH (check_typedef (type)); - -- if (TYPE_LENGTH (type)) -- read_value_memory (val, 0, value_stack (val), -- addr, value_contents_all_raw (val), -- TYPE_LENGTH (type)); -+ if (length) -+ { -+ /* Delay it after object_address_get_data above. */ -+ allocate_value_contents (val); -+ addr += value_offset (val); -+ read_value_memory (val, 0, value_stack (val), -+ addr, value_contents_all_raw (val), length); -+ } -+ } -+ /* Just to be sure it has been called. */ -+ allocate_value_contents (val); - } - else if (VALUE_LVAL (val) == lval_register) - { -@@ -3814,4 +3909,10 @@ Check whether an expression is void.\n\ - Usage: $_isvoid (expression)\n\ - Return 1 if the expression is void, zero otherwise."), - isvoid_internal_fn, NULL); -+ -+ make_final_cleanup (value_history_cleanup, NULL); -+ -+#if 0 -+ observer_attach_mark_used (value_types_mark_used); -+#endif - } -diff --git a/gdb/value.h b/gdb/value.h -index 5924b2f..eae3553 100644 ---- a/gdb/value.h -+++ b/gdb/value.h -@@ -571,6 +571,10 @@ extern struct value *value_from_decfloat (struct type *type, - const gdb_byte *decbytes); - extern struct value *value_from_history_ref (char *, char **); - -+extern const char *object_address_data_not_valid (struct type *type); -+extern struct type *object_address_get_data (struct type *type, -+ CORE_ADDR *address_return); -+ - extern struct value *value_at (struct type *type, CORE_ADDR addr); - extern struct value *value_at_lazy (struct type *type, CORE_ADDR addr); - diff --git a/gdb-attach-fail-reasons-5of5.patch b/gdb-attach-fail-reasons-5of5.patch index a591f48..da6f7b7 100644 --- a/gdb-attach-fail-reasons-5of5.patch +++ b/gdb-attach-fail-reasons-5of5.patch @@ -37,10 +37,10 @@ gdb/gdbserver/ (linux_create_inferior, linux_tracefork_child): Call it instead of direct ptrace. -Index: gdb-7.6.90.20140127/gdb/common/linux-ptrace.c +Index: gdb-7.8/gdb/common/linux-ptrace.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/common/linux-ptrace.c 2014-02-06 17:40:32.530145960 +0100 -+++ gdb-7.6.90.20140127/gdb/common/linux-ptrace.c 2014-02-06 17:48:16.329644534 +0100 +--- gdb-7.8.orig/gdb/common/linux-ptrace.c 2014-07-29 19:31:01.893149317 +0200 ++++ gdb-7.8/gdb/common/linux-ptrace.c 2014-07-29 19:31:05.806154887 +0200 @@ -32,6 +32,10 @@ #include @@ -52,16 +52,16 @@ Index: gdb-7.6.90.20140127/gdb/common/linux-ptrace.c /* Stores the currently supported ptrace options. A value of -1 means we did not check for features yet. A value of 0 means there are no supported features. */ -@@ -56,6 +60,8 @@ linux_ptrace_attach_warnings (pid_t pid, - buffer_xml_printf (buffer, _("warning: process %d is a zombie " - "- the process has already terminated\n"), +@@ -56,6 +60,8 @@ linux_ptrace_attach_fail_reason (pid_t p + buffer_xml_printf (buffer, _("process %d is a zombie " + "- the process has already terminated"), (int) pid); + + linux_ptrace_create_warnings (buffer); } #if defined __i386__ || defined __x86_64__ -@@ -542,3 +548,19 @@ linux_ptrace_init_warnings (void) +@@ -551,3 +557,19 @@ linux_ptrace_init_warnings (void) linux_ptrace_test_ret_to_nx (); } @@ -81,23 +81,23 @@ Index: gdb-7.6.90.20140127/gdb/common/linux-ptrace.c + "(gdb) shell sudo setsebool deny_ptrace=0")); +#endif /* HAVE_LIBSELINUX */ +} -Index: gdb-7.6.90.20140127/gdb/common/linux-ptrace.h +Index: gdb-7.8/gdb/common/linux-ptrace.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/common/linux-ptrace.h 2014-02-06 17:40:35.506149162 +0100 -+++ gdb-7.6.90.20140127/gdb/common/linux-ptrace.h 2014-02-06 17:48:00.601627995 +0100 +--- gdb-7.8.orig/gdb/common/linux-ptrace.h 2014-07-29 19:31:01.893149317 +0200 ++++ gdb-7.8/gdb/common/linux-ptrace.h 2014-07-29 19:31:05.807154887 +0200 @@ -85,6 +85,7 @@ struct buffer; - extern void linux_ptrace_attach_warnings (pid_t pid, struct buffer *buffer); + extern void linux_ptrace_attach_fail_reason (pid_t pid, struct buffer *buffer); extern void linux_ptrace_init_warnings (void); +extern void linux_ptrace_create_warnings (struct buffer *buffer); extern void linux_enable_event_reporting (pid_t pid); + extern void linux_disable_event_reporting (pid_t pid); extern int linux_supports_tracefork (void); - extern int linux_supports_traceclone (void); -Index: gdb-7.6.90.20140127/gdb/configure.ac +Index: gdb-7.8/gdb/configure.ac =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/configure.ac 2014-02-06 17:40:32.532145962 +0100 -+++ gdb-7.6.90.20140127/gdb/configure.ac 2014-02-06 17:40:35.507149163 +0100 -@@ -1975,6 +1975,10 @@ case $host_os in +--- gdb-7.8.orig/gdb/configure.ac 2014-07-29 19:31:01.894149319 +0200 ++++ gdb-7.8/gdb/configure.ac 2014-07-29 19:31:05.807154887 +0200 +@@ -2158,6 +2158,10 @@ case $host_os in esac AC_DEFINE_UNQUOTED(GDBINIT,"$gdbinit",[The .gdbinit filename.]) @@ -108,10 +108,10 @@ Index: gdb-7.6.90.20140127/gdb/configure.ac dnl Handle optional features that can be enabled. # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, -Index: gdb-7.6.90.20140127/gdb/gdbserver/configure.ac +Index: gdb-7.8/gdb/gdbserver/configure.ac =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbserver/configure.ac 2014-02-06 17:40:32.532145962 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbserver/configure.ac 2014-02-06 17:40:35.507149163 +0100 +--- gdb-7.8.orig/gdb/gdbserver/configure.ac 2014-07-29 19:31:01.895149320 +0200 ++++ gdb-7.8/gdb/gdbserver/configure.ac 2014-07-29 19:31:05.808154887 +0200 @@ -454,6 +454,10 @@ if $want_ipa ; then fi fi @@ -123,11 +123,11 @@ Index: gdb-7.6.90.20140127/gdb/gdbserver/configure.ac AC_SUBST(GDBSERVER_DEPFILES) AC_SUBST(GDBSERVER_LIBS) AC_SUBST(srv_xmlbuiltin) -Index: gdb-7.6.90.20140127/gdb/gdbserver/linux-low.c +Index: gdb-7.8/gdb/gdbserver/linux-low.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbserver/linux-low.c 2014-02-06 17:40:32.534145964 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbserver/linux-low.c 2014-02-06 17:49:32.385726514 +0100 -@@ -543,6 +543,29 @@ add_lwp (ptid_t ptid) +--- gdb-7.8.orig/gdb/gdbserver/linux-low.c 2014-07-29 19:31:01.897149323 +0200 ++++ gdb-7.8/gdb/gdbserver/linux-low.c 2014-07-29 19:31:05.809154889 +0200 +@@ -541,6 +541,29 @@ add_lwp (ptid_t ptid) return lwp; } @@ -157,7 +157,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbserver/linux-low.c /* Start an inferior process and returns its pid. ALLARGS is a vector of program-name and args. */ -@@ -584,7 +607,7 @@ linux_create_inferior (char *program, ch +@@ -582,7 +605,7 @@ linux_create_inferior (char *program, ch if (pid == 0) { close_most_fds (); @@ -166,10 +166,10 @@ Index: gdb-7.6.90.20140127/gdb/gdbserver/linux-low.c #ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */ signal (__SIGRTMIN + 1, SIG_DFL); -Index: gdb-7.6.90.20140127/gdb/inf-ptrace.c +Index: gdb-7.8/gdb/inf-ptrace.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/inf-ptrace.c 2014-02-06 17:40:32.535145965 +0100 -+++ gdb-7.6.90.20140127/gdb/inf-ptrace.c 2014-02-06 17:40:35.510149167 +0100 +--- gdb-7.8.orig/gdb/inf-ptrace.c 2014-07-29 19:31:01.898149324 +0200 ++++ gdb-7.8/gdb/inf-ptrace.c 2014-07-29 19:31:05.809154889 +0200 @@ -105,7 +105,15 @@ static void inf_ptrace_me (void) { @@ -186,11 +186,11 @@ Index: gdb-7.6.90.20140127/gdb/inf-ptrace.c } /* Start a new inferior Unix child process. EXEC_FILE is the file to -Index: gdb-7.6.90.20140127/gdb/linux-nat.c +Index: gdb-7.8/gdb/linux-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/linux-nat.c 2014-02-06 17:40:32.537145968 +0100 -+++ gdb-7.6.90.20140127/gdb/linux-nat.c 2014-02-06 17:40:35.511149168 +0100 -@@ -1283,6 +1283,7 @@ linux_nat_create_inferior (struct target +--- gdb-7.8.orig/gdb/linux-nat.c 2014-07-29 19:31:01.899149326 +0200 ++++ gdb-7.8/gdb/linux-nat.c 2014-07-29 19:31:05.811154893 +0200 +@@ -1291,6 +1291,7 @@ linux_nat_create_inferior (struct target #ifdef HAVE_PERSONALITY int personality_orig = 0, personality_set = 0; #endif /* HAVE_PERSONALITY */ @@ -198,9 +198,9 @@ Index: gdb-7.6.90.20140127/gdb/linux-nat.c /* The fork_child mechanism is synchronous and calls target_wait, so we have to mask the async mode. */ -@@ -1307,7 +1308,10 @@ linux_nat_create_inferior (struct target +@@ -1315,7 +1316,10 @@ linux_nat_create_inferior (struct target /* Make sure we report all signals during startup. */ - linux_nat_pass_signals (0, NULL); + linux_nat_pass_signals (ops, 0, NULL); - linux_ops->to_create_inferior (ops, exec_file, allargs, env, from_tty); + TRY_CATCH (ex, RETURN_MASK_ERROR) @@ -210,7 +210,7 @@ Index: gdb-7.6.90.20140127/gdb/linux-nat.c #ifdef HAVE_PERSONALITY if (personality_set) -@@ -1319,6 +1323,24 @@ linux_nat_create_inferior (struct target +@@ -1327,6 +1331,24 @@ linux_nat_create_inferior (struct target safe_strerror (errno)); } #endif /* HAVE_PERSONALITY */ @@ -235,11 +235,11 @@ Index: gdb-7.6.90.20140127/gdb/linux-nat.c } static void -Index: gdb-7.6.90.20140127/gdb/config.in +Index: gdb-7.8/gdb/config.in =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/config.in 2014-02-06 17:40:32.538145969 +0100 -+++ gdb-7.6.90.20140127/gdb/config.in 2014-02-06 17:40:35.511149168 +0100 -@@ -213,6 +213,9 @@ +--- gdb-7.8.orig/gdb/config.in 2014-07-29 19:31:01.900149327 +0200 ++++ gdb-7.8/gdb/config.in 2014-07-29 19:31:44.600210090 +0200 +@@ -219,6 +219,9 @@ /* Define if librpm library is being used. */ #undef HAVE_LIBRPM @@ -249,21 +249,21 @@ Index: gdb-7.6.90.20140127/gdb/config.in /* Define to 1 if you have the header file. */ #undef HAVE_LIBUNWIND_IA64_H -@@ -345,6 +348,9 @@ - /* Define to 1 if you have the `sbrk' function. */ - #undef HAVE_SBRK +@@ -354,6 +357,9 @@ + /* Define to 1 if you have the `scm_new_smob' function. */ + #undef HAVE_SCM_NEW_SMOB +/* Define to 1 if you have the header file. */ +#undef HAVE_SELINUX_SELINUX_H + - /* Define to 1 if you have the `setlocale' function. */ - #undef HAVE_SETLOCALE + /* Define to 1 if you have the `setenv' function. */ + #undef HAVE_SETENV -Index: gdb-7.6.90.20140127/gdb/configure +Index: gdb-7.8/gdb/configure =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/configure 2014-02-06 17:40:32.541145972 +0100 -+++ gdb-7.6.90.20140127/gdb/configure 2014-02-06 17:40:35.515149172 +0100 -@@ -12861,6 +12861,64 @@ cat >>confdefs.h <<_ACEOF +--- gdb-7.8.orig/gdb/configure 2014-07-29 19:31:01.903149331 +0200 ++++ gdb-7.8/gdb/configure 2014-07-29 19:31:05.815154898 +0200 +@@ -13392,6 +13392,64 @@ cat >>confdefs.h <<_ACEOF _ACEOF @@ -328,11 +328,11 @@ Index: gdb-7.6.90.20140127/gdb/configure # Support for --with-sysroot is a copy of GDB_AC_WITH_DIR, # except that the argument to --with-sysroot is optional. -Index: gdb-7.6.90.20140127/gdb/gdbserver/config.in +Index: gdb-7.8/gdb/gdbserver/config.in =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbserver/config.in 2014-02-06 17:40:32.542145973 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbserver/config.in 2014-02-06 17:54:06.923021799 +0100 -@@ -78,6 +78,9 @@ +--- gdb-7.8.orig/gdb/gdbserver/config.in 2014-07-29 19:31:01.904149333 +0200 ++++ gdb-7.8/gdb/gdbserver/config.in 2014-07-29 19:31:05.815154898 +0200 +@@ -81,6 +81,9 @@ /* Define to 1 if you have the `mcheck' library (-lmcheck). */ #undef HAVE_LIBMCHECK @@ -342,7 +342,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbserver/config.in /* Define if the target supports branch tracing. */ #undef HAVE_LINUX_BTRACE -@@ -151,6 +154,9 @@ +@@ -154,6 +157,9 @@ /* Define to 1 if you have the `readlink' function. */ #undef HAVE_READLINK @@ -352,10 +352,10 @@ Index: gdb-7.6.90.20140127/gdb/gdbserver/config.in /* Define to 1 if you have the header file. */ #undef HAVE_SGTTY_H -Index: gdb-7.6.90.20140127/gdb/gdbserver/configure +Index: gdb-7.8/gdb/gdbserver/configure =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbserver/configure 2014-02-06 17:40:32.543145974 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbserver/configure 2014-02-06 17:40:35.516149173 +0100 +--- gdb-7.8.orig/gdb/gdbserver/configure 2014-07-29 19:31:01.905149334 +0200 ++++ gdb-7.8/gdb/gdbserver/configure 2014-07-29 19:31:05.817154901 +0200 @@ -6170,6 +6170,64 @@ if $want_ipa ; then fi fi diff --git a/gdb-babeltrace-configure.patch b/gdb-babeltrace-configure.patch new file mode 100644 index 0000000..52fa8bf --- /dev/null +++ b/gdb-babeltrace-configure.patch @@ -0,0 +1,85 @@ +http://sourceware.org/ml/gdb-patches/2014-08/msg00045.html +Subject: [patch] Fix --with-babeltrace with gcc-4.9.1 + + +--qMm9M+Fa2AknHoGS +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +when I tried to use --with-babeltrace on Fedora Rawhide x86_64 +using gcc-4.9.1-3.fc22.x86_64 I got: + +checking for libbabeltrace... no +configure: error: babeltrace is missing or unusable +Makefile:7973: recipe for target 'configure-gdb' failed + +configure:15890: checking for libbabeltrace +configure:15918: gcc -o conftest -O2 -g -pipe -Wall -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -Werror -static-libstdc++ -static-libgcc -Wl,-z,relro conftest.c -lselinux -lncurses -lz -lm -ldl /usr/lib64/libbabeltrace.so /usr/lib64/libbabeltrace-ctf.so >&5 +conftest.c: In function 'main': +conftest.c:198:21: error: unused variable 'pos' [-Werror=unused-variable] + struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); + ^ +cc1: all warnings being treated as errors +configure:15918: $? = 1 +configure: failed program was: + +The patch below fixes it for me. + +In configure.ac there is above this check: + # Append -Werror to CFLAGS so that configure can catch the warning + # "assignment from incompatible pointer type", which is related to + # the babeltrace change from 1.0.3 to 1.1.0. Babeltrace 1.1.0 works + # in GDB, while babeltrace 1.0.3 is broken. + # AC_LIB_HAVE_LINKFLAGS may modify CPPFLAGS in it, so it should be + # safe to save and restore CFLAGS here. + saved_CFLAGS=$CFLAGS + CFLAGS="$CFLAGS -Werror" + +Maybe it would be easier to use there: + CFLAGS="$CFLAGS -Werror -Wno-unused-variable" + +But maybe -Werror is cross-compiler compatible while -Wno-unused-variable is +not, I have no idea. + + +Jan + +--qMm9M+Fa2AknHoGS +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="gdb-babeltrace-configure.patch" + +gdb/ +2014-08-04 Jan Kratochvil + + * configure.ac (--with-babeltrace): Use 'pos'. + * configure: Regenerate. + +diff --git a/gdb/configure.ac b/gdb/configure.ac +index 70d0964..07d2f00 100644 +--- a/gdb/configure.ac ++++ b/gdb/configure.ac +@@ -2437,6 +2437,7 @@ else + struct bt_ctf_event *event = NULL; + const struct bt_definition *scope; + ++ (void) pos; /* Prevent -Werror=unused-variable. */ + scope = bt_ctf_get_top_level_scope (event, + BT_STREAM_EVENT_HEADER); + bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id")); +diff --git a/gdb/configure b/gdb/configure +index 809326a..b983d16 100755 +--- a/gdb/configure ++++ b/gdb/configure +@@ -15344,6 +15344,7 @@ struct bt_iter_pos *pos = bt_iter_get_pos (bt_ctf_get_iter (NULL)); + struct bt_ctf_event *event = NULL; + const struct bt_definition *scope; + ++ (void) pos; /* Prevent -Werror=unused-variable. */ + scope = bt_ctf_get_top_level_scope (event, + BT_STREAM_EVENT_HEADER); + bt_ctf_get_uint64 (bt_ctf_get_field (event, scope, "id")); + +--qMm9M+Fa2AknHoGS-- + diff --git a/gdb-btrobust.patch b/gdb-btrobust.patch new file mode 100644 index 0000000..dd05018 --- /dev/null +++ b/gdb-btrobust.patch @@ -0,0 +1,82 @@ +This should fix the error with glib. An error message will still be +printed, but a default backtrace will occur in this case. + +-- + +--- gdb-7.7.90.20140613/gdb/python/py-framefilter.c-orig 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/python/py-framefilter.c 2014-06-27 17:20:00.945271945 +0200 +@@ -1475,6 +1475,7 @@ gdbpy_apply_frame_filter (const struct e + volatile struct gdb_exception except; + PyObject *item; + htab_t levels_printed; ++ int count_printed = 0; + + if (!gdb_python_initialized) + return EXT_LANG_BT_NO_FILTERS; +@@ -1494,24 +1495,7 @@ gdbpy_apply_frame_filter (const struct e + iterable = bootstrap_python_frame_filters (frame, frame_low, frame_high); + + if (iterable == NULL) +- { +- /* Normally if there is an error GDB prints the exception, +- abandons the backtrace and exits. The user can then call "bt +- no-filters", and get a default backtrace (it would be +- confusing to automatically start a standard backtrace halfway +- through a Python filtered backtrace). However in the case +- where GDB cannot initialize the frame filters (most likely +- due to incorrect auto-load paths), GDB has printed nothing. +- In this case it is OK to print the default backtrace after +- printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS +- here to signify there are no filters after printing the +- initialization error. This return code will trigger a +- default backtrace. */ +- +- gdbpy_print_stack (); +- do_cleanups (cleanups); +- return EXT_LANG_BT_NO_FILTERS; +- } ++ goto error_nothing_printed; + + /* If iterable is None, then there are no frame filters registered. + If this is the case, defer to default GDB printing routines in MI +@@ -1540,15 +1524,39 @@ gdbpy_apply_frame_filter (const struct e + gdbpy_print_stack (); + + Py_DECREF (item); ++ count_printed++; + } + + if (item == NULL && PyErr_Occurred ()) +- goto error; ++ { ++ if (count_printed > 0) ++ goto error; ++ else ++ goto error_nothing_printed; ++ } + + done: + do_cleanups (cleanups); + return success; + ++ /* Normally if there is an error GDB prints the exception, ++ abandons the backtrace and exits. The user can then call "bt ++ no-filters", and get a default backtrace (it would be ++ confusing to automatically start a standard backtrace halfway ++ through a Python filtered backtrace). However in the case ++ where GDB cannot initialize the frame filters (most likely ++ due to incorrect auto-load paths), GDB has printed nothing. ++ In this case it is OK to print the default backtrace after ++ printing the error message. GDB returns EXT_LANG_BT_NO_FILTERS ++ here to signify there are no filters after printing the ++ initialization error. This return code will trigger a ++ default backtrace. */ ++ ++ error_nothing_printed: ++ gdbpy_print_stack (); ++ do_cleanups (cleanups); ++ return EXT_LANG_BT_NO_FILTERS; ++ + /* Exit and abandon backtrace on error, printing the exception that + is set. */ + error: diff --git a/gdb-bz533176-fortran-omp-step.patch b/gdb-bz533176-fortran-omp-step.patch index a0cfd27..e45b805 100644 --- a/gdb-bz533176-fortran-omp-step.patch +++ b/gdb-bz533176-fortran-omp-step.patch @@ -21,11 +21,11 @@ debugging problem of GOMP outside of the scope of this Bug. -Index: gdb-7.6.50.20130731-cvs/gdb/infrun.c +Index: gdb-7.7.90.20140613/gdb/infrun.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/infrun.c 2013-08-02 17:10:08.446962958 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/infrun.c 2013-08-02 17:10:49.109016685 +0200 -@@ -4930,6 +4930,16 @@ process_event_stop_test: +--- gdb-7.7.90.20140613.orig/gdb/infrun.c 2014-06-13 21:59:10.835805512 +0200 ++++ gdb-7.7.90.20140613/gdb/infrun.c 2014-06-13 21:59:31.064829121 +0200 +@@ -4820,6 +4820,16 @@ process_event_stop_test (struct executio if (ecs->event_thread->control.step_over_calls == STEP_OVER_ALL) { @@ -36,13 +36,13 @@ Index: gdb-7.6.50.20130731-cvs/gdb/infrun.c + || strstr (SYMBOL_LINKAGE_NAME (stop_fn), ".omp_fn.") == NULL) + /* gcc-4.7.2-9.fc19.x86_64 uses a new format. */ + && (stopf == NULL -+ || strstr (SYMBOL_LINKAGE_NAME (stopf), "._omp_fn.") == NULL)) ++ || strstr (MSYMBOL_LINKAGE_NAME (stopf), "._omp_fn.") == NULL)) +{ /* ".omp_fn." */ + /* We're doing a "next". Normal (forward) execution: set a breakpoint at the -@@ -4965,6 +4975,7 @@ process_event_stop_test: +@@ -4855,6 +4865,7 @@ process_event_stop_test (struct executio keep_going (ecs); return; @@ -50,10 +50,10 @@ Index: gdb-7.6.50.20130731-cvs/gdb/infrun.c } /* If we are in a function call trampoline (a stub between the -Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.fortran/omp-step.exp +Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.fortran/omp-step.exp 2013-08-02 17:10:37.063000571 +0200 ++++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.exp 2014-06-13 21:59:22.801819481 +0200 @@ -0,0 +1,31 @@ +# Copyright 2009 Free Software Foundation, Inc. + @@ -86,10 +86,10 @@ Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.fortran/omp-step.exp + +gdb_breakpoint [gdb_get_line_number "success"] +gdb_continue_to_breakpoint "success" ".*success.*" -Index: gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.fortran/omp-step.f90 +Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.50.20130731-cvs/gdb/testsuite/gdb.fortran/omp-step.f90 2013-08-02 17:10:37.063000571 +0200 ++++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/omp-step.f90 2014-06-13 21:59:22.801819481 +0200 @@ -0,0 +1,32 @@ +! Copyright 2009 Free Software Foundation, Inc. + diff --git a/gdb-bz541866-rwatch-before-run.patch b/gdb-bz541866-rwatch-before-run.patch index a4ede39..72378cb 100644 --- a/gdb-bz541866-rwatch-before-run.patch +++ b/gdb-bz541866-rwatch-before-run.patch @@ -1,7 +1,7 @@ -Index: gdb-7.6.90.20140127/gdb/config/i386/linux64.mh +Index: gdb-7.7.50.20140609/gdb/config/i386/linux64.mh =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/config/i386/linux64.mh 2014-02-06 17:30:23.021489736 +0100 -+++ gdb-7.6.90.20140127/gdb/config/i386/linux64.mh 2014-02-06 17:30:44.984513403 +0100 +--- gdb-7.7.50.20140609.orig/gdb/config/i386/linux64.mh 2014-06-13 20:25:37.356732335 +0200 ++++ gdb-7.7.50.20140609/gdb/config/i386/linux64.mh 2014-06-13 20:26:07.984764098 +0200 @@ -5,7 +5,7 @@ NATDEPFILES= inf-ptrace.o fork-child.o \ proc-service.o linux-thread-db.o linux-fork.o \ linux-procfs.o linux-ptrace.o linux-btrace.o \ @@ -11,10 +11,10 @@ Index: gdb-7.6.90.20140127/gdb/config/i386/linux64.mh NAT_CDEPS = $(srcdir)/proc-service.list # The dynamically loaded libthread_db needs access to symbols in the -Index: gdb-7.6.90.20140127/gdb/config/i386/linux.mh +Index: gdb-7.7.50.20140609/gdb/config/i386/linux.mh =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/config/i386/linux.mh 2014-02-06 17:30:15.893482056 +0100 -+++ gdb-7.6.90.20140127/gdb/config/i386/linux.mh 2014-02-06 17:30:23.021489736 +0100 +--- gdb-7.7.50.20140609.orig/gdb/config/i386/linux.mh 2014-06-13 20:25:37.356732335 +0200 ++++ gdb-7.7.50.20140609/gdb/config/i386/linux.mh 2014-06-13 20:26:07.984764098 +0200 @@ -1,6 +1,6 @@ # Host: Intel 386 running GNU/Linux. @@ -23,10 +23,10 @@ Index: gdb-7.6.90.20140127/gdb/config/i386/linux.mh NATDEPFILES= inf-ptrace.o fork-child.o \ i386-nat.o i386-linux-nat.o \ proc-service.o linux-thread-db.o \ -Index: gdb-7.6.90.20140127/gdb/config/i386/nm-linux.h +Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/config/i386/nm-linux.h 2014-02-06 17:30:23.021489736 +0100 ++++ gdb-7.7.50.20140609/gdb/config/i386/nm-linux.h 2014-06-13 20:26:07.984764098 +0200 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux i386. + @@ -56,10 +56,10 @@ Index: gdb-7.6.90.20140127/gdb/config/i386/nm-linux.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.6.90.20140127/gdb/config/i386/nm-linux64.h +Index: gdb-7.7.50.20140609/gdb/config/i386/nm-linux64.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/config/i386/nm-linux64.h 2014-02-06 17:30:23.021489736 +0100 ++++ gdb-7.7.50.20140609/gdb/config/i386/nm-linux64.h 2014-06-13 20:26:07.984764098 +0200 @@ -0,0 +1,28 @@ +/* Native support for GNU/Linux amd64. + @@ -89,25 +89,26 @@ Index: gdb-7.6.90.20140127/gdb/config/i386/nm-linux64.h +#define target_can_use_hardware_watchpoint(type, cnt, ot) 1 + +#endif /* NM_LINUX64_H */ -Index: gdb-7.6.90.20140127/gdb/target.h +Index: gdb-7.7.50.20140609/gdb/target.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/target.h 2014-02-06 17:30:15.894482057 +0100 -+++ gdb-7.6.90.20140127/gdb/target.h 2014-02-06 17:30:23.022489737 +0100 -@@ -1521,8 +1521,10 @@ extern char *target_thread_name (struct +--- gdb-7.7.50.20140609.orig/gdb/target.h 2014-06-13 20:26:07.985764099 +0200 ++++ gdb-7.7.50.20140609/gdb/target.h 2014-06-13 20:26:34.915792095 +0200 +@@ -1728,9 +1728,11 @@ extern char *target_thread_name (struct bp_hardware_breakpoint. CNT is the number of such watchpoints used so far (including this one?). OTHERTYPE is who knows what... */ +#ifndef target_can_use_hardware_watchpoint #define target_can_use_hardware_watchpoint(TYPE,CNT,OTHERTYPE) \ - (*current_target.to_can_use_hw_breakpoint) (TYPE, CNT, OTHERTYPE); + (*current_target.to_can_use_hw_breakpoint) (¤t_target, \ + TYPE, CNT, OTHERTYPE); +#endif /* Returns the number of debug registers needed to watch the given memory region, or zero if not supported. */ -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp +Index: gdb-7.7.50.20140609/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2014-02-06 17:30:23.022489737 +0100 ++++ gdb-7.7.50.20140609/gdb/testsuite/gdb.base/watchpoint-hw-before-run.exp 2014-06-13 20:26:07.986764101 +0200 @@ -0,0 +1,40 @@ +# Copyright 2009, 2010 Free Software Foundation, Inc. + diff --git a/gdb-dts-rhel6-python-compat.patch b/gdb-dts-rhel6-python-compat.patch new file mode 100644 index 0000000..1cdb3f1 --- /dev/null +++ b/gdb-dts-rhel6-python-compat.patch @@ -0,0 +1,308 @@ +https://bugzilla.redhat.com/show_bug.cgi?id=1020004 + +Index: gdb-7.7.90.20140613/gdb/data-directory/Makefile.in +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/data-directory/Makefile.in 2014-06-13 23:02:37.597115787 +0200 ++++ gdb-7.7.90.20140613/gdb/data-directory/Makefile.in 2014-06-13 23:03:21.285163909 +0200 +@@ -60,6 +60,8 @@ PYTHON_FILES = \ + gdb/frames.py \ + gdb/FrameIterator.py \ + gdb/FrameDecorator.py \ ++ gdb/FrameWrapper.py \ ++ gdb/backtrace.py \ + gdb/types.py \ + gdb/printing.py \ + gdb/prompt.py \ +@@ -74,6 +76,7 @@ PYTHON_FILES = \ + gdb/command/pretty_printers.py \ + gdb/command/prompt.py \ + gdb/command/explore.py \ ++ gdb/command/backtrace.py \ + gdb/function/__init__.py \ + gdb/function/strfns.py \ + gdb/function/caller_is.py \ +Index: gdb-7.7.90.20140613/gdb/python/lib/gdb/FrameWrapper.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.7.90.20140613/gdb/python/lib/gdb/FrameWrapper.py 2014-06-13 23:02:37.598115788 +0200 +@@ -0,0 +1,122 @@ ++# Wrapper API for frames. ++ ++# Copyright (C) 2008, 2009 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 . ++ ++import gdb ++ ++# FIXME: arguably all this should be on Frame somehow. ++class FrameWrapper: ++ def __init__ (self, frame): ++ self.frame = frame; ++ ++ def write_symbol (self, stream, sym, block): ++ if len (sym.linkage_name): ++ nsym, is_field_of_this = gdb.lookup_symbol (sym.linkage_name, block) ++ if nsym.addr_class != gdb.SYMBOL_LOC_REGISTER: ++ sym = nsym ++ ++ stream.write (sym.print_name + "=") ++ try: ++ val = self.read_var (sym) ++ if val != None: ++ val = str (val) ++ # FIXME: would be nice to have a more precise exception here. ++ except RuntimeError, text: ++ val = text ++ if val == None: ++ stream.write ("???") ++ else: ++ stream.write (str (val)) ++ ++ def print_frame_locals (self, stream, func): ++ ++ try: ++ block = self.frame.block() ++ except RuntimeError: ++ block = None ++ ++ while block != None: ++ if block.is_global or block.is_static: ++ break ++ ++ for sym in block: ++ if sym.is_argument: ++ continue; ++ ++ self.write_symbol (stream, sym, block) ++ stream.write ('\n') ++ ++ def print_frame_args (self, stream, func): ++ ++ try: ++ block = self.frame.block() ++ except RuntimeError: ++ block = None ++ ++ while block != None: ++ if block.function != None: ++ break ++ block = block.superblock ++ ++ first = True ++ for sym in block: ++ if not sym.is_argument: ++ continue; ++ ++ if not first: ++ stream.write (", ") ++ ++ self.write_symbol (stream, sym, block) ++ first = False ++ ++ # FIXME: this should probably just be a method on gdb.Frame. ++ # But then we need stream wrappers. ++ def describe (self, stream, full): ++ if self.type () == gdb.DUMMY_FRAME: ++ stream.write (" \n") ++ elif self.type () == gdb.SIGTRAMP_FRAME: ++ stream.write (" \n") ++ else: ++ sal = self.find_sal () ++ pc = self.pc () ++ name = self.name () ++ if not name: ++ name = "??" ++ if pc != sal.pc or not sal.symtab: ++ stream.write (" 0x%08x in" % pc) ++ stream.write (" " + name + " (") ++ ++ func = self.function () ++ self.print_frame_args (stream, func) ++ ++ stream.write (")") ++ ++ if sal.symtab and sal.symtab.filename: ++ stream.write (" at " + sal.symtab.filename) ++ stream.write (":" + str (sal.line)) ++ ++ if not self.name () or (not sal.symtab or not sal.symtab.filename): ++ lib = gdb.solib_name (pc) ++ if lib: ++ stream.write (" from " + lib) ++ ++ stream.write ("\n") ++ ++ if full: ++ self.print_frame_locals (stream, func) ++ ++ def __getattr__ (self, name): ++ return getattr (self.frame, name) +Index: gdb-7.7.90.20140613/gdb/python/lib/gdb/backtrace.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.7.90.20140613/gdb/python/lib/gdb/backtrace.py 2014-06-13 23:02:37.598115788 +0200 +@@ -0,0 +1,42 @@ ++# Filtering backtrace. ++ ++# Copyright (C) 2008, 2011 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 . ++ ++import gdb ++import itertools ++ ++# Our only exports. ++__all__ = ['push_frame_filter', 'create_frame_filter'] ++ ++old_frame_filter = None ++ ++def push_frame_filter (constructor): ++ """Register a new backtrace filter class with the 'backtrace' command. ++The filter will be passed an iterator as an argument. The iterator ++will return gdb.Frame-like objects. The filter should in turn act as ++an iterator returning such objects.""" ++ global old_frame_filter ++ if old_frame_filter == None: ++ old_frame_filter = constructor ++ else: ++ old_frame_filter = lambda iterator, filter = frame_filter: constructor (filter(iterator)) ++ ++def create_frame_filter (iter): ++ global old_frame_filter ++ if old_frame_filter is None: ++ return iter ++ return old_frame_filter (iter) ++ +Index: gdb-7.7.90.20140613/gdb/python/lib/gdb/command/backtrace.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.7.90.20140613/gdb/python/lib/gdb/command/backtrace.py 2014-06-13 23:02:37.598115788 +0200 +@@ -0,0 +1,106 @@ ++# New backtrace command. ++ ++# Copyright (C) 2008, 2009, 2011 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 . ++ ++import gdb ++import gdb.backtrace ++import itertools ++from gdb.FrameIterator import FrameIterator ++from gdb.FrameWrapper import FrameWrapper ++import sys ++ ++class ReverseBacktraceParameter (gdb.Parameter): ++ """The new-backtrace command can show backtraces in 'reverse' order. ++This means that the innermost frame will be printed last. ++Note that reverse backtraces are more expensive to compute.""" ++ ++ set_doc = "Enable or disable reverse backtraces." ++ show_doc = "Show whether backtraces will be printed in reverse order." ++ ++ def __init__(self): ++ gdb.Parameter.__init__ (self, "reverse-backtrace", ++ gdb.COMMAND_STACK, gdb.PARAM_BOOLEAN) ++ # Default to compatibility with gdb. ++ self.value = False ++ ++class FilteringBacktrace (gdb.Command): ++ """Print backtrace of all stack frames, or innermost COUNT frames. ++With a negative argument, print outermost -COUNT frames. ++Use of the 'full' qualifier also prints the values of the local variables. ++Use of the 'raw' qualifier avoids any filtering by loadable modules. ++""" ++ ++ def __init__ (self): ++ # FIXME: this is not working quite well enough to replace ++ # "backtrace" yet. ++ gdb.Command.__init__ (self, "new-backtrace", gdb.COMMAND_STACK) ++ self.reverse = ReverseBacktraceParameter() ++ ++ def reverse_iter (self, iter): ++ result = [] ++ for item in iter: ++ result.append (item) ++ result.reverse() ++ return result ++ ++ def final_n (self, iter, x): ++ result = [] ++ for item in iter: ++ result.append (item) ++ return result[x:] ++ ++ def invoke (self, arg, from_tty): ++ i = 0 ++ count = 0 ++ filter = True ++ full = False ++ ++ for word in arg.split (" "): ++ if word == '': ++ continue ++ elif word == 'raw': ++ filter = False ++ elif word == 'full': ++ full = True ++ else: ++ count = int (word) ++ ++ # FIXME: provide option to start at selected frame ++ # However, should still number as if starting from newest ++ newest_frame = gdb.newest_frame() ++ iter = itertools.imap (FrameWrapper, ++ FrameIterator (newest_frame)) ++ if filter: ++ iter = gdb.backtrace.create_frame_filter (iter) ++ ++ # Now wrap in an iterator that numbers the frames. ++ iter = itertools.izip (itertools.count (0), iter) ++ ++ # Reverse if the user wanted that. ++ if self.reverse.value: ++ iter = self.reverse_iter (iter) ++ ++ # Extract sub-range user wants. ++ if count < 0: ++ iter = self.final_n (iter, count) ++ elif count > 0: ++ iter = itertools.islice (iter, 0, count) ++ ++ for pair in iter: ++ sys.stdout.write ("#%-2d" % pair[0]) ++ pair[1].describe (sys.stdout, full) ++ ++FilteringBacktrace() diff --git a/gdb-fix-s390-build.patch b/gdb-fix-s390-build.patch deleted file mode 100644 index d728870..0000000 --- a/gdb-fix-s390-build.patch +++ /dev/null @@ -1,13 +0,0 @@ -Index: gdb-7.7/gdb/s390-linux-nat.c -=================================================================== ---- gdb-7.7.orig/gdb/s390-linux-nat.c 2014-02-12 16:10:55.000000000 +0100 -+++ gdb-7.7/gdb/s390-linux-nat.c 2014-02-12 16:40:33.000000000 +0100 -@@ -563,7 +563,7 @@ s390_can_use_hw_breakpoint (int type, in - } - - static int --s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, int cnt) -+s390_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST cnt) - { - return 1; - } diff --git a/gdb-fortran-frame-string.patch b/gdb-fortran-frame-string.patch new file mode 100644 index 0000000..3aa581e --- /dev/null +++ b/gdb-fortran-frame-string.patch @@ -0,0 +1,104 @@ +http://sourceware.org/ml/gdb-patches/2014-07/msg00709.html +Subject: [patch] Display Fortran strings in backtraces + + +Hi, + +for Fortran it fixes displaying normal strings also in frames/backtraces: + +(gdb) frame +#0 f (s=..., _s=3) at ./gdb.fortran/fortran-frame-string.f90:24 +-> +#0 f (s='foo', _s=3) at ./gdb.fortran/fortran-frame-string.f90:24 + +The patch is simple and I do not see why it should not be this way. + +For C/C++ TYPE_CODE_STRING is not used. I am not aware of Pascal but that +language is currently not really much supported in GDB anyway. + +This was a part of my archer/jankratochvil/vla branch but it is not a part of +the Intel VLA patchset as it in fact is completely unrelated to "VLA". + +No regressions on {x86_64,x86_64-m32,i686}-fedora22pre-linux-gnu. + + +Thanks, +Jan + + +diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.exp b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp +new file mode 100644 +index 0000000..4b78266 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.exp +@@ -0,0 +1,36 @@ ++# 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 .f90 ++if { [prepare_for_testing ${testfile}.exp ${testfile} ${srcfile} {debug f90}] } { ++ return -1 ++} ++ ++if ![runto MAIN__] then { ++ perror "couldn't run to breakpoint MAIN__" ++ continue ++} ++ ++gdb_breakpoint [gdb_get_line_number "s = s"] ++gdb_continue_to_breakpoint "s = s" ++ ++gdb_test "ptype s" {type = character\*3} ++gdb_test "p s" " = 'foo'" ++ ++# Fix rejected upstream: ++# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html ++setup_kfail "rejected" *-*-* ++gdb_test "frame" { \(s='foo', .*} +diff --git a/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 +new file mode 100644 +index 0000000..3d1576f +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/fortran-frame-string.f90 +@@ -0,0 +1,28 @@ ++! 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++ subroutine f(s) ++ character*3 s ++ s = s ++ end ++ ++ program main ++ call f ('foo') ++ end diff --git a/gdb-glibc-strstr-workaround.patch b/gdb-glibc-strstr-workaround.patch index 2bfbe84..ea0069f 100644 --- a/gdb-glibc-strstr-workaround.patch +++ b/gdb-glibc-strstr-workaround.patch @@ -1,8 +1,8 @@ -Index: gdb-7.6.90.20140127/gdb/dwarf2read.c +Index: gdb-7.7.90.20140613/gdb/dwarf2read.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2read.c 2014-02-06 18:18:09.676572271 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2read.c 2014-02-06 18:18:42.664607823 +0100 -@@ -17646,6 +17646,25 @@ new_symbol_full (struct die_info *die, s +--- gdb-7.7.90.20140613.orig/gdb/dwarf2read.c 2014-06-13 21:56:54.744653443 +0200 ++++ gdb-7.7.90.20140613/gdb/dwarf2read.c 2014-06-13 22:01:51.529990684 +0200 +@@ -17695,6 +17695,26 @@ new_symbol_full (struct die_info *die, s /* Cache this symbol's name and the name's demangled form (if any). */ SYMBOL_SET_LANGUAGE (sym, cu->language, &objfile->objfile_obstack); linkagename = dwarf2_physname (name, die, cu); @@ -14,24 +14,25 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2read.c + && strstr (objfile_name (objfile), "/libc") != NULL) + { + struct objfile *objfile_msym; -+ struct minimal_symbol *msym; ++ struct bound_minimal_symbol bmsym; + + if (objfile->separate_debug_objfile_backlink) + objfile_msym = objfile->separate_debug_objfile_backlink; + else + objfile_msym = objfile; -+ msym = lookup_minimal_symbol ("strstr", NULL, objfile_msym); -+ if (msym && MSYMBOL_TYPE (msym) == mst_text_gnu_ifunc) ++ bmsym = lookup_minimal_symbol ("strstr", NULL, objfile_msym); ++ if (bmsym.minsym != NULL ++ && MSYMBOL_TYPE (bmsym.minsym) == mst_text_gnu_ifunc) + linkagename = "__strstr"; + } + SYMBOL_SET_NAMES (sym, linkagename, strlen (linkagename), 0, objfile); /* Fortran does not have mangling standard and the mangling does differ -Index: gdb-7.6.90.20140127/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp +Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 -+++ gdb-7.6.90.20140127/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2014-02-06 18:18:16.294579381 +0100 ++++ gdb-7.7.90.20140613/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp 2014-06-13 21:59:41.174840871 +0200 @@ -0,0 +1,108 @@ +# Copyright (C) 2012 Free Software Foundation, Inc. + diff --git a/gdb-gnat-dwarf-crash-3of3.patch b/gdb-gnat-dwarf-crash-3of3.patch new file mode 100644 index 0000000..b5f5b28 --- /dev/null +++ b/gdb-gnat-dwarf-crash-3of3.patch @@ -0,0 +1,58 @@ +http://sourceware.org/ml/gdb-patches/2014-02/msg00731.html +Subject: [patch] gdb_assert -> complaint for weird DWARF + + +--6TrnltStXW4iwmi0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +PR 16581: + GDB crash on inherit_abstract_dies infinite recursion + https://sourceware.org/bugzilla/show_bug.cgi?id=16581 + +fixed crash from an infinite recursion. But in rare cases the new code can +now gdb_assert() due to weird DWARF file. + +I do not yet fully understand why the DWARF is as it is but just GDB should +never crash due to invalid DWARF anyway. The "invalid" DWARF I see only in +Fedora GCC build, not in FSF GCC build, more info at: + https://bugzilla.redhat.com/show_bug.cgi?id=1069382 + http://people.redhat.com/jkratoch/gcc-debuginfo-4.8.2-7.fc20.x86_64-gnatbind.debug + + +Thanks, +Jan + +--6TrnltStXW4iwmi0 +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="complaint.patch" + +gdb/ +2014-02-24 Jan Kratochvil + + * dwarf2read.c (process_die): Change gdb_assert to complaint. + +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 3eaa0b1..71f5d34 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -8029,7 +8029,13 @@ process_die (struct die_info *die, struct dwarf2_cu *cu) + struct cleanup *in_process; + + /* We should only be processing those not already in process. */ +- gdb_assert (!die->in_process); ++ if (die->in_process) ++ { ++ complaint (&symfile_complaints, ++ _("DIE at 0x%x attempted to be processed twice"), ++ die->offset.sect_off); ++ return; ++ } + + die->in_process = 1; + in_process = make_cleanup (reset_die_in_process,die); + +--6TrnltStXW4iwmi0-- + diff --git a/gdb-ia64-tdep.patch b/gdb-ia64-tdep.patch deleted file mode 100644 index 4d73da1..0000000 --- a/gdb-ia64-tdep.patch +++ /dev/null @@ -1,39 +0,0 @@ -Index: gdb-7.6.50.20130731-cvs/gdb/ia64-tdep.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/ia64-tdep.c 2013-08-07 15:16:31.000000000 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/ia64-tdep.c 2013-08-07 15:16:34.000000000 +0200 -@@ -2181,7 +2181,7 @@ static const struct frame_unwind ia64_fr - avoid the additional bogus frame - #7 0x0000000000000000 in ?? () */ - --static char linux_clone2_code[] = -+static unsigned char linux_clone2_code[] = - { - /* libc/sysdeps/unix/sysv/linux/ia64/clone2.S */ - 0x09, 0x00, 0x20, 0x12, 0x90, 0x11, 0x00, 0x40, -@@ -2220,7 +2220,7 @@ static int - ia64_linux_clone2_running (struct frame_info *this_frame) - { - CORE_ADDR pc = get_frame_pc (this_frame); -- char buf[LINUX_CLONE_LEN]; -+ unsigned char buf[LINUX_CLONE_LEN]; - struct minimal_symbol *minsym; - long long instr; - -@@ -2256,7 +2256,7 @@ static int - ia64_outermost_frame (struct frame_info *this_frame) - { - CORE_ADDR pc = get_frame_pc (this_frame); -- char *name; -+ const char *name; - - find_pc_partial_function (pc, &name, NULL, NULL); - -@@ -2302,6 +2302,7 @@ ia64_clone2_frame_sniffer (const struct - static const struct frame_unwind ia64_clone2_frame_unwind = - { - NORMAL_FRAME, -+ default_frame_unwind_stop_reason, - &ia64_clone2_frame_this_id, - &ia64_clone2_frame_prev_register, - NULL, diff --git a/gdb-ppc64le.patch b/gdb-ppc64le.patch deleted file mode 100644 index 7b86d38..0000000 --- a/gdb-ppc64le.patch +++ /dev/null @@ -1,1198 +0,0 @@ -Index: gdb-7.7/gdb/auxv.c -=================================================================== ---- gdb-7.7.orig/gdb/auxv.c 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/auxv.c 2014-02-10 18:07:42.000000000 +0100 -@@ -442,6 +442,7 @@ fprint_target_auxv (struct ui_file *file - TAG (AT_IGNOREPPC, _("Entry should be ignored"), dec); - TAG (AT_BASE_PLATFORM, _("String identifying base platform"), str); - TAG (AT_RANDOM, _("Address of 16 random bytes"), hex); -+ TAG (AT_HWCAP2, _("Extension of AT_HWCAP"), hex); - TAG (AT_EXECFN, _("File name of executable"), str); - TAG (AT_SECURE, _("Boolean, was exec setuid-like?"), dec); - TAG (AT_SYSINFO, _("Special system info/entry points"), hex); -Index: gdb-7.7/gdb/gdbarch.c -=================================================================== ---- gdb-7.7.orig/gdb/gdbarch.c 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/gdbarch.c 2014-02-10 18:07:42.000000000 +0100 -@@ -229,6 +229,7 @@ struct gdbarch - gdbarch_return_in_first_hidden_param_p_ftype *return_in_first_hidden_param_p; - gdbarch_skip_prologue_ftype *skip_prologue; - gdbarch_skip_main_prologue_ftype *skip_main_prologue; -+ gdbarch_skip_entrypoint_ftype *skip_entrypoint; - gdbarch_inner_than_ftype *inner_than; - gdbarch_breakpoint_from_pc_ftype *breakpoint_from_pc; - gdbarch_remote_breakpoint_from_pc_ftype *remote_breakpoint_from_pc; -@@ -402,6 +403,7 @@ struct gdbarch startup_gdbarch = - default_return_in_first_hidden_param_p, /* return_in_first_hidden_param_p */ - 0, /* skip_prologue */ - 0, /* skip_main_prologue */ -+ 0, /* skip_entrypoint */ - 0, /* inner_than */ - 0, /* breakpoint_from_pc */ - default_remote_breakpoint_from_pc, /* remote_breakpoint_from_pc */ -@@ -705,6 +707,7 @@ verify_gdbarch (struct gdbarch *gdbarch) - if (gdbarch->skip_prologue == 0) - fprintf_unfiltered (log, "\n\tskip_prologue"); - /* Skip verify of skip_main_prologue, has predicate. */ -+ /* Skip verify of skip_entrypoint, has predicate. */ - if (gdbarch->inner_than == 0) - fprintf_unfiltered (log, "\n\tinner_than"); - if (gdbarch->breakpoint_from_pc == 0) -@@ -1332,6 +1335,12 @@ gdbarch_dump (struct gdbarch *gdbarch, s - "gdbarch_dump: single_step_through_delay = <%s>\n", - host_address_to_string (gdbarch->single_step_through_delay)); - fprintf_unfiltered (file, -+ "gdbarch_dump: gdbarch_skip_entrypoint_p() = %d\n", -+ gdbarch_skip_entrypoint_p (gdbarch)); -+ fprintf_unfiltered (file, -+ "gdbarch_dump: skip_entrypoint = <%s>\n", -+ host_address_to_string (gdbarch->skip_entrypoint)); -+ fprintf_unfiltered (file, - "gdbarch_dump: gdbarch_skip_main_prologue_p() = %d\n", - gdbarch_skip_main_prologue_p (gdbarch)); - fprintf_unfiltered (file, -@@ -2682,6 +2691,30 @@ set_gdbarch_skip_main_prologue (struct g - } - - int -+gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch) -+{ -+ gdb_assert (gdbarch != NULL); -+ return gdbarch->skip_entrypoint != NULL; -+} -+ -+CORE_ADDR -+gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip) -+{ -+ gdb_assert (gdbarch != NULL); -+ gdb_assert (gdbarch->skip_entrypoint != NULL); -+ if (gdbarch_debug >= 2) -+ fprintf_unfiltered (gdb_stdlog, "gdbarch_skip_entrypoint called\n"); -+ return gdbarch->skip_entrypoint (gdbarch, ip); -+} -+ -+void -+set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, -+ gdbarch_skip_entrypoint_ftype skip_entrypoint) -+{ -+ gdbarch->skip_entrypoint = skip_entrypoint; -+} -+ -+int - gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs) - { - gdb_assert (gdbarch != NULL); -Index: gdb-7.7/gdb/gdbarch.h -=================================================================== ---- gdb-7.7.orig/gdb/gdbarch.h 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/gdbarch.h 2014-02-10 18:07:42.000000000 +0100 -@@ -486,6 +486,12 @@ typedef CORE_ADDR (gdbarch_skip_main_pro - extern CORE_ADDR gdbarch_skip_main_prologue (struct gdbarch *gdbarch, CORE_ADDR ip); - extern void set_gdbarch_skip_main_prologue (struct gdbarch *gdbarch, gdbarch_skip_main_prologue_ftype *skip_main_prologue); - -+extern int gdbarch_skip_entrypoint_p (struct gdbarch *gdbarch); -+ -+typedef CORE_ADDR (gdbarch_skip_entrypoint_ftype) (struct gdbarch *gdbarch, CORE_ADDR ip); -+extern CORE_ADDR gdbarch_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR ip); -+extern void set_gdbarch_skip_entrypoint (struct gdbarch *gdbarch, gdbarch_skip_entrypoint_ftype *skip_entrypoint); -+ - typedef int (gdbarch_inner_than_ftype) (CORE_ADDR lhs, CORE_ADDR rhs); - extern int gdbarch_inner_than (struct gdbarch *gdbarch, CORE_ADDR lhs, CORE_ADDR rhs); - extern void set_gdbarch_inner_than (struct gdbarch *gdbarch, gdbarch_inner_than_ftype *inner_than); -Index: gdb-7.7/gdb/gdbarch.sh -=================================================================== ---- gdb-7.7.orig/gdb/gdbarch.sh 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/gdbarch.sh 2014-02-10 18:07:42.000000000 +0100 -@@ -530,6 +530,7 @@ m:int:return_in_first_hidden_param_p:str - - m:CORE_ADDR:skip_prologue:CORE_ADDR ip:ip:0:0 - M:CORE_ADDR:skip_main_prologue:CORE_ADDR ip:ip -+M:CORE_ADDR:skip_entrypoint:CORE_ADDR ip:ip - f:int:inner_than:CORE_ADDR lhs, CORE_ADDR rhs:lhs, rhs:0:0 - m:const gdb_byte *:breakpoint_from_pc:CORE_ADDR *pcptr, int *lenptr:pcptr, lenptr::0: - # Return the adjusted address and kind to use for Z0/Z1 packets. -Index: gdb-7.7/gdb/infrun.c -=================================================================== ---- gdb-7.7.orig/gdb/infrun.c 2014-02-10 18:07:40.000000000 +0100 -+++ gdb-7.7/gdb/infrun.c 2014-02-10 18:07:42.000000000 +0100 -@@ -3170,6 +3170,10 @@ fill_in_stop_func (struct gdbarch *gdbar - ecs->stop_func_start - += gdbarch_deprecated_function_start_offset (gdbarch); - -+ if (gdbarch_skip_entrypoint_p (gdbarch)) -+ ecs->stop_func_start = gdbarch_skip_entrypoint (gdbarch, -+ ecs->stop_func_start); -+ - ecs->stop_func_filled_in = 1; - } - } -Index: gdb-7.7/gdb/ppc-linux-tdep.c -=================================================================== ---- gdb-7.7.orig/gdb/ppc-linux-tdep.c 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/ppc-linux-tdep.c 2014-02-10 18:07:42.000000000 +0100 -@@ -44,6 +44,7 @@ - #include "observer.h" - #include "auxv.h" - #include "elf/common.h" -+#include "elf/ppc64.h" - #include "exceptions.h" - #include "arch-utils.h" - #include "spu-tdep.h" -@@ -876,6 +877,43 @@ ppc_linux_core_read_description (struct - } - } - -+/* If the ELF symbol has a local entry point, use it as SYMBOL_VALUE_ADDRESS -+ for the msymbol. This matches the DWARF function start if present. */ -+ -+static void -+ppc_elfv2_elf_make_msymbol_special (asymbol *sym, struct minimal_symbol *msym) -+{ -+ elf_symbol_type *elf_sym = (elf_symbol_type *)sym; -+ switch (PPC64_LOCAL_ENTRY_OFFSET (elf_sym->internal_elf_sym.st_other)) -+ { -+ default: -+ break; -+ case 8: -+ MSYMBOL_TARGET_FLAG_1 (msym) = 1; -+ break; -+ } -+} -+ -+static CORE_ADDR -+ppc_elfv2_skip_entrypoint (struct gdbarch *gdbarch, CORE_ADDR pc) -+{ -+ struct bound_minimal_symbol fun; -+ int local_entry_offset = 0; -+ -+ fun = lookup_minimal_symbol_by_pc (pc); -+ if (fun.minsym == NULL) -+ return pc; -+ -+ if (MSYMBOL_TARGET_FLAG_1 (fun.minsym)) -+ local_entry_offset = 8; -+ -+ if (SYMBOL_VALUE_ADDRESS (fun.minsym) <= pc -+ && pc < SYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset) -+ return SYMBOL_VALUE_ADDRESS (fun.minsym) + local_entry_offset; -+ -+ return pc; -+} -+ - /* Implementation of `gdbarch_stap_is_single_operand', as defined in - gdbarch.h. */ - -@@ -1339,13 +1377,23 @@ ppc_linux_init_abi (struct gdbarch_info - - if (tdep->wordsize == 8) - { -- /* Handle PPC GNU/Linux 64-bit function pointers (which are really -- function descriptors). */ -- set_gdbarch_convert_from_func_ptr_addr -- (gdbarch, ppc64_convert_from_func_ptr_addr); -+ if (tdep->elf_abi == POWERPC_ELF_V1) -+ { -+ /* Handle PPC GNU/Linux 64-bit function pointers (which are really -+ function descriptors). */ -+ set_gdbarch_convert_from_func_ptr_addr -+ (gdbarch, ppc64_convert_from_func_ptr_addr); - -- set_gdbarch_elf_make_msymbol_special (gdbarch, -- ppc64_elf_make_msymbol_special); -+ set_gdbarch_elf_make_msymbol_special -+ (gdbarch, ppc64_elf_make_msymbol_special); -+ } -+ else -+ { -+ set_gdbarch_elf_make_msymbol_special -+ (gdbarch, ppc_elfv2_elf_make_msymbol_special); -+ -+ set_gdbarch_skip_entrypoint (gdbarch, ppc_elfv2_skip_entrypoint); -+ } - - /* Shared library handling. */ - set_gdbarch_skip_trampoline_code (gdbarch, ppc64_skip_trampoline_code); -Index: gdb-7.7/gdb/ppc-sysv-tdep.c -=================================================================== ---- gdb-7.7.orig/gdb/ppc-sysv-tdep.c 2014-02-10 18:07:42.000000000 +0100 -+++ gdb-7.7/gdb/ppc-sysv-tdep.c 2014-02-10 18:07:42.000000000 +0100 -@@ -610,42 +610,48 @@ ppc_sysv_abi_push_dummy_call (struct gdb - } - - /* Handle the return-value conventions for Decimal Floating Point values -- in both ppc32 and ppc64, which are the same. */ --static int -+ in both ppc32 and ppc64, which are the same. INDEX specifies which -+ part of a multi-part return value is to be handled. */ -+static void - get_decimal_float_return_value (struct gdbarch *gdbarch, struct type *valtype, - struct regcache *regcache, gdb_byte *readbuf, -- const gdb_byte *writebuf) -+ const gdb_byte *writebuf, int index) - { - struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); -+ int offset = index * TYPE_LENGTH (valtype); - - gdb_assert (TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT); - - /* 32-bit and 64-bit decimal floats in f1. */ - if (TYPE_LENGTH (valtype) <= 8) - { -+ int regnum = tdep->ppc_fp0_regnum + 1 + index; -+ - if (writebuf != NULL) - { - gdb_byte regval[MAX_REGISTER_SIZE]; - const gdb_byte *p; - - /* 32-bit decimal float is right aligned in the doubleword. */ -- if (TYPE_LENGTH (valtype) == 4) -+ if (TYPE_LENGTH (valtype) == 4 -+ && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) - { -- memcpy (regval + 4, writebuf, 4); -+ memcpy (regval + 4, writebuf + offset, 4); - p = regval; - } - else -- p = writebuf; -+ p = writebuf + offset; - -- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 1, p); -+ regcache_cooked_write (regcache, regnum, p); - } - if (readbuf != NULL) - { -- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 1, readbuf); -+ regcache_cooked_read (regcache, regnum, readbuf); - - /* Left align 32-bit decimal float. */ -- if (TYPE_LENGTH (valtype) == 4) -- memcpy (readbuf, readbuf + 4, 4); -+ if (TYPE_LENGTH (valtype) == 4 -+ && gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) -+ memcpy (readbuf + offset, readbuf + offset + 4, 4); - } - } - /* 128-bit decimal floats in f2,f3. */ -@@ -653,24 +659,27 @@ get_decimal_float_return_value (struct g - { - if (writebuf != NULL || readbuf != NULL) - { -- int i; -+ int i, regnum; - - for (i = 0; i < 2; i++) - { -+ if (gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG) -+ regnum = tdep->ppc_fp0_regnum + 2 + i + 2 * index; -+ else -+ regnum = tdep->ppc_fp0_regnum + 3 - i + 2 * index; -+ - if (writebuf != NULL) -- regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + 2 + i, -- writebuf + i * 8); -+ regcache_cooked_write (regcache, regnum, -+ writebuf + offset + i * 8); - if (readbuf != NULL) -- regcache_cooked_read (regcache, tdep->ppc_fp0_regnum + 2 + i, -- readbuf + i * 8); -+ regcache_cooked_read (regcache, regnum, -+ readbuf + offset + i * 8); - } - } - } - else - /* Can't happen. */ - internal_error (__FILE__, __LINE__, _("Unknown decimal float size.")); -- -- return RETURN_VALUE_REGISTER_CONVENTION; - } - - /* Handle the return-value conventions specified by the SysV 32-bit -@@ -802,8 +811,11 @@ do_ppc_sysv_return_value (struct gdbarch - return RETURN_VALUE_REGISTER_CONVENTION; - } - if (TYPE_CODE (type) == TYPE_CODE_DECFLOAT && !tdep->soft_float) -- return get_decimal_float_return_value (gdbarch, type, regcache, readbuf, -- writebuf); -+ { -+ get_decimal_float_return_value (gdbarch, type, regcache, -+ readbuf, writebuf, 0); -+ return RETURN_VALUE_REGISTER_CONVENTION; -+ } - else if ((TYPE_CODE (type) == TYPE_CODE_INT - || TYPE_CODE (type) == TYPE_CODE_CHAR - || TYPE_CODE (type) == TYPE_CODE_BOOL -@@ -1102,6 +1114,156 @@ convert_code_addr_to_desc_addr (CORE_ADD - return 1; - } - -+/* Walk down the type tree of TYPE counting consecutive base elements. -+ If *FIELD_TYPE is NULL, then set it to the first valid floating point -+ or vector type. If a non-floating point or vector type is found, or -+ if a floating point or vector type that doesn't match a non-NULL -+ *FIELD_TYPE is found, then return -1, otherwise return the count in the -+ sub-tree. */ -+ -+static LONGEST -+ppc64_aggregate_candidate (struct type *type, -+ struct type **field_type) -+{ -+ type = check_typedef (type); -+ -+ switch (TYPE_CODE (type)) -+ { -+ case TYPE_CODE_FLT: -+ case TYPE_CODE_DECFLOAT: -+ if (!*field_type) -+ *field_type = type; -+ if (TYPE_CODE (*field_type) == TYPE_CODE (type) -+ && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) -+ return 1; -+ break; -+ -+ case TYPE_CODE_COMPLEX: -+ type = TYPE_TARGET_TYPE (type); -+ if (TYPE_CODE (type) == TYPE_CODE_FLT -+ || TYPE_CODE (type) == TYPE_CODE_DECFLOAT) -+ { -+ if (!*field_type) -+ *field_type = type; -+ if (TYPE_CODE (*field_type) == TYPE_CODE (type) -+ && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) -+ return 2; -+ } -+ break; -+ -+ case TYPE_CODE_ARRAY: -+ if (TYPE_VECTOR (type)) -+ { -+ if (!*field_type) -+ *field_type = type; -+ if (TYPE_CODE (*field_type) == TYPE_CODE (type) -+ && TYPE_LENGTH (*field_type) == TYPE_LENGTH (type)) -+ return 1; -+ } -+ else -+ { -+ LONGEST count, low_bound, high_bound; -+ -+ count = ppc64_aggregate_candidate -+ (TYPE_TARGET_TYPE (type), field_type); -+ if (count == -1) -+ return -1; -+ -+ if (!get_array_bounds (type, &low_bound, &high_bound)) -+ return -1; -+ count *= high_bound - low_bound; -+ -+ /* There must be no padding. */ -+ if (count == 0) -+ return TYPE_LENGTH (type) == 0 ? 0 : -1; -+ else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type)) -+ return -1; -+ -+ return count; -+ } -+ break; -+ -+ case TYPE_CODE_STRUCT: -+ case TYPE_CODE_UNION: -+ { -+ LONGEST count = 0; -+ int i; -+ -+ for (i = 0; i < TYPE_NFIELDS (type); i++) -+ { -+ LONGEST sub_count; -+ -+ if (field_is_static (&TYPE_FIELD (type, i))) -+ continue; -+ -+ sub_count = ppc64_aggregate_candidate -+ (TYPE_FIELD_TYPE (type, i), field_type); -+ if (sub_count == -1) -+ return -1; -+ -+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT) -+ count += sub_count; -+ else -+ count = max (count, sub_count); -+ } -+ -+ /* There must be no padding. */ -+ if (count == 0) -+ return TYPE_LENGTH (type) == 0 ? 0 : -1; -+ else if (TYPE_LENGTH (type) != count * TYPE_LENGTH (*field_type)) -+ return -1; -+ -+ return count; -+ } -+ break; -+ -+ default: -+ break; -+ } -+ -+ return -1; -+} -+ -+/* If an argument of type TYPE is a homogeneous float or vector aggregate -+ that shall be passed in FP/vector registers according to the ELFv2 ABI, -+ return the homogeneous element type in *ELT_TYPE and the number of -+ elements in *N_ELTS, and return non-zero. Otherwise, return zero. */ -+ -+static int -+ppc64_elfv2_abi_homogeneous_aggregate (struct type *type, -+ struct type **elt_type, int *n_elts) -+{ -+ /* Complex types at the top level are treated separately. However, -+ complex types can be elements of homogeneous aggregates. */ -+ if (TYPE_CODE (type) == TYPE_CODE_STRUCT -+ || TYPE_CODE (type) == TYPE_CODE_UNION -+ || (TYPE_CODE (type) == TYPE_CODE_ARRAY && !TYPE_VECTOR (type))) -+ { -+ struct type *field_type = NULL; -+ LONGEST field_count = ppc64_aggregate_candidate (type, &field_type); -+ -+ if (field_count > 0) -+ { -+ int n_regs = ((TYPE_CODE (field_type) == TYPE_CODE_FLT -+ || TYPE_CODE (field_type) == TYPE_CODE_DECFLOAT)? -+ (TYPE_LENGTH (field_type) + 7) >> 3 : 1); -+ -+ /* The ELFv2 ABI allows homogeneous aggregates to occupy -+ up to 8 registers. */ -+ if (field_count * n_regs <= 8) -+ { -+ if (elt_type) -+ *elt_type = field_type; -+ if (n_elts) -+ *n_elts = (int) field_count; -+ return 1; -+ } -+ } -+ } -+ -+ return 0; -+} -+ - /* Push a float in either registers, or in the stack. Using the ppc 64 bit - SysV ABI. - -@@ -1143,6 +1305,8 @@ ppc64_sysv_abi_push_float (struct gdbarc - - /* Write value in the stack's parameter save area. */ - write_memory (gparam, p, 8); -+ if (greg <= 10) -+ regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + greg, p); - - /* Floats and Doubles go in f1 .. f13. They also consume a left aligned - GREG, and can end up in memory. */ -@@ -1154,8 +1318,6 @@ ppc64_sysv_abi_push_float (struct gdbarc - convert_typed_floating (val, type, regval, regtype); - regcache_cooked_write (regcache, tdep->ppc_fp0_regnum + freg, regval); - } -- if (greg <= 10) -- regcache_cooked_write (regcache, tdep->ppc_gp0_regnum + greg, regval); - } - else - { -@@ -1268,9 +1430,13 @@ ppc64_sysv_abi_push_dummy_call (struct g - to their corresponding regions. */ - refparam = align_down (sp - refparam_size, 16); - gparam = align_down (refparam - gparam_size, 16); -- /* Add in space for the TOC, link editor double word, -- compiler double word, LR save area, CR save area. */ -- sp = align_down (gparam - 48, 16); -+ /* Add in space for the TOC, link editor double word (v1 only), -+ compiler double word (v1 only), LR save area, CR save area, -+ and backchain. */ -+ if (tdep->elf_abi == POWERPC_ELF_V1) -+ sp = align_down (gparam - 48, 16); -+ else -+ sp = align_down (gparam - 32, 16); - } - - /* If the function is returning a `struct', then there is an -@@ -1375,7 +1541,8 @@ ppc64_sysv_abi_push_dummy_call (struct g - - /* 32-bit decimal floats are right aligned in the - doubleword. */ -- if (TYPE_LENGTH (type) == 4) -+ if (TYPE_LENGTH (type) == 4 -+ && byte_order == BFD_ENDIAN_BIG) - { - memcpy (regval + 4, val, 4); - p = regval; -@@ -1407,10 +1574,21 @@ ppc64_sysv_abi_push_dummy_call (struct g - { - /* Make sure freg is even. */ - freg += freg & 1; -- regcache_cooked_write (regcache, -- tdep->ppc_fp0_regnum + freg, val); -- regcache_cooked_write (regcache, -- tdep->ppc_fp0_regnum + freg + 1, val + 8); -+ -+ if (byte_order == BFD_ENDIAN_BIG) -+ { -+ regcache_cooked_write (regcache, -+ tdep->ppc_fp0_regnum + freg, val); -+ regcache_cooked_write (regcache, -+ tdep->ppc_fp0_regnum + freg + 1, val + 8); -+ } -+ else -+ { -+ regcache_cooked_write (regcache, -+ tdep->ppc_fp0_regnum + freg + 1, val); -+ regcache_cooked_write (regcache, -+ tdep->ppc_fp0_regnum + freg, val + 8); -+ } - } - - write_memory (gparam, val, TYPE_LENGTH (type)); -@@ -1587,8 +1765,9 @@ ppc64_sysv_abi_push_dummy_call (struct g - ULONGEST word = unpack_long (type, val); - /* Convert any function code addresses into - descriptors. */ -- if (TYPE_CODE (type) == TYPE_CODE_PTR -- || TYPE_CODE (type) == TYPE_CODE_REF) -+ if (tdep->elf_abi == POWERPC_ELF_V1 -+ && (TYPE_CODE (type) == TYPE_CODE_PTR -+ || TYPE_CODE (type) == TYPE_CODE_REF)) - { - struct type *target_type; - target_type = check_typedef (TYPE_TARGET_TYPE (type)); -@@ -1613,6 +1792,9 @@ ppc64_sysv_abi_push_dummy_call (struct g - } - else - { -+ struct type *elt_type; -+ int n_elts; -+ - ssize_t byte; - for (byte = 0; byte < TYPE_LENGTH (type); - byte += tdep->wordsize) -@@ -1630,7 +1812,7 @@ ppc64_sysv_abi_push_dummy_call (struct g - versions before 3.4 implemented this - incorrectly; see - . */ -- if (byte == 0) -+ if (byte_order == BFD_ENDIAN_BIG && byte == 0) - memcpy (regval + tdep->wordsize - len, - val + byte, len); - else -@@ -1649,7 +1831,7 @@ ppc64_sysv_abi_push_dummy_call (struct g - value to memory. Fortunately, doing this - simplifies the code. */ - ssize_t len = TYPE_LENGTH (type); -- if (len < tdep->wordsize) -+ if (byte_order == BFD_ENDIAN_BIG && len < tdep->wordsize) - write_memory (gparam + tdep->wordsize - len, val, len); - else - write_memory (gparam, val, len); -@@ -1705,6 +1887,132 @@ ppc64_sysv_abi_push_dummy_call (struct g - } - } - } -+ /* In the ELFv2 ABI, homogeneous floating-point or vector -+ aggregates are passed in registers. */ -+ if (tdep->elf_abi == POWERPC_ELF_V2 -+ && ppc64_elfv2_abi_homogeneous_aggregate (type, -+ &elt_type, &n_elts)) -+ { -+ int i; -+ for (i = 0; i < n_elts; i++) -+ { -+ const gdb_byte *elt_val -+ = val + i * TYPE_LENGTH (elt_type); -+ -+ switch (TYPE_CODE (elt_type)) -+ { -+ case TYPE_CODE_FLT: -+ if (TYPE_LENGTH (elt_type) <= 8) -+ { -+ if (write_pass && freg <= 13) -+ { -+ int fregnum = tdep->ppc_fp0_regnum + freg; -+ gdb_byte regval[MAX_REGISTER_SIZE]; -+ struct type *regtype -+ = register_type (gdbarch, fregnum); -+ convert_typed_floating (elt_val, elt_type, -+ regval, regtype); -+ regcache_cooked_write (regcache, -+ fregnum, regval); -+ } -+ freg++; -+ } -+ else if (TYPE_LENGTH (elt_type) == 16 -+ && (gdbarch_long_double_format (gdbarch) -+ == floatformats_ibm_long_double)) -+ { -+ if (write_pass && freg <= 13) -+ { -+ int fregnum = tdep->ppc_fp0_regnum + freg; -+ regcache_cooked_write (regcache, -+ fregnum, elt_val); -+ if (freg <= 12) -+ regcache_cooked_write (regcache, -+ fregnum + 1, -+ elt_val + 8); -+ } -+ freg += 2; -+ } -+ break; -+ -+ case TYPE_CODE_DECFLOAT: -+ if (TYPE_LENGTH (elt_type) <= 8) -+ { -+ if (write_pass && freg <= 13) -+ { -+ int fregnum = tdep->ppc_fp0_regnum + freg; -+ gdb_byte regval[MAX_REGISTER_SIZE]; -+ const gdb_byte *p; -+ -+ /* 32-bit decimal floats are right aligned -+ in the doubleword. */ -+ if (TYPE_LENGTH (elt_type) == 4 -+ && byte_order == BFD_ENDIAN_BIG) -+ { -+ memcpy (regval + 4, elt_val, 4); -+ p = regval; -+ } -+ else -+ p = elt_val; -+ -+ regcache_cooked_write (regcache, fregnum, p); -+ } -+ freg++; -+ } -+ else if (TYPE_LENGTH (elt_type) == 16) -+ { -+ /* Make sure freg is even. */ -+ freg += freg & 1; -+ -+ if (write_pass && freg <= 12) -+ { -+ int fregnum = tdep->ppc_fp0_regnum + freg; -+ if (byte_order == BFD_ENDIAN_BIG) -+ { -+ regcache_cooked_write (regcache, -+ fregnum, -+ elt_val); -+ regcache_cooked_write (regcache, -+ fregnum + 1, -+ elt_val + 8); -+ } -+ else -+ { -+ regcache_cooked_write (regcache, -+ fregnum + 1, -+ elt_val); -+ regcache_cooked_write (regcache, -+ fregnum, -+ elt_val + 8); -+ } -+ } -+ freg += 2; -+ } -+ break; -+ -+ case TYPE_CODE_ARRAY: -+ gdb_assert (TYPE_VECTOR (type)); -+ -+ if (tdep->vector_abi == POWERPC_VEC_ALTIVEC -+ && TYPE_LENGTH (elt_type) == 16) -+ { -+ if (write_pass && vreg <= 13) -+ { -+ int vregnum = tdep->ppc_vr0_regnum + vreg; -+ regcache_cooked_write (regcache, -+ vregnum, elt_val); -+ } -+ vreg++; -+ } -+ break; -+ -+ default: -+ internal_error (__FILE__, __LINE__, -+ _("Unknown element type.")); -+ break; -+ } -+ } -+ } - /* Always consume parameter stack space. */ - gparam = align_up (gparam + TYPE_LENGTH (type), tdep->wordsize); - } -@@ -1733,24 +2041,31 @@ ppc64_sysv_abi_push_dummy_call (struct g - breakpoint. */ - regcache_cooked_write_signed (regcache, tdep->ppc_lr_regnum, bp_addr); - -- /* Use the func_addr to find the descriptor, and use that to find -- the TOC. If we're calling via a function pointer, the pointer -- itself identifies the descriptor. */ -- { -- struct type *ftype = check_typedef (value_type (function)); -- CORE_ADDR desc_addr = value_as_address (function); -- -- if (TYPE_CODE (ftype) == TYPE_CODE_PTR -- || convert_code_addr_to_desc_addr (func_addr, &desc_addr)) -- { -- /* The TOC is the second double word in the descriptor. */ -- CORE_ADDR toc = -- read_memory_unsigned_integer (desc_addr + tdep->wordsize, -- tdep->wordsize, byte_order); -- regcache_cooked_write_unsigned (regcache, -- tdep->ppc_gp0_regnum + 2, toc); -- } -- } -+ /* In the ELFv1 ABI, use the func_addr to find the descriptor, and use -+ that to find the TOC. If we're calling via a function pointer, -+ the pointer itself identifies the descriptor. */ -+ if (tdep->elf_abi == POWERPC_ELF_V1) -+ { -+ struct type *ftype = check_typedef (value_type (function)); -+ CORE_ADDR desc_addr = value_as_address (function); -+ -+ if (TYPE_CODE (ftype) == TYPE_CODE_PTR -+ || convert_code_addr_to_desc_addr (func_addr, &desc_addr)) -+ { -+ /* The TOC is the second double word in the descriptor. */ -+ CORE_ADDR toc = -+ read_memory_unsigned_integer (desc_addr + tdep->wordsize, -+ tdep->wordsize, byte_order); -+ regcache_cooked_write_unsigned (regcache, -+ tdep->ppc_gp0_regnum + 2, toc); -+ } -+ } -+ -+ /* In the ELFv2 ABI, we need to pass the target address in r12 since -+ we may be calling a global entry point. */ -+ if (tdep->elf_abi == POWERPC_ELF_V2) -+ regcache_cooked_write_unsigned (regcache, -+ tdep->ppc_gp0_regnum + 12, func_addr); - - return sp; - } -@@ -1775,6 +2090,8 @@ ppc64_sysv_abi_return_value (struct gdba - enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); - struct type *func_type = function ? value_type (function) : NULL; - int opencl_abi = func_type? ppc_sysv_use_opencl_abi (func_type) : 0; -+ struct type *elt_type; -+ int n_elts; - - /* This function exists to support a calling convention that - requires floating-point registers. It shouldn't be used on -@@ -1799,8 +2116,11 @@ ppc64_sysv_abi_return_value (struct gdba - return RETURN_VALUE_REGISTER_CONVENTION; - } - if (TYPE_CODE (valtype) == TYPE_CODE_DECFLOAT) -- return get_decimal_float_return_value (gdbarch, valtype, regcache, readbuf, -- writebuf); -+ { -+ get_decimal_float_return_value (gdbarch, valtype, regcache, -+ readbuf, writebuf, 0); -+ return RETURN_VALUE_REGISTER_CONVENTION; -+ } - /* Integers in r3. */ - if ((TYPE_CODE (valtype) == TYPE_CODE_INT - || TYPE_CODE (valtype) == TYPE_CODE_ENUM -@@ -2019,6 +2339,114 @@ ppc64_sysv_abi_return_value (struct gdba - } - } - return RETURN_VALUE_REGISTER_CONVENTION; -+ } -+ /* In the ELFv2 ABI, homogeneous floating-point or vector -+ aggregates are returned in registers. */ -+ if (tdep->elf_abi == POWERPC_ELF_V2 -+ && ppc64_elfv2_abi_homogeneous_aggregate (valtype, &elt_type, &n_elts)) -+ { -+ int i; -+ for (i = 0; i < n_elts; i++) -+ { -+ int offset = i * TYPE_LENGTH (elt_type); -+ -+ switch (TYPE_CODE (elt_type)) -+ { -+ case TYPE_CODE_FLT: -+ if (TYPE_LENGTH (elt_type) <= 8) -+ { -+ int regnum = tdep->ppc_fp0_regnum + 1 + i; -+ gdb_byte regval[MAX_REGISTER_SIZE]; -+ struct type *regtype = register_type (gdbarch, regnum); -+ if (writebuf != NULL) -+ { -+ convert_typed_floating (writebuf + offset, elt_type, -+ regval, regtype); -+ regcache_cooked_write (regcache, regnum, regval); -+ } -+ if (readbuf != NULL) -+ { -+ regcache_cooked_read (regcache, regnum, regval); -+ convert_typed_floating (regval, regtype, -+ readbuf + offset, elt_type); -+ } -+ } -+ else -+ { -+ int j, nregs = (TYPE_LENGTH (elt_type) + 7) / 8; -+ for (j = 0; j < nregs; j++) -+ { -+ int regnum = tdep->ppc_fp0_regnum + 1 + nregs * i + j; -+ -+ if (writebuf != NULL) -+ regcache_cooked_write (regcache, regnum, -+ writebuf + offset + j * 8); -+ if (readbuf != NULL) -+ regcache_cooked_read (regcache, regnum, -+ readbuf + offset + j * 8); -+ } -+ } -+ break; -+ -+ case TYPE_CODE_DECFLOAT: -+ get_decimal_float_return_value (gdbarch, elt_type, regcache, -+ readbuf, writebuf, i); -+ break; -+ -+ case TYPE_CODE_ARRAY: -+ { -+ int regnum = tdep->ppc_vr0_regnum + 2 + i; -+ gdb_assert (TYPE_VECTOR (elt_type)); -+ -+ if (writebuf != NULL) -+ regcache_cooked_write (regcache, regnum, writebuf + offset); -+ if (readbuf != NULL) -+ regcache_cooked_read (regcache, regnum, readbuf + offset); -+ } -+ break; -+ } -+ } -+ return RETURN_VALUE_REGISTER_CONVENTION; -+ } -+ /* In the ELFv2 ABI, aggregate types of up to 16 bytes are -+ returned in registers r3:r4. */ -+ if (tdep->elf_abi == POWERPC_ELF_V2 -+ && TYPE_LENGTH (valtype) <= 16 -+ && (TYPE_CODE (valtype) == TYPE_CODE_STRUCT -+ || TYPE_CODE (valtype) == TYPE_CODE_UNION -+ || (TYPE_CODE (valtype) == TYPE_CODE_ARRAY && !TYPE_VECTOR (valtype)))) -+ { -+ int n_regs = (TYPE_LENGTH (valtype) + tdep->wordsize - 1) / tdep->wordsize; -+ int i; -+ -+ for (i = 0; i < n_regs; i++) -+ { -+ gdb_byte regval[MAX_REGISTER_SIZE]; -+ int regnum = tdep->ppc_gp0_regnum + 3 + i; -+ int offset = i * tdep->wordsize; -+ int len = TYPE_LENGTH (valtype) - offset; -+ if (len > tdep->wordsize) -+ len = tdep->wordsize; -+ -+ if (writebuf != NULL) -+ { -+ memset (regval, 0, sizeof regval); -+ if (byte_order == BFD_ENDIAN_BIG && offset == 0) -+ memcpy (regval + tdep->wordsize - len, writebuf, len); -+ else -+ memcpy (regval, writebuf + offset, len); -+ regcache_cooked_write (regcache, regnum, regval); -+ } -+ if (readbuf != NULL) -+ { -+ regcache_cooked_read (regcache, regnum, regval); -+ if (byte_order == BFD_ENDIAN_BIG && offset == 0) -+ memcpy (readbuf, regval + tdep->wordsize - len, len); -+ else -+ memcpy (readbuf + offset, regval, len); -+ } -+ } -+ return RETURN_VALUE_REGISTER_CONVENTION; - } - return RETURN_VALUE_STRUCT_CONVENTION; - } -Index: gdb-7.7/gdb/ppc-tdep.h -=================================================================== ---- gdb-7.7.orig/gdb/ppc-tdep.h 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/ppc-tdep.h 2014-02-10 18:07:42.000000000 +0100 -@@ -182,6 +182,15 @@ extern void ppc_collect_vsxregset (const - - /* Private data that this module attaches to struct gdbarch. */ - -+/* ELF ABI version used by the inferior. */ -+enum powerpc_elf_abi -+{ -+ POWERPC_ELF_AUTO, -+ POWERPC_ELF_V1, -+ POWERPC_ELF_V2, -+ POWERPC_ELF_LAST -+}; -+ - /* Vector ABI used by the inferior. */ - enum powerpc_vector_abi - { -@@ -197,6 +206,8 @@ struct gdbarch_tdep - int wordsize; /* Size in bytes of fixed-point word. */ - int soft_float; /* Avoid FP registers for arguments? */ - -+ enum powerpc_elf_abi elf_abi; /* ELF ABI version. */ -+ - /* How to pass vector arguments. Never set to AUTO or LAST. */ - enum powerpc_vector_abi vector_abi; - -Index: gdb-7.7/gdb/rs6000-tdep.c -=================================================================== ---- gdb-7.7.orig/gdb/rs6000-tdep.c 2014-02-10 18:07:39.000000000 +0100 -+++ gdb-7.7/gdb/rs6000-tdep.c 2014-02-10 18:07:42.000000000 +0100 -@@ -48,6 +48,7 @@ - - #include "elf-bfd.h" - #include "elf/ppc.h" -+#include "elf/ppc64.h" - - #include "solib-svr4.h" - #include "ppc-tdep.h" -@@ -2723,10 +2724,10 @@ dfp_pseudo_register_read (struct gdbarch - else - { - status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum + -- 2 * reg_index + 1, buffer + 8); -+ 2 * reg_index + 1, buffer); - if (status == REG_VALID) - status = regcache_raw_read (regcache, tdep->ppc_fp0_regnum + -- 2 * reg_index, buffer); -+ 2 * reg_index, buffer + 8); - } - - return status; -@@ -2752,9 +2753,9 @@ dfp_pseudo_register_write (struct gdbarc - else - { - regcache_raw_write (regcache, tdep->ppc_fp0_regnum + -- 2 * reg_index + 1, buffer + 8); -+ 2 * reg_index + 1, buffer); - regcache_raw_write (regcache, tdep->ppc_fp0_regnum + -- 2 * reg_index, buffer); -+ 2 * reg_index, buffer + 8); - } - } - -@@ -2832,7 +2833,8 @@ efpr_pseudo_register_read (struct gdbarc - int reg_index = reg_nr - tdep->ppc_efpr0_regnum; - - /* Read the portion that overlaps the VMX register. */ -- return regcache_raw_read_part (regcache, tdep->ppc_vr0_regnum + reg_index, 0, -+ int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; -+ return regcache_raw_read_part (regcache, tdep->ppc_vr0_regnum + reg_index, offset, - register_size (gdbarch, reg_nr), buffer); - } - -@@ -2845,7 +2847,8 @@ efpr_pseudo_register_write (struct gdbar - int reg_index = reg_nr - tdep->ppc_efpr0_regnum; - - /* Write the portion that overlaps the VMX register. */ -- regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index, 0, -+ int offset = gdbarch_byte_order (gdbarch) == BFD_ENDIAN_BIG ? 0 : 8; -+ regcache_raw_write_part (regcache, tdep->ppc_vr0_regnum + reg_index, offset, - register_size (gdbarch, reg_nr), buffer); - } - -@@ -3601,6 +3604,7 @@ rs6000_gdbarch_init (struct gdbarch_info - enum auto_boolean soft_float_flag = powerpc_soft_float_global; - int soft_float; - enum powerpc_vector_abi vector_abi = powerpc_vector_abi_global; -+ enum powerpc_elf_abi elf_abi = POWERPC_ELF_AUTO; - int have_fpu = 1, have_spe = 0, have_mq = 0, have_altivec = 0, have_dfp = 0, - have_vsx = 0; - int tdesc_wordsize = -1; -@@ -3907,6 +3911,21 @@ rs6000_gdbarch_init (struct gdbarch_info - } - - #ifdef HAVE_ELF -+ if (from_elf_exec) -+ { -+ switch (elf_elfheader (info.abfd)->e_flags & EF_PPC64_ABI) -+ { -+ case 1: -+ elf_abi = POWERPC_ELF_V1; -+ break; -+ case 2: -+ elf_abi = POWERPC_ELF_V2; -+ break; -+ default: -+ break; -+ } -+ } -+ - if (soft_float_flag == AUTO_BOOLEAN_AUTO && from_elf_exec) - { - switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU, -@@ -3943,6 +3962,15 @@ rs6000_gdbarch_init (struct gdbarch_info - } - #endif - -+ /* Default to ELFv2 ABI on 64-bit little-endian, and ELFv1 otherwise. */ -+ if (elf_abi == POWERPC_ELF_AUTO) -+ { -+ if (wordsize == 8 && info.byte_order == BFD_ENDIAN_LITTLE) -+ elf_abi = POWERPC_ELF_V2; -+ else -+ elf_abi = POWERPC_ELF_V1; -+ } -+ - if (soft_float_flag == AUTO_BOOLEAN_TRUE) - soft_float = 1; - else if (soft_float_flag == AUTO_BOOLEAN_FALSE) -@@ -3985,6 +4013,8 @@ rs6000_gdbarch_init (struct gdbarch_info - meaningful, because 64-bit CPUs can run in 32-bit mode. So, perform - separate word size check. */ - tdep = gdbarch_tdep (arches->gdbarch); -+ if (tdep && tdep->elf_abi != elf_abi) -+ continue; - if (tdep && tdep->soft_float != soft_float) - continue; - if (tdep && tdep->vector_abi != vector_abi) -@@ -4007,6 +4037,7 @@ rs6000_gdbarch_init (struct gdbarch_info - - tdep = XCALLOC (1, struct gdbarch_tdep); - tdep->wordsize = wordsize; -+ tdep->elf_abi = elf_abi; - tdep->soft_float = soft_float; - tdep->vector_abi = vector_abi; - -Index: gdb-7.7/gdb/symtab.c -=================================================================== ---- gdb-7.7.orig/gdb/symtab.c 2014-02-10 18:07:39.000000000 +0100 -+++ gdb-7.7/gdb/symtab.c 2014-02-10 18:07:42.000000000 +0100 -@@ -2941,6 +2941,8 @@ skip_prologue_sal (struct symtab_and_lin - - /* Skip "first line" of function (which is actually its prologue). */ - pc += gdbarch_deprecated_function_start_offset (gdbarch); -+ if (gdbarch_skip_entrypoint_p (gdbarch)) -+ pc = gdbarch_skip_entrypoint (gdbarch, pc); - if (skip) - pc = gdbarch_skip_prologue (gdbarch, pc); - -Index: gdb-7.7/gdb/testsuite/gdb.arch/altivec-regs.exp -=================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.arch/altivec-regs.exp 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.arch/altivec-regs.exp 2014-02-10 18:07:42.000000000 +0100 -@@ -118,7 +118,7 @@ gdb_test "info reg vscr" "vscr.*0x1\t1" - if {$endianness == "big"} { - set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .0, 1, 0, 1, 0, 1, 0, 1., v16_int8 = .0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1.." - } else { -- set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0.." -+ set decimal_vector ".uint128 = 0x00000001000000010000000100000001, v4_float = .1.*e-45, 1.*e-45, 1.*e-45, 1.*e-45., v4_int32 = .1, 1, 1, 1., v8_int16 = .1, 0, 1, 0, 1, 0, 1, 0., v16_int8 = .1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0.." - } - - for {set i 0} {$i < 32} {incr i 1} { -Index: gdb-7.7/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp -=================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.arch/powerpc-d128-regs.exp 2014-02-10 18:07:42.000000000 +0100 -@@ -20,7 +20,7 @@ - - # Testcase for ppc decimal128 pseudo-registers. - --if ![istarget "powerpc64-*"] then { -+if ![istarget "powerpc64*-*"] then { - verbose "Skipping powerpc Decimal128 pseudo-registers testcase." - return - } -Index: gdb-7.7/gdb/testsuite/gdb.arch/vsx-regs.exp -=================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.arch/vsx-regs.exp 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.arch/vsx-regs.exp 2014-02-10 18:07:42.000000000 +0100 -@@ -58,19 +58,46 @@ if ![runto_main] then { - gdb_suppress_tests - } - -+send_gdb "show endian\n" -+set endianness "" -+gdb_expect { -+ -re "(The target endianness is set automatically .currently )(big|little)( endian.*)$gdb_prompt $" { -+ pass "endianness" -+ set endianness $expect_out(2,string) -+ } -+ -re ".*$gdb_prompt $" { -+ fail "couldn't get endianness" -+ } -+ timeout { fail "(timeout) endianness" } -+} -+ - # Data sets used throughout the test - --set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." -+if {$endianness == "big"} { -+ set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x1, 0x0., v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x0, 0x0., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x0, 0x0, 0x0., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0.." -+ -+ set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ -+ set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." - --set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x1, 0xf99999a0, 0x0, 0x0., v4_int32 = .0x3ff4cccc, 0xcccccccc, 0x1, 0x1., v8_int16 = .0x3ff4, 0xcccc, 0xcccc, 0xcccc, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x3f, 0xf4, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." - --set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -+ set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." - --set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef., v16_int8 = .0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef, 0xde, 0xad, 0xbe, 0xef.." -+ set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+} else { -+ set vector_register1 ".uint128 = 0x3ff4cccccccccccc0000000000000000, v2_double = .0x0, 0x1., v4_float = .0x0, 0x0, 0xf99999a0, 0x1., v4_int32 = .0x0, 0x0, 0xcccccccc, 0x3ff4cccc., v8_int16 = .0x0, 0x0, 0x0, 0x0, 0xcccc, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." - --set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register1_vr ".uint128 = 0x3ff4cccccccccccc0000000100000001, v4_float = .0x0, 0x0, 0xf99999a0, 0x1., v4_int32 = .0x1, 0x1, 0xcccccccc, 0x3ff4cccc., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0xcccc, 0xcccc, 0xcccc, 0x3ff4., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xcc, 0xf4, 0x3f.." - --set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1., v16_int8 = .0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1.." -+ set vector_register2 "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v2_double = .0x1, 0x1., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." -+ -+ set vector_register2_vr "uint128 = 0xdeadbeefdeadbeefdeadbeefdeadbeef, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0xdeadbeef, 0xdeadbeef, 0xdeadbeef, 0xdeadbeef., v8_int16 = .0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead, 0xbeef, 0xdead., v16_int8 = .0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde, 0xef, 0xbe, 0xad, 0xde.." -+ -+ set vector_register3 ".uint128 = 0x00000001000000010000000100000001, v2_double = .0x0, 0x0., v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." -+ -+ set vector_register3_vr ".uint128 = 0x00000001000000010000000100000001, v4_float = .0x0, 0x0, 0x0, 0x0., v4_int32 = .0x1, 0x1, 0x1, 0x1., v8_int16 = .0x1, 0x0, 0x1, 0x0, 0x1, 0x0, 0x1, 0x0., v16_int8 = .0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0.." -+} - - set float_register ".raw 0xdeadbeefdeadbeef." - -Index: gdb-7.7/gdb/testsuite/gdb.base/sigbpt.exp -=================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.base/sigbpt.exp 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.base/sigbpt.exp 2014-02-10 18:07:42.000000000 +0100 -@@ -76,7 +76,7 @@ gdb_test "break keeper" - set bowler_addrs bowler - set segv_addr none - gdb_test {display/i $pc} --gdb_test "advance *bowler" "bowler.*" "advance to the bowler" -+gdb_test "advance bowler" "bowler.*" "advance to the bowler" - set test "stepping to fault" - set signame "SIGSEGV" - gdb_test_multiple "stepi" "$test" { -Index: gdb-7.7/gdb/testsuite/gdb.base/step-bt.exp -=================================================================== ---- gdb-7.7.orig/gdb/testsuite/gdb.base/step-bt.exp 2014-01-08 10:23:36.000000000 +0100 -+++ gdb-7.7/gdb/testsuite/gdb.base/step-bt.exp 2014-02-10 18:07:42.000000000 +0100 -@@ -24,7 +24,7 @@ if {[prepare_for_testing $testfile.exp $ - return -1 - } - --gdb_test "break *hello" \ -+gdb_test "break hello" \ - "Breakpoint.*at.* file .*$srcfile, line .*" \ - "breakpoint at first instruction of hello()" - -Index: gdb-7.7/include/elf/common.h -=================================================================== ---- gdb-7.7.orig/include/elf/common.h 2014-02-06 03:21:29.000000000 +0100 -+++ gdb-7.7/include/elf/common.h 2014-02-10 18:07:42.000000000 +0100 -@@ -959,6 +959,7 @@ - #define AT_BASE_PLATFORM 24 /* String identifying real platform, - may differ from AT_PLATFORM. */ - #define AT_RANDOM 25 /* Address of 16 random bytes. */ -+#define AT_HWCAP2 26 /* Extension of AT_HWCAP. */ - #define AT_EXECFN 31 /* Filename of executable. */ - /* Pointer to the global system page used for system calls and other - nice things. */ diff --git a/gdb-python-completer-1of2.patch b/gdb-python-completer-1of2.patch new file mode 100644 index 0000000..f274ca4 --- /dev/null +++ b/gdb-python-completer-1of2.patch @@ -0,0 +1,747 @@ +http://sourceware.org/ml/gdb-patches/2014-07/msg00002.html +Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class +https://bugzilla.redhat.com/show_bug.cgi?id=1075199 + +On Wednesday, May 21 2014, Doug Evans wrote: + +> Sergio Durigan Junior writes: +>> [...] +>> Thanks. WDYT of the following patch? +> +> Hi. +> +> fwiw it's too bad the ability to plug in different completers isn't more, +> I dunno, parameterized (couldn't pick a better term, apologies - +> I thought of "object oriented" but that carries its own baggage). +> Performing completion obviously involves specifying more than a just +> single function (witness the comparison of the completer with specific +> functions). + +Thanks for the reply, and sorry for the long delay in answering. + +> Plus it's more than specifying brkchars. +> Witness code like this: +> +> /* Many commands which want to complete on +> file names accept several file names, as +> in "run foo bar >>baz". So we don't want +> to complete the entire text after the +> command, just the last word. To this +> end, we need to find the beginning of the +> file name by starting at `word' and going +> backwards. */ +> for (p = word; +> p > tmp_command +> && strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL; +> p--) +> ; +> +> IWBN if a "completer" object described how to do all these three things. +> Then the special case code for filename_completer (and location_completer) +> in completer.c could disappear. But maybe that's a patch for another day. + +While I agree with you that the completion mechanism could be better (I +myself had a lot of trouble with it), I unfortunately don't have enough +time to tackle this problem now. So yeah, I think it will be a patch +for another day... + +> Regarding the hack of using a static local to pass data from +> handle_brkchars to handle_completion, I know it's a hacky pragmatic +> choice. To get the reference counting right the code assumes that +> if the handle_brkchars phase is done then the handle_completion +> phase will be done too, right? + +Yeah. This is true for the current code (well, except maybe for the +case you describe below...). + +> I wonder if a SIGINT could sneak in +> there between the two passes (either today or tomorrow). +> Maybe the code in cmdpy_completer_helper for handle_brkchars_p could +> first check whether resultobj is already non-NULL, and decrement its +> reference count before setting it to NULL? + +Yes, done (I think). Thanks for raising this issue. + +> And cmdpy_completer_helper +> could be defined to return a borrowed reference to resultobj? +> Dunno, just thinking out loud. + +Done, I guess. + +> Something puzzles me though: If it's ok to cache the completion result from the +> handle_brkchars pass to the handle_completion pass, why have two passes? +> It feels like there must be a case where this caching of the result +> in a static local from one pass to the next won't work. + +I'm not sure I follow. + +It's OK to cache the result because handle_brkchars and +handle_completion work on the same set of data. In fact, we wouldn't +need to have two passes here; my previous patch didn't have two passes, +and worked fine. I just implemented it this way because Tom (correctly) +raised the point that the completion itself might be time-consuming, and +thus we could reuse its result in the two phases. + +> Another question: +> I noticed complete_command doesn't do this two-phase dance +> of handle_brkchars followed by handle_completions. Should it? +> It just goes straight to handle_completions. + +I don't think it should, because for complete_command (and +complete_filename et al) the handle_brkchars is already defined +internally by GDB. See: + + ... + /* Choose the default set of word break characters to break + completions. If we later find out that we are doing completions + on command strings (as opposed to strings supplied by the + individual command completer functions, which can be any string) + then we will switch to the special word break set for command + strings, which leaves out the '-' character used in some + commands. */ + rl_completer_word_break_characters = + current_language->la_word_break_characters(); + ... + + /* It is a normal command; what comes after it is + completed by the command's completer function. */ + if (c->completer == filename_completer) + { + /* Many commands which want to complete on + file names accept several file names, as + in "run foo bar >>baz". So we don't want + to complete the entire text after the + command, just the last word. To this + end, we need to find the beginning of the + file name by starting at `word' and going + backwards. */ + for (p = word; + p > tmp_command + && strchr (gdb_completer_file_name_break_characters, p[-1]) == NULL; + p--) + ; + rl_completer_word_break_characters = + gdb_completer_file_name_break_characters; + } + else if (c->completer == location_completer) + { + /* Commands which complete on locations want to + see the entire argument. */ + for (p = word; + p > tmp_command + && p[-1] != ' ' && p[-1] != '\t'; + p--) + ; + } + if (reason == handle_brkchars + && c->completer_handle_brkchars != NULL) + (*c->completer_handle_brkchars) (c, p, word); + if (reason != handle_brkchars && c->completer != NULL) + list = (*c->completer) (c, p, word); + + +The complete_command function will only be called by the last "if" +clause, when reason != handle_brkchars. Otherwise, +complete_line_internal will just deal with handle_brkchars. And for +complete_command, the right value for rl_completer_word_break_characters +is what is attributed at the beginning of the function. + +My patch implements this "two-phase" dance for Python because in this +specific case (i.e., a completion method defined in the Python script) +there is no way to know the value of handle_brkchars before we actually +do the completion itself. + +In fact, my patch could probably be "simplified" and be made to call +cmdpy_completer directly (without any cmdpy_completer_handle_brkchars), +assuming that this function took care of filling handle_brkchars +correctly. What I mean is: when dealing with the handle_brkchars case, +the completer command can do anything it wants. + +> [Maybe that explains the difference from using TAB. Dunno off hand.] +> It seems like complete_command is trying to hand-code its own +> handle_brkchars handling: +> +> static void +> complete_command (char *arg, int from_tty) +> { +> int argpoint; +> char *point, *arg_prefix; +> VEC (char_ptr) *completions; +> +> dont_repeat (); +> +> if (arg == NULL) +> arg = ""; +> argpoint = strlen (arg); +> +> /* complete_line assumes that its first argument is somewhere +> within, and except for filenames at the beginning of, the word to +> be completed. The following crude imitation of readline's +> word-breaking tries to accomodate this. */ +> point = arg + argpoint; +> while (point > arg) +> { +> if (strchr (rl_completer_word_break_characters, point[-1]) != 0) +> break; +> point--; +> } +> +> arg_prefix = alloca (point - arg + 1); +> memcpy (arg_prefix, arg, point - arg); +> arg_prefix[point - arg] = 0; +> +> completions = complete_line (point, arg, argpoint); +> +> ... +> } + +Yes, it seems so, but I did not check further. + +> TAB and the complete command should work identically of course, +> but for your testcase, maybe you should test both just to verify +> both work reasonably well (even if not identically). +> Given that complete_command doesn't do the two phase dance, +> does it work with your patch? +> Maybe it does, but IWBN to confirm that. + +The 'complete' command does not work as it should with my patch: + + (gdb) complete completefileinit /hom + completefileinit /home + (gdb) complete completefilemethod /hom + completefilemethod /home + +But then, it also does not work without my patch either: + + (gdb) complete file /hom + file /home + +So I am not extending the testcase for now, because this bug needs to be +fixed first (and it is unrelated to the patch I am proposing). + +WDYT of this version? + +Thanks, + +-- +Sergio +GPG key ID: 65FC5E36 +Please send encrypted e-mail if possible +http://blog.sergiodj.net/ + +gdb/ +2014-06-30 Sergio Durigan Junior + + PR python/16699 + * cli/cli-decode.c (set_cmd_completer_handle_brkchars): New + function. + (add_cmd): Set "completer_handle_brkchars" to NULL. + * cli/cli-decode.h (struct cmd_list_element) + : New field. + * command.h (completer_ftype_void): New typedef. + (set_cmd_completer_handle_brkchars): New prototype. + * completer.c (set_gdb_completion_word_break_characters): New + function. + (complete_line_internal): Call "completer_handle_brkchars" + callback from command. + * completer.h: Include "command.h". + (set_gdb_completion_word_break_characters): New prototype. + * python/py-cmd.c (cmdpy_completer_helper): New function. + (cmdpy_completer_handle_brkchars): New function. + (cmdpy_completer): Adjust to use cmdpy_completer_helper. + (cmdpy_init): Set completer_handle_brkchars to + cmdpy_completer_handle_brkchars. + +gdb/testsuite/ +2014-06-30 Sergio Durigan Junior + + PR python/16699 + * gdb.python/py-completion.exp: New file. + * gdb.python/py-completion.py: Likewise. + + +Index: gdb-7.7.90.20140627/gdb/cli/cli-decode.c +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/cli/cli-decode.c 2014-07-07 20:53:52.635106914 +0200 ++++ gdb-7.7.90.20140627/gdb/cli/cli-decode.c 2014-07-07 20:53:55.429110207 +0200 +@@ -164,6 +164,15 @@ set_cmd_completer (struct cmd_list_eleme + cmd->completer = completer; /* Ok. */ + } + ++/* See definition in commands.h. */ ++ ++void ++set_cmd_completer_handle_brkchars (struct cmd_list_element *cmd, ++ completer_ftype_void *completer_handle_brkchars) ++{ ++ cmd->completer_handle_brkchars = completer_handle_brkchars; ++} ++ + /* Add element named NAME. + Space for NAME and DOC must be allocated by the caller. + CLASS is the top level category into which commands are broken down +@@ -239,6 +248,7 @@ add_cmd (const char *name, enum command_ + c->prefix = NULL; + c->abbrev_flag = 0; + set_cmd_completer (c, make_symbol_completion_list_fn); ++ c->completer_handle_brkchars = NULL; + c->destroyer = NULL; + c->type = not_set_cmd; + c->var = NULL; +Index: gdb-7.7.90.20140627/gdb/cli/cli-decode.h +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/cli/cli-decode.h 2014-07-07 20:53:52.636106915 +0200 ++++ gdb-7.7.90.20140627/gdb/cli/cli-decode.h 2014-07-07 20:53:55.429110207 +0200 +@@ -176,6 +176,15 @@ struct cmd_list_element + "baz/foo", return "baz/foobar". */ + completer_ftype *completer; + ++ /* Handle the word break characters for this completer. Usually ++ this function need not be defined, but for some types of ++ completers (e.g., Python completers declared as methods inside ++ a class) the word break chars may need to be redefined ++ depending on the completer type (e.g., for filename ++ completers). */ ++ ++ completer_ftype_void *completer_handle_brkchars; ++ + /* Destruction routine for this command. If non-NULL, this is + called when this command instance is destroyed. This may be + used to finalize the CONTEXT field, if needed. */ +Index: gdb-7.7.90.20140627/gdb/command.h +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/command.h 2014-07-07 20:53:52.636106915 +0200 ++++ gdb-7.7.90.20140627/gdb/command.h 2014-07-07 20:53:55.430110208 +0200 +@@ -158,8 +158,16 @@ extern void set_cmd_sfunc (struct cmd_li + typedef VEC (char_ptr) *completer_ftype (struct cmd_list_element *, + const char *, const char *); + ++typedef void completer_ftype_void (struct cmd_list_element *, ++ const char *, const char *); ++ + extern void set_cmd_completer (struct cmd_list_element *, completer_ftype *); + ++/* Set the completer_handle_brkchars callback. */ ++ ++extern void set_cmd_completer_handle_brkchars (struct cmd_list_element *, ++ completer_ftype_void *); ++ + /* HACK: cagney/2002-02-23: Code, mostly in tracepoints.c, grubs + around in cmd objects to test the value of the commands sfunc(). */ + extern int cmd_cfunc_eq (struct cmd_list_element *cmd, +Index: gdb-7.7.90.20140627/gdb/completer.c +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/completer.c 2014-07-07 20:53:52.637106916 +0200 ++++ gdb-7.7.90.20140627/gdb/completer.c 2014-07-07 20:53:55.430110208 +0200 +@@ -450,6 +450,21 @@ expression_completer (struct cmd_list_el + return location_completer (ignore, p, word); + } + ++/* See definition in completer.h. */ ++ ++void ++set_gdb_completion_word_break_characters (completer_ftype *fn) ++{ ++ /* So far we are only interested in differentiating filename ++ completers from everything else. */ ++ if (fn == filename_completer) ++ rl_completer_word_break_characters ++ = gdb_completer_file_name_break_characters; ++ else ++ rl_completer_word_break_characters ++ = gdb_completer_command_word_break_characters; ++} ++ + /* Here are some useful test cases for completion. FIXME: These + should be put in the test suite. They should be tested with both + M-? and TAB. +@@ -678,6 +693,9 @@ complete_line_internal (const char *text + p--) + ; + } ++ if (reason == handle_brkchars ++ && c->completer_handle_brkchars != NULL) ++ (*c->completer_handle_brkchars) (c, p, word); + if (reason != handle_brkchars && c->completer != NULL) + list = (*c->completer) (c, p, word); + } +@@ -751,6 +769,9 @@ complete_line_internal (const char *text + p--) + ; + } ++ if (reason == handle_brkchars ++ && c->completer_handle_brkchars != NULL) ++ (*c->completer_handle_brkchars) (c, p, word); + if (reason != handle_brkchars && c->completer != NULL) + list = (*c->completer) (c, p, word); + } +Index: gdb-7.7.90.20140627/gdb/completer.h +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/completer.h 2014-07-07 20:53:52.637106916 +0200 ++++ gdb-7.7.90.20140627/gdb/completer.h 2014-07-07 20:54:13.297131831 +0200 +@@ -18,6 +18,7 @@ + #define COMPLETER_H 1 + + #include "gdb_vecs.h" ++#include "command.h" + + extern VEC (char_ptr) *complete_line (const char *text, + char *line_buffer, +@@ -48,6 +49,13 @@ extern char *get_gdb_completer_quote_cha + + extern char *gdb_completion_word_break_characters (void); + ++/* Set the word break characters array to the corresponding set of ++ chars, based on FN. This function is useful for cases when the ++ completer doesn't know the type of the completion until some ++ calculation is done (e.g., for Python functions). */ ++ ++extern void set_gdb_completion_word_break_characters (completer_ftype *fn); ++ + /* Exported to linespec.c */ + + extern const char *skip_quoted_chars (const char *, const char *, +Index: gdb-7.7.90.20140627/gdb/python/py-cmd.c +=================================================================== +--- gdb-7.7.90.20140627.orig/gdb/python/py-cmd.c 2014-07-07 20:53:52.637106916 +0200 ++++ gdb-7.7.90.20140627/gdb/python/py-cmd.c 2014-07-07 20:53:55.431110209 +0200 +@@ -208,45 +208,155 @@ cmdpy_function (struct cmd_list_element + do_cleanups (cleanup); + } + ++/* Helper function for the Python command completers (both "pure" ++ completer and brkchar handler). This function takes COMMAND, TEXT ++ and WORD and tries to call the Python method for completion with ++ these arguments. It also takes HANDLE_BRKCHARS_P, an argument to ++ identify whether it is being called from the brkchar handler or ++ from the "pure" completer. In the first case, it effectively calls ++ the Python method for completion, and records the PyObject in a ++ static variable (used as a "cache"). In the second case, it just ++ returns that variable, without actually calling the Python method ++ again. This saves us one Python method call. ++ ++ It is important to mention that this function is built on the ++ assumption that the calls to cmdpy_completer_handle_brkchars and ++ cmdpy_completer will be subsequent with nothing intervening. This ++ is true for our completer mechanism. ++ ++ This function returns the PyObject representing the Python method ++ call. */ ++ ++static PyObject * ++cmdpy_completer_helper (struct cmd_list_element *command, ++ const char *text, const char *word, ++ int handle_brkchars_p) ++{ ++ cmdpy_object *obj = (cmdpy_object *) get_cmd_context (command); ++ PyObject *textobj, *wordobj; ++ /* This static variable will server as a "cache" for us, in order to ++ store the PyObject that results from calling the Python ++ function. */ ++ static PyObject *resultobj = NULL; ++ ++ if (handle_brkchars_p) ++ { ++ /* If we were called to handle brkchars, it means this is the ++ first function call of two that will happen in a row. ++ Therefore, we need to call the completer ourselves, and cache ++ the return value in the static variable RESULTOBJ. Then, in ++ the second call, we can just use the value of RESULTOBJ to do ++ our job. */ ++ if (resultobj != NULL) ++ Py_DECREF (resultobj); ++ ++ resultobj = NULL; ++ if (!obj) ++ error (_("Invalid invocation of Python command object.")); ++ if (!PyObject_HasAttr ((PyObject *) obj, complete_cst)) ++ { ++ /* If there is no complete method, don't error. */ ++ return NULL; ++ } ++ ++ textobj = PyUnicode_Decode (text, strlen (text), host_charset (), NULL); ++ if (!textobj) ++ error (_("Could not convert argument to Python string.")); ++ wordobj = PyUnicode_Decode (word, sizeof (word), host_charset (), NULL); ++ if (!wordobj) ++ { ++ Py_DECREF (textobj); ++ error (_("Could not convert argument to Python string.")); ++ } ++ ++ resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst, ++ textobj, wordobj, NULL); ++ Py_DECREF (textobj); ++ Py_DECREF (wordobj); ++ if (!resultobj) ++ { ++ /* Just swallow errors here. */ ++ PyErr_Clear (); ++ } ++ ++ Py_XINCREF (resultobj); ++ } ++ ++ return resultobj; ++} ++ ++/* Python function called to determine the break characters of a ++ certain completer. We are only interested in knowing if the ++ completer registered by the user will return one of the integer ++ codes (see COMPLETER_* symbols). */ ++ ++static void ++cmdpy_completer_handle_brkchars (struct cmd_list_element *command, ++ const char *text, const char *word) ++{ ++ PyObject *resultobj = NULL; ++ struct cleanup *cleanup; ++ ++ cleanup = ensure_python_env (get_current_arch (), current_language); ++ ++ /* Calling our helper to obtain the PyObject of the Python ++ function. */ ++ resultobj = cmdpy_completer_helper (command, text, word, 1); ++ ++ /* Check if there was an error. */ ++ if (resultobj == NULL) ++ goto done; ++ ++ if (PyInt_Check (resultobj)) ++ { ++ /* User code may also return one of the completion constants, ++ thus requesting that sort of completion. We are only ++ interested in this kind of return. */ ++ long value; ++ ++ if (!gdb_py_int_as_long (resultobj, &value)) ++ { ++ /* Ignore. */ ++ PyErr_Clear (); ++ } ++ else if (value >= 0 && value < (long) N_COMPLETERS) ++ { ++ /* This is the core of this function. Depending on which ++ completer type the Python function returns, we have to ++ adjust the break characters accordingly. */ ++ set_gdb_completion_word_break_characters ++ (completers[value].completer); ++ } ++ } ++ ++ done: ++ ++ /* We do not call Py_XDECREF here because RESULTOBJ will be used in ++ the subsequent call to cmdpy_completer function. */ ++ do_cleanups (cleanup); ++} ++ + /* Called by gdb for command completion. */ + + static VEC (char_ptr) * + cmdpy_completer (struct cmd_list_element *command, + const char *text, const char *word) + { +- cmdpy_object *obj = (cmdpy_object *) get_cmd_context (command); +- PyObject *textobj, *wordobj, *resultobj = NULL; ++ PyObject *resultobj = NULL; + VEC (char_ptr) *result = NULL; + struct cleanup *cleanup; + + cleanup = ensure_python_env (get_current_arch (), current_language); + +- if (! obj) +- error (_("Invalid invocation of Python command object.")); +- if (! PyObject_HasAttr ((PyObject *) obj, complete_cst)) +- { +- /* If there is no complete method, don't error -- instead, just +- say that there are no completions. */ +- goto done; +- } +- +- textobj = PyUnicode_Decode (text, strlen (text), host_charset (), NULL); +- if (! textobj) +- error (_("Could not convert argument to Python string.")); +- wordobj = PyUnicode_Decode (word, strlen (word), host_charset (), NULL); +- if (! wordobj) +- error (_("Could not convert argument to Python string.")); +- +- resultobj = PyObject_CallMethodObjArgs ((PyObject *) obj, complete_cst, +- textobj, wordobj, NULL); +- Py_DECREF (textobj); +- Py_DECREF (wordobj); +- if (! resultobj) +- { +- /* Just swallow errors here. */ +- PyErr_Clear (); +- goto done; +- } ++ /* Calling our helper to obtain the PyObject of the Python ++ function. */ ++ resultobj = cmdpy_completer_helper (command, text, word, 0); ++ ++ /* If the result object of calling the Python function is NULL, it ++ means that there was an error. In this case, just give up and ++ return NULL. */ ++ if (resultobj == NULL) ++ goto done; + + result = NULL; + if (PyInt_Check (resultobj)) +@@ -302,7 +412,6 @@ cmdpy_completer (struct cmd_list_element + + done: + +- Py_XDECREF (resultobj); + do_cleanups (cleanup); + + return result; +@@ -548,6 +657,9 @@ cmdpy_init (PyObject *self, PyObject *ar + set_cmd_context (cmd, self); + set_cmd_completer (cmd, ((completetype == -1) ? cmdpy_completer + : completers[completetype].completer)); ++ if (completetype == -1) ++ set_cmd_completer_handle_brkchars (cmd, ++ cmdpy_completer_handle_brkchars); + } + if (except.reason < 0) + { +Index: gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.exp +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.exp 2014-07-07 20:53:55.431110209 +0200 +@@ -0,0 +1,70 @@ ++# Copyright (C) 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 . ++ ++set testfile "py-completion" ++ ++load_lib gdb-python.exp ++ ++gdb_exit ++gdb_start ++ ++# Skip all tests if Python scripting is not enabled. ++if { [skip_python_tests] } { continue } ++ ++gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" ++ ++# Create a temporary directory ++set testdir "${objdir}/${subdir}/py-completion-testdir/" ++set testdir_regex [string_to_regexp $testdir] ++set testdir_complete "${objdir}/${subdir}/py-completion-test" ++file mkdir $testdir ++ ++# This one should always pass. ++send_gdb "completefileinit ${testdir_complete}\t" ++gdb_test_multiple "" "completefileinit completion" { ++ -re "^completefileinit ${testdir_regex}$" { ++ pass "completefileinit completion" ++ } ++} ++ ++# Just discarding whatever we typed. ++send_gdb "\n" ++gdb_test "print" ".*" ++ ++# This is the problematic one. ++send_gdb "completefilemethod ${testdir_complete}\t" ++gdb_test_multiple "" "completefilemethod completion" { ++ -re "^completefilemethod ${testdir_regex} $" { ++ fail "completefilemethod completion (completed filename as wrong command arg)" ++ } ++ -re "^completefilemethod ${testdir_regex}$" { ++ pass "completefilemethod completion" ++ } ++} ++ ++# Discarding again ++send_gdb "\n" ++gdb_test "print" ".*" ++ ++# Another problematic ++send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t" ++gdb_test_multiple "" "completefilecommandcond completion" { ++ -re "^completefilecommandcond ${testdir}$" { ++ fail "completefilecommandcond completion (completed filename instead of command)" ++ } ++ -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" { ++ pass "completefilecommandcond completion" ++ } ++} +Index: gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.py +=================================================================== +--- /dev/null 1970-01-01 00:00:00.000000000 +0000 ++++ gdb-7.7.90.20140627/gdb/testsuite/gdb.python/py-completion.py 2014-07-07 20:53:55.431110209 +0200 +@@ -0,0 +1,58 @@ ++# Copyright (C) 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 . ++ ++# This testcase tests PR python/16699 ++ ++import gdb ++ ++class CompleteFileInit(gdb.Command): ++ def __init__(self): ++ gdb.Command.__init__(self,'completefileinit',gdb.COMMAND_USER,gdb.COMPLETE_FILENAME) ++ ++ def invoke(self,argument,from_tty): ++ raise gdb.GdbError('not implemented') ++ ++class CompleteFileMethod(gdb.Command): ++ def __init__(self): ++ gdb.Command.__init__(self,'completefilemethod',gdb.COMMAND_USER) ++ ++ def invoke(self,argument,from_tty): ++ raise gdb.GdbError('not implemented') ++ ++ def complete(self,text,word): ++ return gdb.COMPLETE_FILENAME ++ ++class CompleteFileCommandCond(gdb.Command): ++ def __init__(self): ++ gdb.Command.__init__(self,'completefilecommandcond',gdb.COMMAND_USER) ++ ++ def invoke(self,argument,from_tty): ++ raise gdb.GdbError('not implemented') ++ ++ def complete(self,text,word): ++ # This is a test made to know if the command ++ # completion still works fine. When the user asks to ++ # complete something like "completefilecommandcond ++ # /path/to/py-completion-t", it should not complete to ++ # "/path/to/py-completion-test/", but instead just ++ # wait for input. ++ if "py-completion-t" in text: ++ return gdb.COMPLETE_COMMAND ++ else: ++ return gdb.COMPLETE_FILENAME ++ ++CompleteFileInit() ++CompleteFileMethod() ++CompleteFileCommandCond() diff --git a/gdb-python-completer-2of2.patch b/gdb-python-completer-2of2.patch new file mode 100644 index 0000000..aa29a4e --- /dev/null +++ b/gdb-python-completer-2of2.patch @@ -0,0 +1,72 @@ +http://sourceware.org/ml/gdb-patches/2014-07/msg00154.html +Subject: Re: [PATCH] PR python/16699: GDB Python command completion with overriden complete vs. completer class + + +--pWyiEgJYm5f9v55/ +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +On Tue, 08 Jul 2014 17:32:21 +0200, Jan Kratochvil wrote: +> - -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" { +> + -re "^completefilecommandcond ${completion_regex}$" { + +There was a racy bug here - and even in the former test - here should be: + + -re "^completefilecommandcond ${completion_regex}\007$" { + +Updated fix attached. + + +Jan + +--pWyiEgJYm5f9v55/ +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="py-completion-race2.patch" + +--- ./gdb/testsuite/gdb.python/py-completion.exp-orig 2014-07-07 21:32:17.891045058 +0200 ++++ ./gdb/testsuite/gdb.python/py-completion.exp 2014-07-08 20:14:57.189791928 +0200 +@@ -26,9 +26,9 @@ if { [skip_python_tests] } { continue } + gdb_test_no_output "source ${srcdir}/${subdir}/${testfile}.py" + + # Create a temporary directory +-set testdir "${objdir}/${subdir}/py-completion-testdir/" ++set testdir "[standard_output_file "py-completion-testdir"]/" + set testdir_regex [string_to_regexp $testdir] +-set testdir_complete "${objdir}/${subdir}/py-completion-test" ++set testdir_complete [standard_output_file "py-completion-test"] + file mkdir $testdir + + # This one should always pass. +@@ -40,8 +40,7 @@ gdb_test_multiple "" "completefileinit c + } + + # Just discarding whatever we typed. +-send_gdb "\n" +-gdb_test "print" ".*" ++gdb_test " " ".*" "discard #1" + + # This is the problematic one. + send_gdb "completefilemethod ${testdir_complete}\t" +@@ -55,16 +54,16 @@ gdb_test_multiple "" "completefilemethod + } + + # Discarding again +-send_gdb "\n" +-gdb_test "print" ".*" ++gdb_test " " ".*" "discard #2" + + # Another problematic +-send_gdb "completefilecommandcond ${objdir}/${subdir}/py-completion-t\t" ++set completion_regex "[string_to_regexp [standard_output_file "py-completion-t"]]" ++send_gdb "completefilecommandcond [standard_output_file "py-completion-t\t"]" + gdb_test_multiple "" "completefilecommandcond completion" { + -re "^completefilecommandcond ${testdir}$" { + fail "completefilecommandcond completion (completed filename instead of command)" + } +- -re "^completefilecommandcond ${objdir}/${subdir}/py-completion-t$" { ++ -re "^completefilecommandcond ${completion_regex}\007$" { + pass "completefilecommandcond completion" + } + } + +--pWyiEgJYm5f9v55/-- + diff --git a/gdb-readline-6.3.5.patch b/gdb-readline-6.3.5.patch new file mode 100644 index 0000000..0f987cd --- /dev/null +++ b/gdb-readline-6.3.5.patch @@ -0,0 +1,90 @@ +http://sourceware.org/ml/gdb-patches/2014-06/msg00737.html +Subject: [patch] Fix --with-system-readline with readline-6.3 patch 5 + + +--BXVAT5kNtrzKuDFl +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +Hi, + +I have filed now: + --with-system-readline uses bundled readline include files + https://sourceware.org/bugzilla/show_bug.cgi?id=17077 + +To see any effect of the patch below you have to do: + rm -rf readline +Otherwise readline include files get used the bundled ones from GDB which are +currently 6.2 while system readline may be 6.3 already. + +You also have to use system readline-6.3 including its upstream patch: + [Bug-readline] Readline-6.3 Official Patch 5 + http://lists.gnu.org/archive/html/bug-readline/2014-04/msg00018.html + Message-ID: <140415125618.AA57598.SM@caleb.ins.cwru.edu> + +In short it happens on Fedora Rawhide since: + readline-6.3-1.fc21 + https://koji.fedoraproject.org/koji/buildinfo?buildID=538941 + +The error is: + https://kojipkgs.fedoraproject.org//work/tasks/9890/7059890/build.log + ../../gdb/tui/tui-io.c:132:1: error: 'Function' is deprecated [-Werror=deprecated-declarations] + static Function *tui_old_rl_getc_function; + ^ + ../../gdb/tui/tui-io.c:133:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] + static VFunction *tui_old_rl_redisplay_function; + ^ + ../../gdb/tui/tui-io.c:134:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] + static VFunction *tui_old_rl_prep_terminal; + ^ + ../../gdb/tui/tui-io.c:135:1: error: 'VFunction' is deprecated [-Werror=deprecated-declarations] + static VFunction *tui_old_rl_deprep_terminal; + ^ + +It is since bash change: +lib/readline/rltypedefs.h + - remove old Function/VFunction/CPFunction/CPPFunction typedefs as + suggested by Tom Tromey + +The new typedefs used below are present in readline/rltypedefs.h since: + git://git.savannah.gnu.org/bash.git + commit 28ef6c316f1aff914bb95ac09787a3c83c1815fd + Date: Fri Apr 6 19:14:31 2001 +0000 + + +Jan + +--BXVAT5kNtrzKuDFl +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="tuireadline.patch" + +gdb/ +2014-06-20 Jan Kratochvil + + Fix --with-system-readline with readline-6.3 patch 5. + * tui/tui-io.c (tui_old_rl_getc_function, tui_old_rl_redisplay_function) + (tui_old_rl_prep_terminal, tui_old_rl_deprep_terminal): Use rl_*_t + types. + +diff --git a/gdb/tui/tui-io.c b/gdb/tui/tui-io.c +index 761d203..dcccb08 100644 +--- a/gdb/tui/tui-io.c ++++ b/gdb/tui/tui-io.c +@@ -129,10 +129,10 @@ static struct ui_file *tui_old_stderr; + struct ui_out *tui_old_uiout; + + /* Readline previous hooks. */ +-static Function *tui_old_rl_getc_function; +-static VFunction *tui_old_rl_redisplay_function; +-static VFunction *tui_old_rl_prep_terminal; +-static VFunction *tui_old_rl_deprep_terminal; ++static rl_getc_func_t *tui_old_rl_getc_function; ++static rl_voidfunc_t *tui_old_rl_redisplay_function; ++static rl_vintfunc_t *tui_old_rl_prep_terminal; ++static rl_voidfunc_t *tui_old_rl_deprep_terminal; + static int tui_old_rl_echoing_p; + + /* Readline output stream. + +--BXVAT5kNtrzKuDFl-- + diff --git a/gdb-rhbz795424-bitpos-20of25.patch b/gdb-rhbz795424-bitpos-20of25.patch index 0119067..0897484 100644 --- a/gdb-rhbz795424-bitpos-20of25.patch +++ b/gdb-rhbz795424-bitpos-20of25.patch @@ -463,11 +463,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-main.patch -Index: gdb-7.6.90.20140127/gdb/ada-lang.c +Index: gdb-7.7.90.20140613/gdb/ada-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ada-lang.c 2014-02-06 18:07:54.341911093 +0100 -+++ gdb-7.6.90.20140127/gdb/ada-lang.c 2014-02-06 18:07:58.898915990 +0100 -@@ -80,7 +80,7 @@ static struct type *desc_bounds_type (st +--- gdb-7.7.90.20140613.orig/gdb/ada-lang.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ada-lang.c 2014-06-24 16:07:27.245986875 +0200 +@@ -78,7 +78,7 @@ static struct type *desc_bounds_type (st static struct value *desc_bounds (struct value *); @@ -476,7 +476,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c static int fat_pntr_bounds_bitsize (struct type *); -@@ -88,13 +88,13 @@ static struct type *desc_data_target_typ +@@ -86,13 +86,13 @@ static struct type *desc_data_target_typ static struct value *desc_data (struct value *); @@ -492,7 +492,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c static int desc_bound_bitsize (struct type *, int, int); -@@ -174,7 +174,7 @@ static struct type *static_unwrap_type ( +@@ -172,7 +172,7 @@ static struct type *static_unwrap_type ( static struct value *unwrap_value (struct value *); @@ -501,7 +501,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c static struct type *decode_constrained_packed_array_type (struct type *); -@@ -189,7 +189,8 @@ static int ada_is_unconstrained_packed_a +@@ -187,7 +187,8 @@ static int ada_is_unconstrained_packed_a static struct value *value_subscript_packed (struct value *, int, struct value **); @@ -511,7 +511,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c static struct value *coerce_unspec_val_to_type (struct value *, struct type *); -@@ -217,14 +218,14 @@ static struct value *value_val_atr (stru +@@ -215,14 +216,14 @@ static struct value *value_val_atr (stru static struct symbol *standard_lookup (const char *, const struct block *, domain_enum); @@ -530,7 +530,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c static struct value *ada_to_fixed_value_create (struct type *, CORE_ADDR, struct value *); -@@ -240,7 +241,7 @@ static void ada_language_arch_info (stru +@@ -238,7 +239,7 @@ static void ada_language_arch_info (stru static void check_size (const struct type *); @@ -539,7 +539,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *); static struct value *assign_aggregate (struct value *, struct value *, -@@ -587,7 +588,7 @@ coerce_unspec_val_to_type (struct value +@@ -694,7 +695,7 @@ coerce_unspec_val_to_type (struct value } static const gdb_byte * @@ -548,7 +548,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c { if (valaddr == NULL) return NULL; -@@ -596,7 +597,7 @@ cond_offset_host (const gdb_byte *valadd +@@ -703,7 +704,7 @@ cond_offset_host (const gdb_byte *valadd } static CORE_ADDR @@ -557,7 +557,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c { if (address == 0) return 0; -@@ -1602,7 +1603,7 @@ desc_bounds (struct value *arr) +@@ -1711,7 +1712,7 @@ desc_bounds (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the bounds data. */ @@ -566,7 +566,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c fat_pntr_bounds_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 1); -@@ -1668,7 +1669,7 @@ desc_data (struct value *arr) +@@ -1777,7 +1778,7 @@ desc_data (struct value *arr) /* If TYPE is the type of an array-descriptor (fat pointer), the bit position of the field containing the address of the data. */ @@ -575,7 +575,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c fat_pntr_data_bitpos (struct type *type) { return TYPE_FIELD_BITPOS (desc_base_type (type), 0); -@@ -1703,7 +1704,7 @@ desc_one_bound (struct value *bounds, in +@@ -1812,7 +1813,7 @@ desc_one_bound (struct value *bounds, in of the Ith lower bound stored in it, if WHICH is 0, and the Ith upper bound, if WHICH is 1. The first bound is I=1. */ @@ -584,7 +584,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c desc_bound_bitpos (struct type *type, int i, int which) { return TYPE_FIELD_BITPOS (desc_base_type (type), 2 * i + which - 2); -@@ -1893,7 +1894,7 @@ ada_type_of_array (struct value *arr, in +@@ -2002,7 +2003,7 @@ ada_type_of_array (struct value *arr, in zero, and does not need to be recomputed. */ if (lo < hi) { @@ -593,7 +593,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c (hi - lo + 1) * TYPE_FIELD_BITSIZE (elt_type, 0); TYPE_LENGTH (array_type) = (array_bitsize + 7) / 8; -@@ -2045,7 +2046,7 @@ decode_packed_array_bitsize (struct type +@@ -2154,7 +2155,7 @@ decode_packed_array_bitsize (struct type in bits. */ static struct type * @@ -602,7 +602,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c { struct type *new_elt_type; struct type *new_type; -@@ -2097,7 +2098,7 @@ decode_constrained_packed_array_type (st +@@ -2206,7 +2207,7 @@ decode_constrained_packed_array_type (st char *name; const char *tail; struct type *shadow_type; @@ -611,7 +611,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c if (!raw_name) raw_name = ada_type_name (desc_base_type (type)); -@@ -2168,7 +2169,8 @@ decode_constrained_packed_array (struct +@@ -2277,7 +2278,8 @@ decode_constrained_packed_array (struct array with no wrapper. In order to interpret the value through the (left-justified) packed array type we just built, we must first left-justify it. */ @@ -621,7 +621,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c ULONGEST mod; mod = ada_modulus (value_type (arr)) - 1; -@@ -2269,15 +2271,16 @@ has_negatives (struct type *type) +@@ -2378,15 +2380,16 @@ has_negatives (struct type *type) struct value * ada_value_primitive_packed_val (struct value *obj, const gdb_byte *valaddr, @@ -644,7 +644,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c byte of source that are unused */ accumSize; /* Number of meaningful bits in accum */ unsigned char *bytes; /* First byte containing data to unpack */ -@@ -2310,7 +2313,7 @@ ada_value_primitive_packed_val (struct v +@@ -2420,7 +2423,7 @@ ada_value_primitive_packed_val (struct v if (obj != NULL) { @@ -653,7 +653,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c set_value_component_location (v, obj); set_value_bitpos (v, bit_offset + value_bitpos (obj)); -@@ -2426,7 +2429,7 @@ ada_value_primitive_packed_val (struct v +@@ -2536,7 +2539,7 @@ ada_value_primitive_packed_val (struct v not overlap. */ static void move_bits (gdb_byte *target, int targ_offset, const gdb_byte *source, @@ -662,7 +662,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c { unsigned int accum, mask; int accum_bits, chunk_size; -@@ -2516,7 +2519,7 @@ ada_value_assign (struct value *toval, s +@@ -2626,7 +2629,7 @@ ada_value_assign (struct value *toval, s { int len = (value_bitpos (toval) + bits + HOST_CHAR_BIT - 1) / HOST_CHAR_BIT; @@ -671,7 +671,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c gdb_byte *buffer = alloca (len); struct value *val; CORE_ADDR to_addr = value_address (toval); -@@ -2561,7 +2564,7 @@ value_assign_to_component (struct value +@@ -2671,7 +2674,7 @@ value_assign_to_component (struct value (LONGEST) (value_address (component) - value_address (container)); int bit_offset_in_container = value_bitpos (component) - value_bitpos (container); @@ -680,7 +680,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c val = value_cast (value_type (component), val); -@@ -4085,7 +4088,7 @@ ensure_lval (struct value *val) +@@ -4196,7 +4199,7 @@ ensure_lval (struct value *val) if (VALUE_LVAL (val) == not_lval || VALUE_LVAL (val) == lval_internalvar) { @@ -689,7 +689,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c const CORE_ADDR addr = value_as_long (value_allocate_space_in_inferior (len)); -@@ -4159,7 +4162,7 @@ static CORE_ADDR +@@ -4270,7 +4273,7 @@ static CORE_ADDR value_pointer (struct value *value, struct type *type) { struct gdbarch *gdbarch = get_type_arch (type); @@ -698,7 +698,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c gdb_byte *buf = alloca (len); CORE_ADDR addr; -@@ -6145,7 +6148,7 @@ value_tag_from_contents_and_address (str +@@ -6374,7 +6377,7 @@ value_tag_from_contents_and_address (str const gdb_byte *valaddr, CORE_ADDR address) { @@ -707,7 +707,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *tag_type; if (find_struct_field ("_tag", type, 0, &tag_type, &tag_byte_offset, -@@ -6610,7 +6613,7 @@ ada_in_variant (LONGEST val, struct type +@@ -6839,7 +6842,7 @@ ada_in_variant (LONGEST val, struct type only in that it can handle packed values of arbitrary type. */ static struct value * @@ -716,7 +716,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *arg_type) { struct type *type; -@@ -6622,7 +6625,7 @@ ada_value_primitive_field (struct value +@@ -6851,7 +6854,7 @@ ada_value_primitive_field (struct value if (TYPE_FIELD_BITSIZE (arg_type, fieldno) != 0) { @@ -725,7 +725,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c int bit_size = TYPE_FIELD_BITSIZE (arg_type, fieldno); return ada_value_primitive_packed_val (arg1, value_contents (arg1), -@@ -6649,9 +6652,9 @@ ada_value_primitive_field (struct value +@@ -6878,9 +6881,9 @@ ada_value_primitive_field (struct value Returns 1 if found, 0 otherwise. */ static int @@ -737,7 +737,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c int *index_p) { int i; -@@ -6669,8 +6672,8 @@ find_struct_field (const char *name, str +@@ -6898,8 +6901,8 @@ find_struct_field (const char *name, str for (i = 0; i < TYPE_NFIELDS (type); i += 1) { @@ -748,7 +748,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c const char *t_field_name = TYPE_FIELD_NAME (type, i); if (t_field_name == NULL) -@@ -6740,7 +6743,7 @@ num_visible_fields (struct type *type) +@@ -6969,7 +6972,7 @@ num_visible_fields (struct type *type) Searches recursively through wrapper fields (e.g., '_parent'). */ static struct value * @@ -757,7 +757,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *type) { int i; -@@ -6773,7 +6776,7 @@ ada_search_struct_field (char *name, str +@@ -7002,7 +7005,7 @@ ada_search_struct_field (char *name, str int j; struct type *field_type = ada_check_typedef (TYPE_FIELD_TYPE (type, i)); @@ -766,7 +766,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c for (j = 0; j < TYPE_NFIELDS (field_type); j += 1) { -@@ -6791,8 +6794,8 @@ ada_search_struct_field (char *name, str +@@ -7020,8 +7023,8 @@ ada_search_struct_field (char *name, str return NULL; } @@ -777,7 +777,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c /* Return field #INDEX in ARG, where the index is that returned by -@@ -6801,7 +6804,7 @@ static struct value *ada_index_struct_fi +@@ -7030,7 +7033,7 @@ static struct value *ada_index_struct_fi * If found, return value, else return NULL. */ static struct value * @@ -786,7 +786,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *type) { return ada_index_struct_field_1 (&index, arg, offset, type); -@@ -6813,7 +6816,7 @@ ada_index_struct_field (int index, struc +@@ -7042,7 +7045,7 @@ ada_index_struct_field (int index, struc * *INDEX_P. */ static struct value * @@ -795,7 +795,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *type) { int i; -@@ -6903,7 +6906,8 @@ ada_value_struct_elt (struct value *arg, +@@ -7132,7 +7135,8 @@ ada_value_struct_elt (struct value *arg, v = ada_search_struct_field (name, arg, 0, t); else { @@ -805,7 +805,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c struct type *field_type; CORE_ADDR address; -@@ -7216,8 +7220,8 @@ ada_coerce_ref (struct value *val0) +@@ -7449,8 +7453,8 @@ ada_coerce_ref (struct value *val0) /* Return OFF rounded upward if necessary to a multiple of ALIGNMENT (a power of 2). */ @@ -816,7 +816,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c { return (off + alignment - 1) & ~(alignment - 1); } -@@ -7596,10 +7600,9 @@ ada_template_to_fixed_record_type_1 (str +@@ -7832,10 +7836,9 @@ ada_template_to_fixed_record_type_1 (str struct value *mark = value_mark (); struct value *dval; struct type *rtype; @@ -829,7 +829,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c int f; /* Compute the number of fields in this record type that are going -@@ -7670,7 +7673,7 @@ ada_template_to_fixed_record_type_1 (str +@@ -7913,7 +7916,7 @@ ada_template_to_fixed_record_type_1 (str that follow this one. */ if (ada_is_aligner_type (field_type)) { @@ -838,7 +838,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c field_valaddr = cond_offset_host (field_valaddr, field_offset); field_address = cond_offset_target (field_address, field_offset); -@@ -7799,11 +7802,11 @@ ada_template_to_fixed_record_type_1 (str +@@ -8049,11 +8052,11 @@ ada_template_to_fixed_record_type_1 (str if (TYPE_LENGTH (type) <= 0) { if (TYPE_NAME (rtype)) @@ -854,7 +854,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c } else { -@@ -8140,7 +8143,8 @@ to_fixed_array_type (struct type *type0, +@@ -8393,7 +8396,8 @@ to_fixed_array_type (struct type *type0, type was a regular (non-packed) array type. As a result, the bitsize of the array elements needs to be set again, and the array length needs to be recomputed based on that bitsize. */ @@ -864,11 +864,11 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.c int elt_bitsize = TYPE_FIELD_BITSIZE (type0, 0); TYPE_FIELD_BITSIZE (result, 0) = TYPE_FIELD_BITSIZE (type0, 0); -Index: gdb-7.6.90.20140127/gdb/ada-lang.h +Index: gdb-7.7.90.20140613/gdb/ada-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ada-lang.h 2014-02-06 18:07:54.342911094 +0100 -+++ gdb-7.6.90.20140127/gdb/ada-lang.h 2014-02-06 18:07:58.899915990 +0100 -@@ -180,7 +180,7 @@ extern void ada_print_type (struct type +--- gdb-7.7.90.20140613.orig/gdb/ada-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ada-lang.h 2014-06-24 16:07:27.245986875 +0200 +@@ -181,7 +181,7 @@ extern void ada_print_type (struct type extern void ada_print_typedef (struct type *type, struct symbol *new_symbol, struct ui_file *stream); @@ -877,7 +877,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -195,7 +195,7 @@ extern void ada_emit_char (int, struct t +@@ -196,7 +196,7 @@ extern void ada_emit_char (int, struct t extern void ada_printchar (int, struct type *, struct ui_file *); extern void ada_printstr (struct ui_file *, struct type *, const gdb_byte *, @@ -886,7 +886,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.h const struct value_print_options *); struct value *ada_convert_actual (struct value *actual, -@@ -268,7 +268,7 @@ extern int ada_is_constrained_packed_arr +@@ -267,7 +267,7 @@ extern int ada_is_constrained_packed_arr extern struct value *ada_value_primitive_packed_val (struct value *, const gdb_byte *, @@ -895,11 +895,11 @@ Index: gdb-7.6.90.20140127/gdb/ada-lang.h struct type *); extern struct type *ada_coerce_to_simple_array_type (struct type *); -Index: gdb-7.6.90.20140127/gdb/ada-typeprint.c +Index: gdb-7.7.90.20140613/gdb/ada-typeprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ada-typeprint.c 2014-02-06 18:07:54.342911094 +0100 -+++ gdb-7.6.90.20140127/gdb/ada-typeprint.c 2014-02-06 18:07:58.899915990 +0100 -@@ -829,8 +829,8 @@ ada_print_type (struct type *type0, cons +--- gdb-7.7.90.20140613.orig/gdb/ada-typeprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ada-typeprint.c 2014-06-24 16:07:27.245986875 +0200 +@@ -865,8 +865,8 @@ ada_print_type (struct type *type0, cons const char *name = ada_type_name (type); if (!ada_is_range_type_name (name)) @@ -910,7 +910,7 @@ Index: gdb-7.6.90.20140127/gdb/ada-typeprint.c else { fprintf_filtered (stream, "range "); -@@ -851,7 +851,8 @@ ada_print_type (struct type *type0, cons +@@ -887,7 +887,8 @@ ada_print_type (struct type *type0, cons } break; case TYPE_CODE_FLT: @@ -920,10 +920,10 @@ Index: gdb-7.6.90.20140127/gdb/ada-typeprint.c break; case TYPE_CODE_ENUM: if (show < 0) -Index: gdb-7.6.90.20140127/gdb/ada-valprint.c +Index: gdb-7.7.90.20140613/gdb/ada-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ada-valprint.c 2014-02-06 18:07:54.343911095 +0100 -+++ gdb-7.6.90.20140127/gdb/ada-valprint.c 2014-02-06 18:15:00.766368981 +0100 +--- gdb-7.7.90.20140613.orig/gdb/ada-valprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ada-valprint.c 2014-06-24 16:07:27.246986876 +0200 @@ -35,11 +35,11 @@ #include "objfiles.h" @@ -1077,11 +1077,11 @@ Index: gdb-7.6.90.20140127/gdb/ada-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.6.90.20140127/gdb/annotate.c +Index: gdb-7.7.90.20140613/gdb/annotate.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/annotate.c 2014-02-06 18:07:54.343911095 +0100 -+++ gdb-7.6.90.20140127/gdb/annotate.c 2014-02-06 18:07:58.900915992 +0100 -@@ -523,21 +523,21 @@ annotate_frame_end (void) +--- gdb-7.7.90.20140613.orig/gdb/annotate.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/annotate.c 2014-06-24 16:07:27.246986876 +0200 +@@ -524,21 +524,21 @@ annotate_frame_end (void) } void @@ -1107,10 +1107,10 @@ Index: gdb-7.6.90.20140127/gdb/annotate.c } void -Index: gdb-7.6.90.20140127/gdb/annotate.h +Index: gdb-7.7.90.20140613/gdb/annotate.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/annotate.h 2014-02-06 18:07:54.343911095 +0100 -+++ gdb-7.6.90.20140127/gdb/annotate.h 2014-02-06 18:07:58.901915993 +0100 +--- gdb-7.7.90.20140613.orig/gdb/annotate.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/annotate.h 2014-06-24 16:07:27.246986876 +0200 @@ -92,8 +92,8 @@ extern void annotate_frame_source_end (v extern void annotate_frame_where (void); extern void annotate_frame_end (void); @@ -1122,24 +1122,24 @@ Index: gdb-7.6.90.20140127/gdb/annotate.h extern void annotate_elt_rep_end (void); extern void annotate_elt (void); extern void annotate_array_section_end (void); -Index: gdb-7.6.90.20140127/gdb/arm-linux-nat.c +Index: gdb-7.7.90.20140613/gdb/arm-linux-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/arm-linux-nat.c 2014-02-06 18:07:54.343911095 +0100 -+++ gdb-7.6.90.20140127/gdb/arm-linux-nat.c 2014-02-06 18:07:58.901915993 +0100 -@@ -1073,7 +1073,7 @@ arm_linux_remove_hw_breakpoint (struct g - /* Are we able to use a hardware watchpoint for the LEN bytes starting at +--- gdb-7.7.90.20140613.orig/gdb/arm-linux-nat.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/arm-linux-nat.c 2014-06-24 16:07:27.246986876 +0200 +@@ -1187,7 +1187,7 @@ arm_linux_remove_hw_breakpoint (struct t ADDR? */ static int --arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+arm_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + arm_linux_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { const struct arm_linux_hwbp_cap *cap = arm_linux_get_hwbp_cap (); CORE_ADDR max_wp_length, aligned_addr; -Index: gdb-7.6.90.20140127/gdb/ax-gdb.c +Index: gdb-7.7.90.20140613/gdb/ax-gdb.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ax-gdb.c 2014-02-06 18:07:54.344911096 +0100 -+++ gdb-7.6.90.20140127/gdb/ax-gdb.c 2014-02-06 18:07:58.902915994 +0100 -@@ -82,12 +82,12 @@ static void gen_traced_pop (struct gdbar +--- gdb-7.7.90.20140613.orig/gdb/ax-gdb.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ax-gdb.c 2014-06-24 16:07:27.247986877 +0200 +@@ -83,12 +83,12 @@ static void gen_traced_pop (struct gdbar static void gen_sign_extend (struct agent_expr *, struct type *); static void gen_extend (struct agent_expr *, struct type *); static void gen_fetch (struct agent_expr *, struct type *); @@ -1154,7 +1154,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c static void gen_sym_offset (struct agent_expr *, struct symbol *); static void gen_var_ref (struct gdbarch *, struct agent_expr *ax, struct axs_value *value, struct symbol *var); -@@ -135,15 +135,16 @@ static void gen_deref (struct agent_expr +@@ -136,15 +136,16 @@ static void gen_deref (struct agent_expr static void gen_address_of (struct agent_expr *, struct axs_value *); static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1174,7 +1174,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c struct type *type); static void gen_struct_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, -@@ -538,7 +539,7 @@ gen_fetch (struct agent_expr *ax, struct +@@ -539,7 +540,7 @@ gen_fetch (struct agent_expr *ax, struct right shift it by -DISTANCE bits if DISTANCE < 0. This generates unsigned (logical) right shifts. */ static void @@ -1183,7 +1183,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c { if (distance > 0) { -@@ -592,7 +593,7 @@ gen_frame_locals_address (struct gdbarch +@@ -593,7 +594,7 @@ gen_frame_locals_address (struct gdbarch programming in ML, it would be clearer why these are the same thing. */ static void @@ -1192,7 +1192,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c { /* It would suffice to simply push the offset and add it, but this makes it easier to read positive and negative offsets in the -@@ -1248,7 +1249,7 @@ gen_address_of (struct agent_expr *ax, s +@@ -1249,7 +1250,7 @@ gen_address_of (struct agent_expr *ax, s static void gen_bitfield_ref (struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *type, @@ -1201,7 +1201,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c { /* Note that ops[i] fetches 8 << i bits. */ static enum agent_op ops[] -@@ -1283,13 +1284,13 @@ gen_bitfield_ref (struct expression *exp +@@ -1284,13 +1285,13 @@ gen_bitfield_ref (struct expression *exp /* The first and one-after-last bits in the field, but rounded down and up to byte boundaries. */ @@ -1220,7 +1220,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c /* The index in ops of the opcode we're considering. */ int op; -@@ -1408,7 +1409,7 @@ gen_bitfield_ref (struct expression *exp +@@ -1409,7 +1410,7 @@ gen_bitfield_ref (struct expression *exp static void gen_primitive_field (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1229,7 +1229,7 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c { /* Is this a bitfield? */ if (TYPE_FIELD_PACKED (type, fieldno)) -@@ -1433,7 +1434,7 @@ gen_primitive_field (struct expression * +@@ -1434,7 +1435,7 @@ gen_primitive_field (struct expression * static int gen_struct_ref_recursive (struct expression *exp, struct agent_expr *ax, struct axs_value *value, @@ -1238,10 +1238,10 @@ Index: gdb-7.6.90.20140127/gdb/ax-gdb.c { int i, rslt; int nbases = TYPE_N_BASECLASSES (type); -Index: gdb-7.6.90.20140127/gdb/ax-general.c +Index: gdb-7.7.90.20140613/gdb/ax-general.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ax-general.c 2014-02-06 18:07:54.345911097 +0100 -+++ gdb-7.6.90.20140127/gdb/ax-general.c 2014-02-06 18:07:58.902915994 +0100 +--- gdb-7.7.90.20140613.orig/gdb/ax-general.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ax-general.c 2014-06-24 16:07:27.247986877 +0200 @@ -195,7 +195,7 @@ ax_zero_ext (struct agent_expr *x, int n /* Append a trace_quick instruction to EXPR, to record N bytes. */ @@ -1251,10 +1251,10 @@ Index: gdb-7.6.90.20140127/gdb/ax-general.c { /* N must fit in a byte. */ if (n < 0 || n > 255) -Index: gdb-7.6.90.20140127/gdb/ax.h +Index: gdb-7.7.90.20140613/gdb/ax.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ax.h 2014-02-06 18:07:54.345911097 +0100 -+++ gdb-7.6.90.20140127/gdb/ax.h 2014-02-06 18:07:58.902915994 +0100 +--- gdb-7.7.90.20140613.orig/gdb/ax.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ax.h 2014-06-24 16:07:27.247986877 +0200 @@ -207,7 +207,7 @@ extern void ax_ext (struct agent_expr *E extern void ax_zero_ext (struct agent_expr *EXPR, int N); @@ -1264,11 +1264,11 @@ Index: gdb-7.6.90.20140127/gdb/ax.h /* Append a goto op to EXPR. OP is the actual op (must be aop_goto or aop_if_goto). We assume we don't know the target offset yet, -Index: gdb-7.6.90.20140127/gdb/breakpoint.c +Index: gdb-7.7.90.20140613/gdb/breakpoint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/breakpoint.c 2014-02-06 18:07:54.348911100 +0100 -+++ gdb-7.6.90.20140127/gdb/breakpoint.c 2014-02-06 18:07:58.906915998 +0100 -@@ -6754,7 +6754,7 @@ breakpoint_address_match (struct address +--- gdb-7.7.90.20140613.orig/gdb/breakpoint.c 2014-06-24 16:07:27.070986681 +0200 ++++ gdb-7.7.90.20140613/gdb/breakpoint.c 2014-06-24 16:07:27.249986879 +0200 +@@ -6930,7 +6930,7 @@ breakpoint_address_match (struct address static int breakpoint_address_match_range (struct address_space *aspace1, CORE_ADDR addr1, @@ -1277,7 +1277,7 @@ Index: gdb-7.6.90.20140127/gdb/breakpoint.c CORE_ADDR addr2) { return ((gdbarch_has_global_breakpoints (target_gdbarch ()) -@@ -11353,7 +11353,7 @@ can_use_hardware_watchpoint (struct valu +@@ -11542,7 +11542,7 @@ can_use_hardware_watchpoint (struct valu && TYPE_CODE (vtype) != TYPE_CODE_ARRAY)) { CORE_ADDR vaddr = value_address (v); @@ -1286,11 +1286,11 @@ Index: gdb-7.6.90.20140127/gdb/breakpoint.c int num_regs; len = (target_exact_watchpoints -Index: gdb-7.6.90.20140127/gdb/breakpoint.h +Index: gdb-7.7.90.20140613/gdb/breakpoint.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/breakpoint.h 2014-02-06 18:07:54.348911100 +0100 -+++ gdb-7.6.90.20140127/gdb/breakpoint.h 2014-02-06 18:07:58.906915998 +0100 -@@ -242,7 +242,7 @@ struct bp_target_info +--- gdb-7.7.90.20140613.orig/gdb/breakpoint.h 2014-06-24 16:07:27.036986643 +0200 ++++ gdb-7.7.90.20140613/gdb/breakpoint.h 2014-06-24 16:07:27.250986881 +0200 +@@ -244,7 +244,7 @@ struct bp_target_info /* If this is a ranged breakpoint, then this field contains the length of the range that will be watched for execution. */ @@ -1299,7 +1299,7 @@ Index: gdb-7.6.90.20140127/gdb/breakpoint.h /* If the breakpoint lives in memory and reading that memory would give back the breakpoint, instead of the original contents, then -@@ -411,7 +411,7 @@ struct bp_location +@@ -413,7 +413,7 @@ struct bp_location /* For hardware watchpoints, the size of the memory region being watched. For hardware ranged breakpoints, the size of the breakpoint range. */ @@ -1308,10 +1308,10 @@ Index: gdb-7.6.90.20140127/gdb/breakpoint.h /* Type of hardware watchpoint. */ enum target_hw_bp_type watchpoint_type; -Index: gdb-7.6.90.20140127/gdb/c-lang.c +Index: gdb-7.7.90.20140613/gdb/c-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/c-lang.c 2014-02-06 18:07:54.349911101 +0100 -+++ gdb-7.6.90.20140127/gdb/c-lang.c 2014-02-06 18:07:58.907915999 +0100 +--- gdb-7.7.90.20140613.orig/gdb/c-lang.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/c-lang.c 2014-06-24 16:07:27.250986881 +0200 @@ -190,7 +190,7 @@ c_printchar (int c, struct type *type, s void @@ -1339,11 +1339,11 @@ Index: gdb-7.6.90.20140127/gdb/c-lang.c if (get_discrete_bounds (TYPE_INDEX_TYPE (expect_type), &low_bound, &high_bound) < 0) -Index: gdb-7.6.90.20140127/gdb/c-lang.h +Index: gdb-7.7.90.20140613/gdb/c-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/c-lang.h 2014-02-06 18:07:54.349911101 +0100 -+++ gdb-7.6.90.20140127/gdb/c-lang.h 2014-02-06 18:07:58.907915999 +0100 -@@ -73,7 +73,7 @@ extern void c_print_typedef (struct type +--- gdb-7.7.90.20140613.orig/gdb/c-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/c-lang.h 2014-06-24 16:07:27.250986881 +0200 +@@ -74,7 +74,7 @@ extern void c_print_typedef (struct type struct ui_file *); extern void c_val_print (struct type *, const gdb_byte *, @@ -1352,7 +1352,7 @@ Index: gdb-7.6.90.20140127/gdb/c-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -93,7 +93,7 @@ extern void c_printchar (int, struct typ +@@ -94,7 +94,7 @@ extern void c_printchar (int, struct typ extern void c_printstr (struct ui_file * stream, struct type *elttype, const gdb_byte *string, @@ -1361,7 +1361,7 @@ Index: gdb-7.6.90.20140127/gdb/c-lang.h const char *user_encoding, int force_ellipses, const struct value_print_options *options); -@@ -119,14 +119,14 @@ extern void cp_print_class_member (const +@@ -120,14 +120,14 @@ extern void cp_print_class_member (const struct ui_file *, char *); extern void cp_print_value_fields (struct type *, struct type *, @@ -1378,11 +1378,11 @@ Index: gdb-7.6.90.20140127/gdb/c-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *, -Index: gdb-7.6.90.20140127/gdb/c-valprint.c +Index: gdb-7.7.90.20140613/gdb/c-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/c-valprint.c 2014-02-06 18:07:54.349911101 +0100 -+++ gdb-7.6.90.20140127/gdb/c-valprint.c 2014-02-06 18:07:58.907915999 +0100 -@@ -132,7 +132,7 @@ static const struct generic_val_print_de +--- gdb-7.7.90.20140613.orig/gdb/c-valprint.c 2014-06-24 16:07:26.285985810 +0200 ++++ gdb-7.7.90.20140613/gdb/c-valprint.c 2014-06-24 16:07:27.250986881 +0200 +@@ -133,7 +133,7 @@ static const struct generic_val_print_de void c_val_print (struct type *type, const gdb_byte *valaddr, @@ -1391,7 +1391,7 @@ Index: gdb-7.6.90.20140127/gdb/c-valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options) -@@ -143,7 +143,7 @@ c_val_print (struct type *type, const gd +@@ -144,7 +144,7 @@ c_val_print (struct type *type, const gd unsigned len; struct type *elttype, *unresolved_elttype; struct type *unresolved_type = type; @@ -1400,7 +1400,7 @@ Index: gdb-7.6.90.20140127/gdb/c-valprint.c CORE_ADDR addr; CHECK_TYPEDEF (type); -@@ -379,9 +379,9 @@ c_val_print (struct type *type, const gd +@@ -380,9 +380,9 @@ c_val_print (struct type *type, const gd /* Print vtable entry - we only get here if NOT using -fvtable_thunks. (Otherwise, look under TYPE_CODE_PTR.) */ @@ -1413,7 +1413,7 @@ Index: gdb-7.6.90.20140127/gdb/c-valprint.c struct type *field_type = TYPE_FIELD_TYPE (type, VTBL_FNADDR_OFFSET); CORE_ADDR addr -@@ -460,7 +460,8 @@ c_value_print (struct value *val, struct +@@ -461,7 +461,8 @@ c_value_print (struct value *val, struct const struct value_print_options *options) { struct type *type, *real_type, *val_type; @@ -1423,10 +1423,10 @@ Index: gdb-7.6.90.20140127/gdb/c-valprint.c struct value_print_options opts = *options; opts.deref_ref = 1; -Index: gdb-7.6.90.20140127/gdb/cp-abi.c +Index: gdb-7.7.90.20140613/gdb/cp-abi.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/cp-abi.c 2014-02-06 18:07:54.350911103 +0100 -+++ gdb-7.6.90.20140127/gdb/cp-abi.c 2014-02-06 18:07:58.908916001 +0100 +--- gdb-7.7.90.20140613.orig/gdb/cp-abi.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/cp-abi.c 2014-06-24 16:07:27.250986881 +0200 @@ -68,13 +68,13 @@ is_operator_name (const char *name) return (*current_cp_abi.is_operator_name) (name); } @@ -1462,10 +1462,10 @@ Index: gdb-7.6.90.20140127/gdb/cp-abi.c { struct type *ret = NULL; volatile struct gdb_exception e; -Index: gdb-7.6.90.20140127/gdb/cp-abi.h +Index: gdb-7.7.90.20140613/gdb/cp-abi.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/cp-abi.h 2014-02-06 18:07:54.350911103 +0100 -+++ gdb-7.6.90.20140127/gdb/cp-abi.h 2014-02-06 18:07:58.908916001 +0100 +--- gdb-7.7.90.20140613.orig/gdb/cp-abi.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/cp-abi.h 2014-06-24 16:07:27.251986882 +0200 @@ -108,7 +108,7 @@ extern struct value *value_virtual_fn_fi struct fn_field *f, int j, @@ -1520,10 +1520,10 @@ Index: gdb-7.6.90.20140127/gdb/cp-abi.h void (*print_method_ptr) (const gdb_byte *contents, struct type *type, struct ui_file *stream); -Index: gdb-7.6.90.20140127/gdb/cp-valprint.c +Index: gdb-7.7.90.20140613/gdb/cp-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/cp-valprint.c 2014-02-06 18:07:54.350911103 +0100 -+++ gdb-7.6.90.20140127/gdb/cp-valprint.c 2014-02-06 18:07:58.908916001 +0100 +--- gdb-7.7.90.20140613.orig/gdb/cp-valprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/cp-valprint.c 2014-06-24 16:07:27.251986882 +0200 @@ -82,7 +82,7 @@ static void cp_print_static_field (struc const struct value_print_options *); @@ -1570,7 +1570,7 @@ Index: gdb-7.6.90.20140127/gdb/cp-valprint.c /* Ugh, we have to convert back to a value here. */ value = value_from_contents_and_address (type, valaddr + offset, -@@ -462,7 +463,7 @@ cp_print_value_fields_rtti (struct type +@@ -463,7 +464,7 @@ cp_print_value_fields_rtti (struct type static void cp_print_value (struct type *type, struct type *real_type, @@ -1579,7 +1579,7 @@ Index: gdb-7.6.90.20140127/gdb/cp-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -472,7 +473,7 @@ cp_print_value (struct type *type, struc +@@ -473,7 +474,7 @@ cp_print_value (struct type *type, struc = (struct type **) obstack_next_free (&dont_print_vb_obstack); struct obstack tmp_obstack = dont_print_vb_obstack; int i, n_baseclasses = TYPE_N_BASECLASSES (type); @@ -1588,7 +1588,7 @@ Index: gdb-7.6.90.20140127/gdb/cp-valprint.c struct type *thistype; if (dont_print_vb == 0) -@@ -486,7 +487,7 @@ cp_print_value (struct type *type, struc +@@ -487,7 +488,7 @@ cp_print_value (struct type *type, struc for (i = 0; i < n_baseclasses; i++) { @@ -1597,12 +1597,12 @@ Index: gdb-7.6.90.20140127/gdb/cp-valprint.c int skip; struct type *baseclass = check_typedef (TYPE_BASECLASS (type, i)); const char *basename = TYPE_NAME (baseclass); -Index: gdb-7.6.90.20140127/gdb/d-lang.h +Index: gdb-7.7.90.20140613/gdb/d-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/d-lang.h 2014-02-06 18:07:54.351911104 +0100 -+++ gdb-7.6.90.20140127/gdb/d-lang.h 2014-02-06 18:07:58.908916001 +0100 -@@ -25,7 +25,7 @@ - extern char *d_demangle (const char *mangled, int options); +--- gdb-7.7.90.20140613.orig/gdb/d-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/d-lang.h 2014-06-24 16:07:27.251986882 +0200 +@@ -69,7 +69,7 @@ extern const char *d_parse_symbol (struc + /* Defined in d-valprint.c */ extern void d_val_print (struct type *type, const gdb_byte *valaddr, - int embedded_offset, CORE_ADDR address, @@ -1610,10 +1610,10 @@ Index: gdb-7.6.90.20140127/gdb/d-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.6.90.20140127/gdb/d-valprint.c +Index: gdb-7.7.90.20140613/gdb/d-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/d-valprint.c 2014-02-06 18:07:54.351911104 +0100 -+++ gdb-7.6.90.20140127/gdb/d-valprint.c 2014-02-06 18:07:58.909916001 +0100 +--- gdb-7.7.90.20140613.orig/gdb/d-valprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/d-valprint.c 2014-06-24 16:07:27.251986882 +0200 @@ -29,7 +29,7 @@ static int @@ -1623,7 +1623,7 @@ Index: gdb-7.6.90.20140127/gdb/d-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -@@ -71,9 +71,9 @@ dynamic_array_type (struct type *type, c +@@ -72,9 +72,9 @@ dynamic_array_type (struct type *type, c /* Implements the la_val_print routine for language D. */ void @@ -1636,10 +1636,10 @@ Index: gdb-7.6.90.20140127/gdb/d-valprint.c const struct value_print_options *options) { int ret; -Index: gdb-7.6.90.20140127/gdb/doublest.c +Index: gdb-7.7.90.20140613/gdb/doublest.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/doublest.c 2014-02-06 18:07:54.351911104 +0100 -+++ gdb-7.6.90.20140127/gdb/doublest.c 2014-02-06 18:07:58.909916001 +0100 +--- gdb-7.7.90.20140613.orig/gdb/doublest.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/doublest.c 2014-06-24 16:07:27.251986882 +0200 @@ -767,7 +767,7 @@ floatformat_from_doublest (const struct but not passed on by GDB. This should be fixed. */ @@ -1660,11 +1660,11 @@ Index: gdb-7.6.90.20140127/gdb/doublest.c return format; } -Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c +Index: gdb-7.7.90.20140613/gdb/dwarf2loc.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2loc.c 2014-02-06 18:07:54.352911105 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2loc.c 2014-02-06 18:07:58.910916003 +0100 -@@ -1709,19 +1709,19 @@ insert_bits (unsigned int datum, +--- gdb-7.7.90.20140613.orig/gdb/dwarf2loc.c 2014-06-24 16:07:26.387985923 +0200 ++++ gdb-7.7.90.20140613/gdb/dwarf2loc.c 2014-06-24 16:07:27.252986883 +0200 +@@ -1572,19 +1572,19 @@ insert_bits (unsigned int datum, BITS_BIG_ENDIAN is taken directly from gdbarch. */ static void @@ -1690,7 +1690,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c dest_avail = 8 - dest_offset_bits % 8; -@@ -1759,13 +1759,13 @@ static void +@@ -1622,13 +1622,13 @@ static void read_pieced_value (struct value *v) { int i; @@ -1706,7 +1706,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c size_t buffer_size = 0; gdb_byte *buffer = NULL; struct cleanup *cleanup; -@@ -1792,8 +1792,8 @@ read_pieced_value (struct value *v) +@@ -1655,8 +1655,8 @@ read_pieced_value (struct value *v) for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1717,7 +1717,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c const gdb_byte *intermediate_buffer; /* Compute size, source, and destination offsets for copying, in -@@ -1942,13 +1942,13 @@ static void +@@ -1805,13 +1805,13 @@ static void write_pieced_value (struct value *to, struct value *from) { int i; @@ -1733,7 +1733,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c size_t buffer_size = 0; gdb_byte *buffer = NULL; struct cleanup *cleanup; -@@ -1976,8 +1976,8 @@ write_pieced_value (struct value *to, st +@@ -1839,8 +1839,8 @@ write_pieced_value (struct value *to, st for (i = 0; i < c->n_pieces && offset < type_len; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1744,7 +1744,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c int need_bitwise; const gdb_byte *source_buffer; -@@ -2107,8 +2107,8 @@ write_pieced_value (struct value *to, st +@@ -1970,8 +1970,8 @@ write_pieced_value (struct value *to, st implicit pointer. */ static int @@ -1755,7 +1755,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c enum dwarf_value_location check_for) { struct piece_closure *c -@@ -2124,7 +2124,7 @@ check_pieced_value_bits (const struct va +@@ -1987,7 +1987,7 @@ check_pieced_value_bits (const struct va for (i = 0; i < c->n_pieces && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1764,7 +1764,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2162,8 +2162,8 @@ check_pieced_value_bits (const struct va +@@ -2025,8 +2025,8 @@ check_pieced_value_bits (const struct va } static int @@ -1775,7 +1775,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_MEMORY); -@@ -2181,8 +2181,8 @@ check_pieced_value_invalid (const struct +@@ -2044,8 +2044,8 @@ check_pieced_value_invalid (const struct a synthetic pointer. */ static int @@ -1786,7 +1786,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c { return check_pieced_value_bits (value, bit_offset, bit_length, DWARF_VALUE_IMPLICIT_POINTER); -@@ -2207,9 +2207,10 @@ indirect_pieced_value (struct value *val +@@ -2070,9 +2070,10 @@ indirect_pieced_value (struct value *val struct type *type; struct frame_info *frame; struct dwarf2_locexpr_baton baton; @@ -1799,7 +1799,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c type = check_typedef (value_type (value)); if (TYPE_CODE (type) != TYPE_CODE_PTR) -@@ -2223,7 +2224,7 @@ indirect_pieced_value (struct value *val +@@ -2086,7 +2087,7 @@ indirect_pieced_value (struct value *val for (i = 0; i < c->n_pieces && bit_length > 0; i++) { struct dwarf_expr_piece *p = &c->pieces[i]; @@ -1808,7 +1808,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c if (bit_offset > 0) { -@@ -2491,7 +2492,7 @@ dwarf2_evaluate_loc_desc_full (struct ty +@@ -2357,7 +2358,7 @@ dwarf2_evaluate_loc_desc_full (struct ty struct value *value = dwarf_expr_fetch (ctx, 0); gdb_byte *contents; const gdb_byte *val_bytes; @@ -1817,11 +1817,11 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c if (byte_offset + TYPE_LENGTH (type) > n) invalid_synthetic_pointer (); -Index: gdb-7.6.90.20140127/gdb/dwarf2read.c +Index: gdb-7.7.90.20140613/gdb/dwarf2read.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2read.c 2014-02-06 18:07:54.356911109 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2read.c 2014-02-06 18:07:58.913916006 +0100 -@@ -1893,12 +1893,12 @@ dwarf2_complex_location_expr_complaint ( +--- gdb-7.7.90.20140613.orig/gdb/dwarf2read.c 2014-06-24 16:07:27.219986846 +0200 ++++ gdb-7.7.90.20140613/gdb/dwarf2read.c 2014-06-24 16:07:27.255986886 +0200 +@@ -1889,12 +1889,12 @@ dwarf2_complex_location_expr_complaint ( } static void @@ -1838,7 +1838,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2read.c } static void -@@ -12190,8 +12190,8 @@ dwarf2_add_field (struct field_info *fip +@@ -12326,8 +12326,8 @@ dwarf2_add_field (struct field_info *fip object, and then subtract off the number of bits of the field itself. The result is the bit offset of the LSB of the field. */ @@ -1849,11 +1849,11 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2read.c attr = dwarf2_attr (die, DW_AT_byte_size, cu); if (attr) -Index: gdb-7.6.90.20140127/gdb/eval.c +Index: gdb-7.7.90.20140613/gdb/eval.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/eval.c 2014-02-06 18:07:54.358911111 +0100 -+++ gdb-7.6.90.20140127/gdb/eval.c 2014-02-06 18:07:58.914916007 +0100 -@@ -298,7 +298,8 @@ evaluate_struct_tuple (struct value *str +--- gdb-7.7.90.20140613.orig/gdb/eval.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/eval.c 2014-06-24 16:07:27.256986887 +0200 +@@ -297,7 +297,8 @@ evaluate_struct_tuple (struct value *str while (--nargs >= 0) { struct value *val = NULL; @@ -1863,7 +1863,7 @@ Index: gdb-7.6.90.20140127/gdb/eval.c bfd_byte *addr; fieldno++; -@@ -360,7 +361,7 @@ init_array_element (struct value *array, +@@ -359,7 +360,7 @@ init_array_element (struct value *array, enum noside noside, LONGEST low_bound, LONGEST high_bound) { LONGEST index; @@ -1872,7 +1872,7 @@ Index: gdb-7.6.90.20140127/gdb/eval.c if (exp->elts[*pos].opcode == BINOP_COMMA) { -@@ -718,11 +719,11 @@ binop_promote (const struct language_def +@@ -522,11 +523,11 @@ binop_promote (const struct language_def /* FIXME: Also mixed integral/booleans, with result an integer. */ { const struct builtin_type *builtin = builtin_type (gdbarch); @@ -1887,7 +1887,7 @@ Index: gdb-7.6.90.20140127/gdb/eval.c int unsigned_operation; /* Determine type length and signedness after promotion for -@@ -905,7 +906,7 @@ evaluate_subexp_standard (struct type *e +@@ -709,7 +710,7 @@ evaluate_subexp_standard (struct type *e struct value **argvec; int code; int ix; @@ -1896,7 +1896,7 @@ Index: gdb-7.6.90.20140127/gdb/eval.c struct type **arg_types; int save_pos1; struct symbol *function = NULL; -@@ -1085,7 +1086,7 @@ evaluate_subexp_standard (struct type *e +@@ -888,7 +889,7 @@ evaluate_subexp_standard (struct type *e struct type *range_type = TYPE_INDEX_TYPE (type); struct type *element_type = TYPE_TARGET_TYPE (type); struct value *array = allocate_value (expect_type); @@ -1905,7 +1905,7 @@ Index: gdb-7.6.90.20140127/gdb/eval.c LONGEST low_bound, high_bound, index; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -2080,7 +2081,8 @@ evaluate_subexp_standard (struct type *e +@@ -1903,7 +1904,8 @@ evaluate_subexp_standard (struct type *e { struct type *type = value_type (arg1); struct type *real_type; @@ -1915,10 +1915,10 @@ Index: gdb-7.6.90.20140127/gdb/eval.c struct value_print_options opts; get_user_print_options (&opts); -Index: gdb-7.6.90.20140127/gdb/f-lang.c +Index: gdb-7.7.90.20140613/gdb/f-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/f-lang.c 2014-02-06 18:07:54.358911111 +0100 -+++ gdb-7.6.90.20140127/gdb/f-lang.c 2014-02-06 18:07:58.914916007 +0100 +--- gdb-7.7.90.20140613.orig/gdb/f-lang.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/f-lang.c 2014-06-24 16:07:27.256986887 +0200 @@ -104,7 +104,7 @@ f_printchar (int c, struct type *type, s static void @@ -1928,25 +1928,25 @@ Index: gdb-7.6.90.20140127/gdb/f-lang.c const struct value_print_options *options) { const char *type_encoding = f_get_encoding (type); -Index: gdb-7.6.90.20140127/gdb/f-lang.h +Index: gdb-7.7.90.20140613/gdb/f-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/f-lang.h 2014-02-06 18:07:54.358911111 +0100 -+++ gdb-7.6.90.20140127/gdb/f-lang.h 2014-02-06 18:07:58.914916007 +0100 -@@ -33,7 +33,7 @@ extern const char *f_object_address_data - (struct type *type, struct ui_file *stream); - extern void f_object_address_data_valid_or_error (struct type *type); +--- gdb-7.7.90.20140613.orig/gdb/f-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/f-lang.h 2014-06-24 16:07:27.256986887 +0200 +@@ -30,7 +30,7 @@ extern void f_error (char *); /* Defined + extern void f_print_type (struct type *, const char *, struct ui_file *, int, + int, const struct type_print_options *); -extern void f_val_print (struct type *, const gdb_byte *, int, CORE_ADDR, +extern void f_val_print (struct type *, const gdb_byte *, LONGEST, CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.6.90.20140127/gdb/f-valprint.c +Index: gdb-7.7.90.20140613/gdb/f-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/f-valprint.c 2014-02-06 18:07:54.359911112 +0100 -+++ gdb-7.6.90.20140127/gdb/f-valprint.c 2014-02-06 18:07:58.915916008 +0100 -@@ -43,7 +43,7 @@ static void f77_create_arrayprint_offset - struct ui_file *); +--- gdb-7.7.90.20140613.orig/gdb/f-valprint.c 2014-06-24 16:07:26.371985905 +0200 ++++ gdb-7.7.90.20140613/gdb/f-valprint.c 2014-06-24 16:07:27.256986887 +0200 +@@ -41,7 +41,7 @@ extern void _initialize_f_valprint (void + static void info_common_command (char *, int); static void f77_get_dynamic_length_of_aggregate (struct type *); -int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; @@ -1954,16 +1954,18 @@ Index: gdb-7.6.90.20140127/gdb/f-valprint.c /* 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. */ -@@ -126,7 +126,7 @@ static void - f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) +@@ -76,8 +76,8 @@ f77_get_upperbound (struct type *type) + static void + f77_get_dynamic_length_of_aggregate (struct type *type) { - struct type *tmp_type; -- int eltlen; -+ LONGEST eltlen; - int ndimen = 1; - int upper, lower; +- int upper_bound = -1; +- int lower_bound = 1; ++ LONGEST upper_bound = -1; ++ LONGEST lower_bound = 1; -@@ -171,13 +171,13 @@ f77_create_arrayprint_offset_tbl (struct + /* Recursively go all the way down into a possibly multi-dimensional + F77 array and get the bounds. For simple arrays, this is pretty +@@ -109,7 +109,7 @@ f77_get_dynamic_length_of_aggregate (str static void f77_print_array_1 (int nss, int ndimensions, struct type *type, const gdb_byte *valaddr, @@ -1972,14 +1974,16 @@ Index: gdb-7.6.90.20140127/gdb/f-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, - int *elts) - { +@@ -118,7 +118,7 @@ f77_print_array_1 (int nss, int ndimensi + struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type)); + CORE_ADDR addr = address + embedded_offset; + LONGEST lowerbound, upperbound; - int i; + LONGEST i; - if (nss != ndimensions) - { -@@ -220,7 +220,7 @@ f77_print_array_1 (int nss, int ndimensi + get_discrete_bounds (range_type, &lowerbound, &upperbound); + +@@ -175,7 +175,7 @@ f77_print_array_1 (int nss, int ndimensi static void f77_print_array (struct type *type, const gdb_byte *valaddr, @@ -1988,7 +1992,7 @@ Index: gdb-7.6.90.20140127/gdb/f-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -263,8 +263,9 @@ static const struct generic_val_print_de +@@ -212,8 +212,9 @@ static const struct generic_val_print_de function; they are identical. */ void @@ -2000,29 +2004,20 @@ Index: gdb-7.6.90.20140127/gdb/f-valprint.c const struct value *original_value, const struct value_print_options *options) { -@@ -389,7 +390,7 @@ f_val_print (struct type *type, const gd - fprintf_filtered (stream, "( "); - for (index = 0; index < TYPE_NFIELDS (type); index++) - { -- int offset = TYPE_FIELD_BITPOS (type, index) / 8; -+ LONGEST offset = TYPE_FIELD_BITPOS (type, index) / 8; - - val_print (TYPE_FIELD_TYPE (type, index), valaddr, - embedded_offset + offset, -Index: gdb-7.6.90.20140127/gdb/findvar.c +Index: gdb-7.7.90.20140613/gdb/findvar.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/findvar.c 2014-02-06 18:07:54.359911112 +0100 -+++ gdb-7.6.90.20140127/gdb/findvar.c 2014-02-06 18:07:58.915916008 +0100 -@@ -623,7 +623,7 @@ default_value_from_register (struct type - struct frame_info *frame) +--- gdb-7.7.90.20140613.orig/gdb/findvar.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/findvar.c 2014-06-24 16:07:27.256986887 +0200 +@@ -628,7 +628,7 @@ struct value * + default_value_from_register (struct gdbarch *gdbarch, struct type *type, + int regnum, struct frame_id frame_id) { - struct gdbarch *gdbarch = get_frame_arch (frame); - int len = TYPE_LENGTH (type); + LONGEST len = TYPE_LENGTH (type); struct value *value = allocate_value (type); VALUE_LVAL (value) = lval_register; -@@ -656,10 +656,10 @@ void +@@ -661,10 +661,10 @@ void read_frame_register_value (struct value *value, struct frame_info *frame) { struct gdbarch *gdbarch = get_frame_arch (frame); @@ -2036,7 +2031,7 @@ Index: gdb-7.6.90.20140127/gdb/findvar.c gdb_assert (VALUE_LVAL (value) == lval_register); -@@ -674,7 +674,7 @@ read_frame_register_value (struct value +@@ -679,7 +679,7 @@ read_frame_register_value (struct value while (len > 0) { struct value *regval = get_frame_register_value (frame, regnum); @@ -2045,11 +2040,11 @@ Index: gdb-7.6.90.20140127/gdb/findvar.c if (value_optimized_out (regval)) { -Index: gdb-7.6.90.20140127/gdb/frame.c +Index: gdb-7.7.90.20140613/gdb/frame.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/frame.c 2014-02-06 18:07:54.360911113 +0100 -+++ gdb-7.6.90.20140127/gdb/frame.c 2014-02-06 18:07:58.915916008 +0100 -@@ -1247,7 +1247,7 @@ deprecated_frame_register_read (struct f +--- gdb-7.7.90.20140613.orig/gdb/frame.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/frame.c 2014-06-24 16:07:27.257986888 +0200 +@@ -1272,7 +1272,7 @@ deprecated_frame_register_read (struct f int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2058,7 +2053,7 @@ Index: gdb-7.6.90.20140127/gdb/frame.c int *optimizedp, int *unavailablep) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -1276,7 +1276,7 @@ get_frame_register_bytes (struct frame_i +@@ -1301,7 +1301,7 @@ get_frame_register_bytes (struct frame_i } if (len > maxsize) error (_("Bad debug information detected: " @@ -2067,11 +2062,11 @@ Index: gdb-7.6.90.20140127/gdb/frame.c /* Copy the data. */ while (len > 0) -Index: gdb-7.6.90.20140127/gdb/frame.h +Index: gdb-7.7.90.20140613/gdb/frame.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/frame.h 2014-02-06 18:07:54.360911113 +0100 -+++ gdb-7.6.90.20140127/gdb/frame.h 2014-02-06 18:07:58.916916009 +0100 -@@ -556,7 +556,7 @@ extern void put_frame_register (struct f +--- gdb-7.7.90.20140613.orig/gdb/frame.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/frame.h 2014-06-24 16:07:27.257986888 +0200 +@@ -583,7 +583,7 @@ extern void put_frame_register (struct f contents are optimized out or unavailable, set *OPTIMIZEDP, *UNAVAILABLEP accordingly. */ extern int get_frame_register_bytes (struct frame_info *frame, int regnum, @@ -2080,11 +2075,11 @@ Index: gdb-7.6.90.20140127/gdb/frame.h gdb_byte *myaddr, int *optimizedp, int *unavailablep); -Index: gdb-7.6.90.20140127/gdb/gdbtypes.c +Index: gdb-7.7.90.20140613/gdb/gdbtypes.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbtypes.c 2014-02-06 18:07:54.361911114 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbtypes.c 2014-02-06 18:07:58.916916009 +0100 -@@ -2108,7 +2108,7 @@ allocate_gnat_aux_type (struct type *typ +--- gdb-7.7.90.20140613.orig/gdb/gdbtypes.c 2014-06-24 16:07:26.410985949 +0200 ++++ gdb-7.7.90.20140613/gdb/gdbtypes.c 2014-06-24 16:07:27.258986890 +0200 +@@ -2463,7 +2463,7 @@ allocate_gnat_aux_type (struct type *typ least as long as OBJFILE. */ struct type * @@ -2093,7 +2088,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c const char *name, struct objfile *objfile) { struct type *type; -@@ -2339,8 +2339,8 @@ is_public_ancestor (struct type *base, s +@@ -2694,8 +2694,8 @@ is_public_ancestor (struct type *base, s static int is_unique_ancestor_worker (struct type *base, struct type *dclass, @@ -2104,7 +2099,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c CORE_ADDR address, struct value *val) { int i, count = 0; -@@ -2351,7 +2351,7 @@ is_unique_ancestor_worker (struct type * +@@ -2706,7 +2706,7 @@ is_unique_ancestor_worker (struct type * for (i = 0; i < TYPE_N_BASECLASSES (dclass) && count < 2; ++i) { struct type *iter; @@ -2113,7 +2108,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c iter = check_typedef (TYPE_BASECLASS (dclass, i)); -@@ -2392,7 +2392,7 @@ is_unique_ancestor_worker (struct type * +@@ -2747,7 +2747,7 @@ is_unique_ancestor_worker (struct type * int is_unique_ancestor (struct type *base, struct value *val) { @@ -2122,7 +2117,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c return is_unique_ancestor_worker (base, value_type (val), &offset, value_contents_for_printing (val), -@@ -3530,7 +3530,7 @@ recursive_dump_type (struct type *type, +@@ -3891,7 +3891,7 @@ recursive_dump_type (struct type *type, break; } puts_filtered ("\n"); @@ -2131,7 +2126,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c if (TYPE_OBJFILE_OWNED (type)) { printfi_filtered (spaces, "objfile "); -@@ -3654,8 +3654,8 @@ recursive_dump_type (struct type *type, +@@ -4015,8 +4015,8 @@ recursive_dump_type (struct type *type, idx, plongest (TYPE_FIELD_ENUMVAL (type, idx))); else printfi_filtered (spaces + 2, @@ -2142,7 +2137,7 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c TYPE_FIELD_BITSIZE (type, idx)); gdb_print_host_address (TYPE_FIELD_TYPE (type, idx), gdb_stdout); printf_filtered (" name '%s' (", -@@ -4169,7 +4169,7 @@ copy_type (const struct type *type) +@@ -4357,7 +4357,7 @@ copy_type (const struct type *type) struct type * arch_type (struct gdbarch *gdbarch, @@ -2151,32 +2146,32 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.c { struct type *type; -Index: gdb-7.6.90.20140127/gdb/gdbtypes.h +Index: gdb-7.7.90.20140613/gdb/gdbtypes.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gdbtypes.h 2014-02-06 18:07:54.362911115 +0100 -+++ gdb-7.6.90.20140127/gdb/gdbtypes.h 2014-02-06 18:11:46.431160650 +0100 -@@ -606,7 +606,7 @@ struct main_type +--- gdb-7.7.90.20140613.orig/gdb/gdbtypes.h 2014-06-24 16:07:27.024986630 +0200 ++++ gdb-7.7.90.20140613/gdb/gdbtypes.h 2014-06-24 16:07:27.258986890 +0200 +@@ -608,7 +608,7 @@ struct main_type gdbarch_bits_big_endian=0 targets, it is the bit offset to the LSB. */ - int bitpos; + LONGEST bitpos; - /* Enum value. */ + /* * Enum value. */ LONGEST enumval; -@@ -798,7 +798,7 @@ struct type +@@ -810,7 +810,7 @@ struct type HOST_CHAR_BIT. However, this would still fail to address machines based on a ternary or decimal representation. */ - unsigned length; + ULONGEST length; - /* Core type, shared by a group of qualified types. */ - struct main_type *main_type; -@@ -1546,11 +1546,12 @@ extern struct gdbarch *get_type_arch (co - extern struct type *get_target_type (struct type *type); + /* * Core type, shared by a group of qualified types. */ + +@@ -1640,11 +1640,12 @@ extern struct type *get_target_type (str + + /* * Helper function to construct objfile-owned types. */ - /* Helper function to construct objfile-owned types. */ -extern struct type *init_type (enum type_code, int, int, const char *, +extern struct type *init_type (enum type_code, LONGEST, int, const char *, struct objfile *); @@ -2188,10 +2183,10 @@ Index: gdb-7.6.90.20140127/gdb/gdbtypes.h extern struct type *arch_integer_type (struct gdbarch *, int, int, char *); extern struct type *arch_character_type (struct gdbarch *, int, int, char *); extern struct type *arch_boolean_type (struct gdbarch *, int, int, char *); -Index: gdb-7.6.90.20140127/gdb/gnu-v2-abi.c +Index: gdb-7.7.90.20140613/gdb/gnu-v2-abi.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gnu-v2-abi.c 2014-02-06 18:07:54.362911115 +0100 -+++ gdb-7.6.90.20140127/gdb/gnu-v2-abi.c 2014-02-06 18:07:58.917916010 +0100 +--- gdb-7.7.90.20140613.orig/gdb/gnu-v2-abi.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/gnu-v2-abi.c 2014-06-24 16:07:27.258986890 +0200 @@ -85,7 +85,7 @@ gnuv2_is_operator_name (const char *name TYPE is the type in which F is located. */ static struct value * @@ -2243,10 +2238,10 @@ Index: gdb-7.6.90.20140127/gdb/gnu-v2-abi.c gnuv2_baseclass_offset (type, i, valaddr, embedded_offset, address, val); -Index: gdb-7.6.90.20140127/gdb/gnu-v3-abi.c +Index: gdb-7.7.90.20140613/gdb/gnu-v3-abi.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/gnu-v3-abi.c 2014-02-06 18:07:54.363911116 +0100 -+++ gdb-7.6.90.20140127/gdb/gnu-v3-abi.c 2014-02-06 18:07:58.918916011 +0100 +--- gdb-7.7.90.20140613.orig/gdb/gnu-v3-abi.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/gnu-v3-abi.c 2014-06-24 16:07:27.259986891 +0200 @@ -112,7 +112,7 @@ build_gdb_vtable_type (struct gdbarch *a { struct type *t; @@ -2321,11 +2316,11 @@ Index: gdb-7.6.90.20140127/gdb/gnu-v3-abi.c struct type *basetype; if (BASETYPE_VIA_VIRTUAL (domain, i)) -Index: gdb-7.6.90.20140127/gdb/go-lang.h +Index: gdb-7.7.90.20140613/gdb/go-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/go-lang.h 2014-02-06 18:07:54.363911116 +0100 -+++ gdb-7.6.90.20140127/gdb/go-lang.h 2014-02-06 18:07:58.918916011 +0100 -@@ -83,7 +83,7 @@ extern void go_print_type (struct type * +--- gdb-7.7.90.20140613.orig/gdb/go-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/go-lang.h 2014-06-24 16:07:27.259986891 +0200 +@@ -85,7 +85,7 @@ extern void go_print_type (struct type * /* Defined in go-valprint.c. */ extern void go_val_print (struct type *type, const gdb_byte *valaddr, @@ -2334,10 +2329,10 @@ Index: gdb-7.6.90.20140127/gdb/go-lang.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.6.90.20140127/gdb/go-valprint.c +Index: gdb-7.7.90.20140613/gdb/go-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/go-valprint.c 2014-02-06 18:07:54.363911116 +0100 -+++ gdb-7.6.90.20140127/gdb/go-valprint.c 2014-02-06 18:07:58.918916011 +0100 +--- gdb-7.7.90.20140613.orig/gdb/go-valprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/go-valprint.c 2014-06-24 16:07:27.259986891 +0200 @@ -37,7 +37,7 @@ static void @@ -2360,10 +2355,10 @@ Index: gdb-7.6.90.20140127/gdb/go-valprint.c const struct value_print_options *options) { CHECK_TYPEDEF (type); -Index: gdb-7.6.90.20140127/gdb/i386-nat.c +Index: gdb-7.7.90.20140613/gdb/i386-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/i386-nat.c 2014-02-06 18:07:54.363911116 +0100 -+++ gdb-7.6.90.20140127/gdb/i386-nat.c 2014-02-06 18:07:58.918916011 +0100 +--- gdb-7.7.90.20140613.orig/gdb/i386-nat.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/i386-nat.c 2014-06-24 16:07:27.259986891 +0200 @@ -290,7 +290,7 @@ static int i386_remove_aligned_watchpoin valid value, bombs through internal_error. */ static int i386_handle_nonaligned_watchpoint (struct i386_debug_reg_state *state, @@ -2384,32 +2379,32 @@ Index: gdb-7.6.90.20140127/gdb/i386-nat.c { int retval = 0; int max_wp_len = TARGET_HAS_DR_LEN_8 ? 8 : 4; -@@ -662,7 +662,7 @@ i386_remove_watchpoint (CORE_ADDR addr, - address ADDR and whose length is LEN bytes. */ +@@ -665,7 +665,7 @@ i386_remove_watchpoint (struct target_op static int --i386_region_ok_for_watchpoint (CORE_ADDR addr, int len) -+i386_region_ok_for_watchpoint (CORE_ADDR addr, LONGEST len) + i386_region_ok_for_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { struct i386_debug_reg_state *state = i386_debug_reg_state (ptid_get_pid (inferior_ptid)); -Index: gdb-7.6.90.20140127/gdb/inf-ttrace.c +Index: gdb-7.7.90.20140613/gdb/inf-ttrace.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/inf-ttrace.c 2014-02-06 18:07:54.364911117 +0100 -+++ gdb-7.6.90.20140127/gdb/inf-ttrace.c 2014-02-06 18:07:58.918916011 +0100 -@@ -365,7 +365,7 @@ inf_ttrace_can_use_hw_breakpoint (int ty - } +--- gdb-7.7.90.20140613.orig/gdb/inf-ttrace.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/inf-ttrace.c 2014-06-24 16:07:27.259986891 +0200 +@@ -369,7 +369,7 @@ inf_ttrace_can_use_hw_breakpoint (struct static int --inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+inf_ttrace_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + inf_ttrace_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { return 1; } -Index: gdb-7.6.90.20140127/gdb/jv-lang.c +Index: gdb-7.7.90.20140613/gdb/jv-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/jv-lang.c 2014-02-06 18:07:54.364911117 +0100 -+++ gdb-7.6.90.20140127/gdb/jv-lang.c 2014-02-06 18:07:58.919916012 +0100 +--- gdb-7.7.90.20140613.orig/gdb/jv-lang.c 2014-06-24 16:07:27.025986631 +0200 ++++ gdb-7.7.90.20140613/gdb/jv-lang.c 2014-06-24 16:07:27.260986892 +0200 @@ -436,7 +436,7 @@ java_link_class_type (struct gdbarch *gd for (i = TYPE_N_BASECLASSES (type); i < nfields; i++) { @@ -2428,11 +2423,11 @@ Index: gdb-7.6.90.20140127/gdb/jv-lang.c const struct value_print_options *options) { const char *type_encoding = java_get_encoding (type); -Index: gdb-7.6.90.20140127/gdb/jv-lang.h +Index: gdb-7.7.90.20140613/gdb/jv-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/jv-lang.h 2014-02-06 18:07:54.364911117 +0100 -+++ gdb-7.6.90.20140127/gdb/jv-lang.h 2014-02-06 18:07:58.919916012 +0100 -@@ -42,8 +42,8 @@ struct builtin_java_type +--- gdb-7.7.90.20140613.orig/gdb/jv-lang.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/jv-lang.h 2014-06-24 16:07:27.260986892 +0200 +@@ -43,8 +43,8 @@ struct builtin_java_type extern const struct builtin_java_type *builtin_java_type (struct gdbarch *); @@ -2443,11 +2438,11 @@ Index: gdb-7.6.90.20140127/gdb/jv-lang.h const struct value *, const struct value_print_options *); -Index: gdb-7.6.90.20140127/gdb/jv-valprint.c +Index: gdb-7.7.90.20140613/gdb/jv-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/jv-valprint.c 2014-02-06 18:07:54.365911119 +0100 -+++ gdb-7.6.90.20140127/gdb/jv-valprint.c 2014-02-06 18:07:58.919916012 +0100 -@@ -266,7 +266,7 @@ java_value_print (struct value *val, str +--- gdb-7.7.90.20140613.orig/gdb/jv-valprint.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/jv-valprint.c 2014-06-24 16:07:27.260986892 +0200 +@@ -267,7 +267,7 @@ java_value_print (struct value *val, str static void java_print_value_fields (struct type *type, const gdb_byte *valaddr, @@ -2456,7 +2451,7 @@ Index: gdb-7.6.90.20140127/gdb/jv-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -459,7 +459,7 @@ java_print_value_fields (struct type *ty +@@ -460,7 +460,7 @@ java_print_value_fields (struct type *ty void java_val_print (struct type *type, const gdb_byte *valaddr, @@ -2465,10 +2460,10 @@ Index: gdb-7.6.90.20140127/gdb/jv-valprint.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.6.90.20140127/gdb/language.c +Index: gdb-7.7.90.20140613/gdb/language.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/language.c 2014-02-06 18:07:54.365911119 +0100 -+++ gdb-7.6.90.20140127/gdb/language.c 2014-02-06 18:07:58.919916012 +0100 +--- gdb-7.7.90.20140613.orig/gdb/language.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/language.c 2014-06-24 16:07:27.260986892 +0200 @@ -722,7 +722,7 @@ unk_lang_printchar (int c, struct type * static void @@ -2487,11 +2482,11 @@ Index: gdb-7.6.90.20140127/gdb/language.c struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options) -Index: gdb-7.6.90.20140127/gdb/language.h +Index: gdb-7.7.90.20140613/gdb/language.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/language.h 2014-02-06 18:07:54.365911119 +0100 -+++ gdb-7.6.90.20140127/gdb/language.h 2014-02-06 18:07:58.919916012 +0100 -@@ -182,7 +182,7 @@ struct language_defn +--- gdb-7.7.90.20140613.orig/gdb/language.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/language.h 2014-06-24 16:07:27.260986892 +0200 +@@ -183,7 +183,7 @@ struct language_defn struct ui_file * stream); void (*la_printstr) (struct ui_file * stream, struct type *elttype, @@ -2500,7 +2495,7 @@ Index: gdb-7.6.90.20140127/gdb/language.h const char *encoding, int force_ellipses, const struct value_print_options *); -@@ -224,7 +224,7 @@ struct language_defn +@@ -225,7 +225,7 @@ struct language_defn void (*la_val_print) (struct type *type, const gdb_byte *contents, @@ -2509,10 +2504,10 @@ Index: gdb-7.6.90.20140127/gdb/language.h struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options); -Index: gdb-7.6.90.20140127/gdb/m2-lang.c +Index: gdb-7.7.90.20140613/gdb/m2-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m2-lang.c 2014-02-06 18:07:54.366911120 +0100 -+++ gdb-7.6.90.20140127/gdb/m2-lang.c 2014-02-06 18:07:58.920916013 +0100 +--- gdb-7.7.90.20140613.orig/gdb/m2-lang.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/m2-lang.c 2014-06-24 16:07:27.261986893 +0200 @@ -104,10 +104,10 @@ m2_printchar (int c, struct type *type, static void @@ -2547,11 +2542,11 @@ Index: gdb-7.6.90.20140127/gdb/m2-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.6.90.20140127/gdb/m2-lang.h +Index: gdb-7.7.90.20140613/gdb/m2-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m2-lang.h 2014-02-06 18:07:54.366911120 +0100 -+++ gdb-7.6.90.20140127/gdb/m2-lang.h 2014-02-06 18:07:58.920916013 +0100 -@@ -33,7 +33,7 @@ extern void m2_print_typedef (struct typ +--- gdb-7.7.90.20140613.orig/gdb/m2-lang.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/m2-lang.h 2014-06-24 16:07:27.261986893 +0200 +@@ -34,7 +34,7 @@ extern void m2_print_typedef (struct typ extern int m2_is_long_set (struct type *type); extern int m2_is_unbounded_array (struct type *type); @@ -2560,10 +2555,10 @@ Index: gdb-7.6.90.20140127/gdb/m2-lang.h struct ui_file *, int, const struct value *, const struct value_print_options *); -Index: gdb-7.6.90.20140127/gdb/m2-typeprint.c +Index: gdb-7.7.90.20140613/gdb/m2-typeprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m2-typeprint.c 2014-02-06 18:07:54.366911120 +0100 -+++ gdb-7.6.90.20140127/gdb/m2-typeprint.c 2014-02-06 18:07:58.920916013 +0100 +--- gdb-7.7.90.20140613.orig/gdb/m2-typeprint.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/m2-typeprint.c 2014-06-24 16:07:27.261986893 +0200 @@ -233,9 +233,12 @@ static void m2_array (struct type *type, m2_print_bounds (TYPE_INDEX_TYPE (type), stream, show, -1, 1); } @@ -2580,10 +2575,10 @@ Index: gdb-7.6.90.20140127/gdb/m2-typeprint.c } fprintf_filtered (stream, "] OF "); m2_print_type (TYPE_TARGET_TYPE (type), "", stream, show, level, flags); -Index: gdb-7.6.90.20140127/gdb/m2-valprint.c +Index: gdb-7.7.90.20140613/gdb/m2-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m2-valprint.c 2014-02-06 18:07:54.366911120 +0100 -+++ gdb-7.6.90.20140127/gdb/m2-valprint.c 2014-02-06 18:07:58.920916013 +0100 +--- gdb-7.7.90.20140613.orig/gdb/m2-valprint.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/m2-valprint.c 2014-06-24 16:07:27.261986893 +0200 @@ -35,7 +35,7 @@ static int print_unpacked_pointer (struc struct ui_file *stream); static void @@ -2649,10 +2644,10 @@ Index: gdb-7.6.90.20140127/gdb/m2-valprint.c /* Look for a NULL char. */ for (temp_len = 0; -Index: gdb-7.6.90.20140127/gdb/memrange.c +Index: gdb-7.7.90.20140613/gdb/memrange.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/memrange.c 2014-02-06 18:07:54.366911120 +0100 -+++ gdb-7.6.90.20140127/gdb/memrange.c 2014-02-06 18:07:58.920916013 +0100 +--- gdb-7.7.90.20140613.orig/gdb/memrange.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/memrange.c 2014-06-24 16:07:27.261986893 +0200 @@ -21,8 +21,8 @@ #include "memrange.h" @@ -2664,10 +2659,10 @@ Index: gdb-7.6.90.20140127/gdb/memrange.c { ULONGEST h, l; -Index: gdb-7.6.90.20140127/gdb/memrange.h +Index: gdb-7.7.90.20140613/gdb/memrange.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/memrange.h 2014-02-06 18:07:54.367911121 +0100 -+++ gdb-7.6.90.20140127/gdb/memrange.h 2014-02-06 18:07:58.921916014 +0100 +--- gdb-7.7.90.20140613.orig/gdb/memrange.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/memrange.h 2014-06-24 16:07:27.261986893 +0200 @@ -30,7 +30,7 @@ struct mem_range CORE_ADDR start; @@ -2688,23 +2683,23 @@ Index: gdb-7.6.90.20140127/gdb/memrange.h /* Sort ranges by start address, then coalesce contiguous or overlapping ranges. */ -Index: gdb-7.6.90.20140127/gdb/mips-linux-nat.c +Index: gdb-7.7.90.20140613/gdb/mips-linux-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/mips-linux-nat.c 2014-02-06 18:07:54.367911121 +0100 -+++ gdb-7.6.90.20140127/gdb/mips-linux-nat.c 2014-02-06 18:07:58.921916014 +0100 -@@ -588,7 +588,7 @@ mips_linux_stopped_data_address (struct - the specified region can be covered by the watch registers. */ +--- gdb-7.7.90.20140613.orig/gdb/mips-linux-nat.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/mips-linux-nat.c 2014-06-24 16:07:27.262986894 +0200 +@@ -590,7 +590,7 @@ mips_linux_stopped_data_address (struct static int --mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+mips_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + mips_linux_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { struct pt_watch_regs dummy_regs; int i; -Index: gdb-7.6.90.20140127/gdb/opencl-lang.c +Index: gdb-7.7.90.20140613/gdb/opencl-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/opencl-lang.c 2014-02-06 18:07:54.367911121 +0100 -+++ gdb-7.6.90.20140127/gdb/opencl-lang.c 2014-02-06 18:07:58.921916014 +0100 +--- gdb-7.7.90.20140613.orig/gdb/opencl-lang.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/opencl-lang.c 2014-06-24 16:07:27.262986894 +0200 @@ -80,11 +80,11 @@ builtin_opencl_type (struct gdbarch *gdb static struct type * @@ -2831,10 +2826,10 @@ Index: gdb-7.6.90.20140127/gdb/opencl-lang.c if (!value_bits_synthetic_pointer (c->val, c->indices[i] * elsize + comp_offset, -Index: gdb-7.6.90.20140127/gdb/p-lang.c +Index: gdb-7.7.90.20140613/gdb/p-lang.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/p-lang.c 2014-02-06 18:07:54.368911122 +0100 -+++ gdb-7.6.90.20140127/gdb/p-lang.c 2014-02-06 18:07:58.921916014 +0100 +--- gdb-7.7.90.20140613.orig/gdb/p-lang.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/p-lang.c 2014-06-24 16:07:27.262986894 +0200 @@ -96,8 +96,8 @@ pascal_main_name (void) are not multiple of TARGET_CHAR_BIT then the results are wrong but this does not happen for Free Pascal nor for GPC. */ @@ -2882,11 +2877,11 @@ Index: gdb-7.6.90.20140127/gdb/p-lang.c i = rep1 - 1; things_printed += options->repeat_count_threshold; need_comma = 1; -Index: gdb-7.6.90.20140127/gdb/p-lang.h +Index: gdb-7.7.90.20140613/gdb/p-lang.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/p-lang.h 2014-02-06 18:07:54.368911122 +0100 -+++ gdb-7.6.90.20140127/gdb/p-lang.h 2014-02-06 18:07:58.922916016 +0100 -@@ -35,7 +35,7 @@ extern void pascal_print_type (struct ty +--- gdb-7.7.90.20140613.orig/gdb/p-lang.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/p-lang.h 2014-06-24 16:07:27.262986894 +0200 +@@ -36,7 +36,7 @@ extern void pascal_print_type (struct ty extern void pascal_print_typedef (struct type *, struct symbol *, struct ui_file *); @@ -2895,7 +2890,7 @@ Index: gdb-7.6.90.20140127/gdb/p-lang.h CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *); -@@ -49,13 +49,13 @@ extern void pascal_type_print_method_arg +@@ -50,13 +50,13 @@ extern void pascal_type_print_method_arg /* These are in p-lang.c: */ extern int @@ -2911,7 +2906,7 @@ Index: gdb-7.6.90.20140127/gdb/p-lang.h const struct value_print_options *); extern struct type **const (pascal_builtin_types[]); -@@ -71,7 +71,7 @@ extern void +@@ -72,7 +72,7 @@ extern void const struct type_print_options *); extern void pascal_object_print_value_fields (struct type *, const gdb_byte *, @@ -2920,10 +2915,10 @@ Index: gdb-7.6.90.20140127/gdb/p-lang.h CORE_ADDR, struct ui_file *, int, const struct value *, -Index: gdb-7.6.90.20140127/gdb/p-valprint.c +Index: gdb-7.7.90.20140613/gdb/p-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/p-valprint.c 2014-02-06 18:07:54.368911122 +0100 -+++ gdb-7.6.90.20140127/gdb/p-valprint.c 2014-02-06 18:07:58.922916016 +0100 +--- gdb-7.7.90.20140613.orig/gdb/p-valprint.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/p-valprint.c 2014-06-24 16:07:27.262986894 +0200 @@ -58,7 +58,7 @@ static const struct generic_val_print_de void @@ -2944,7 +2939,7 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c struct type *char_type; CORE_ADDR addr; int want_space = 0; -@@ -494,7 +494,7 @@ static void pascal_object_print_static_f +@@ -468,7 +468,7 @@ static void pascal_object_print_static_f const struct value_print_options *); static void pascal_object_print_value (struct type *, const gdb_byte *, @@ -2953,7 +2948,7 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c CORE_ADDR, struct ui_file *, int, const struct value *, const struct value_print_options *, -@@ -553,7 +553,7 @@ pascal_object_is_vtbl_member (struct typ +@@ -527,7 +527,7 @@ pascal_object_is_vtbl_member (struct typ void pascal_object_print_value_fields (struct type *type, const gdb_byte *valaddr, @@ -2962,7 +2957,7 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -729,7 +729,7 @@ pascal_object_print_value_fields (struct +@@ -703,7 +703,7 @@ pascal_object_print_value_fields (struct static void pascal_object_print_value (struct type *type, const gdb_byte *valaddr, @@ -2971,7 +2966,7 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, -@@ -752,11 +752,11 @@ pascal_object_print_value (struct type * +@@ -726,11 +726,11 @@ pascal_object_print_value (struct type * for (i = 0; i < n_baseclasses; i++) { @@ -2985,24 +2980,24 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c volatile struct gdb_exception ex; int skip = 0; -Index: gdb-7.6.90.20140127/gdb/ppc-linux-nat.c +Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ppc-linux-nat.c 2014-02-06 18:07:54.369911123 +0100 -+++ gdb-7.6.90.20140127/gdb/ppc-linux-nat.c 2014-02-06 18:07:58.922916016 +0100 -@@ -1496,7 +1496,7 @@ ppc_linux_can_use_hw_breakpoint (int typ - } +--- gdb-7.7.90.20140613.orig/gdb/ppc-linux-nat.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/ppc-linux-nat.c 2014-06-24 16:07:27.263986895 +0200 +@@ -1498,7 +1498,7 @@ ppc_linux_can_use_hw_breakpoint (struct static int --ppc_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+ppc_linux_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + ppc_linux_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { /* Handle sub-8-byte quantities. */ if (len <= 0) -Index: gdb-7.6.90.20140127/gdb/printcmd.c +Index: gdb-7.7.90.20140613/gdb/printcmd.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/printcmd.c 2014-02-06 18:07:54.370911124 +0100 -+++ gdb-7.6.90.20140127/gdb/printcmd.c 2014-02-06 18:07:58.923916017 +0100 -@@ -289,7 +289,7 @@ print_formatted (struct value *val, int +--- gdb-7.7.90.20140613.orig/gdb/printcmd.c 2014-06-24 16:07:26.640986204 +0200 ++++ gdb-7.7.90.20140613/gdb/printcmd.c 2014-06-24 16:07:27.263986895 +0200 +@@ -288,7 +288,7 @@ print_formatted (struct value *val, int struct ui_file *stream) { struct type *type = check_typedef (value_type (val)); @@ -3011,7 +3006,7 @@ Index: gdb-7.6.90.20140127/gdb/printcmd.c if (VALUE_LVAL (val) == lval_memory) next_address = value_address (val) + len; -@@ -367,7 +367,7 @@ print_scalar_formatted (const void *vala +@@ -366,7 +366,7 @@ print_scalar_formatted (const void *vala { struct gdbarch *gdbarch = get_type_arch (type); LONGEST val_long = 0; @@ -3020,58 +3015,36 @@ Index: gdb-7.6.90.20140127/gdb/printcmd.c enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); /* String printing should go through val_print_scalar_formatted. */ -Index: gdb-7.6.90.20140127/gdb/procfs.c +Index: gdb-7.7.90.20140613/gdb/procfs.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/procfs.c 2014-02-06 18:07:54.370911124 +0100 -+++ gdb-7.6.90.20140127/gdb/procfs.c 2014-02-06 18:07:58.924916018 +0100 -@@ -4924,7 +4924,7 @@ procfs_remove_watchpoint (CORE_ADDR addr - } +--- gdb-7.7.90.20140613.orig/gdb/procfs.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/procfs.c 2014-06-24 16:07:27.264986896 +0200 +@@ -4916,7 +4916,7 @@ procfs_remove_watchpoint (struct target_ static int --procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+procfs_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + procfs_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { /* The man page for proc(4) on Solaris 2.6 and up says that the system can support "thousands" of hardware watchpoints, but gives -Index: gdb-7.6.90.20140127/gdb/python/py-prettyprint.c +Index: gdb-7.7.90.20140613/gdb/python/py-prettyprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/python/py-prettyprint.c 2014-02-06 18:07:54.371911125 +0100 -+++ gdb-7.6.90.20140127/gdb/python/py-prettyprint.c 2014-02-06 18:07:58.924916018 +0100 -@@ -688,7 +688,7 @@ print_children (PyObject *printer, const - - int - apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value *val, - const struct value_print_options *options, -@@ -843,7 +843,7 @@ gdbpy_default_visualizer (PyObject *self - - int - apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value *val, - const struct value_print_options *options, -Index: gdb-7.6.90.20140127/gdb/python/python.h +--- gdb-7.7.90.20140613.orig/gdb/python/py-prettyprint.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/python/py-prettyprint.c 2014-06-24 16:07:27.264986896 +0200 +@@ -687,7 +687,7 @@ print_children (PyObject *printer, const + enum ext_lang_rc + gdbpy_apply_val_pretty_printer (const struct extension_language_defn *extlang, + struct type *type, const gdb_byte *valaddr, +- int embedded_offset, CORE_ADDR address, ++ LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, + const struct value *val, + const struct value_print_options *options, +Index: gdb-7.7.90.20140613/gdb/regcache.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/python/python.h 2014-02-06 18:07:54.371911125 +0100 -+++ gdb-7.6.90.20140127/gdb/python/python.h 2014-02-06 18:07:58.924916018 +0100 -@@ -111,7 +111,7 @@ void source_python_script (FILE *file, c - void run_python_script (int argc, char **argv); - - int apply_val_pretty_printer (struct type *type, const gdb_byte *valaddr, -- int embedded_offset, CORE_ADDR address, -+ LONGEST embedded_offset, CORE_ADDR address, - struct ui_file *stream, int recurse, - const struct value *val, - const struct value_print_options *options, -Index: gdb-7.6.90.20140127/gdb/regcache.c -=================================================================== ---- gdb-7.6.90.20140127.orig/gdb/regcache.c 2014-02-06 18:07:54.372911126 +0100 -+++ gdb-7.6.90.20140127/gdb/regcache.c 2014-02-06 18:07:58.924916018 +0100 +--- gdb-7.7.90.20140613.orig/gdb/regcache.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/regcache.c 2014-06-24 16:07:27.264986896 +0200 @@ -899,7 +899,7 @@ typedef void (regcache_write_ftype) (str static enum register_status @@ -3117,10 +3090,10 @@ Index: gdb-7.6.90.20140127/gdb/regcache.c { struct regcache_descr *descr = regcache->descr; -Index: gdb-7.6.90.20140127/gdb/regcache.h +Index: gdb-7.7.90.20140613/gdb/regcache.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/regcache.h 2014-02-06 18:07:54.372911126 +0100 -+++ gdb-7.6.90.20140127/gdb/regcache.h 2014-02-06 18:07:58.925916019 +0100 +--- gdb-7.7.90.20140613.orig/gdb/regcache.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/regcache.h 2014-06-24 16:07:27.265986897 +0200 @@ -89,9 +89,9 @@ extern void regcache_raw_write_unsigned extern enum register_status @@ -3148,37 +3121,37 @@ Index: gdb-7.6.90.20140127/gdb/regcache.h /* Special routines to read/write the PC. */ -Index: gdb-7.6.90.20140127/gdb/remote.c +Index: gdb-7.7.90.20140613/gdb/remote.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/remote.c 2014-02-06 18:07:54.374911128 +0100 -+++ gdb-7.6.90.20140127/gdb/remote.c 2014-02-06 18:07:58.926916020 +0100 -@@ -8413,7 +8413,7 @@ int remote_hw_watchpoint_length_limit = - int remote_hw_breakpoint_limit = -1; +--- gdb-7.7.90.20140613.orig/gdb/remote.c 2014-06-24 16:07:26.658986224 +0200 ++++ gdb-7.7.90.20140613/gdb/remote.c 2014-06-24 16:07:27.266986898 +0200 +@@ -8272,7 +8272,7 @@ int remote_hw_breakpoint_limit = -1; static int --remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+remote_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + remote_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { if (remote_hw_watchpoint_length_limit == 0) return 0; -Index: gdb-7.6.90.20140127/gdb/spu-multiarch.c +Index: gdb-7.7.90.20140613/gdb/spu-multiarch.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/spu-multiarch.c 2014-02-06 18:07:54.374911128 +0100 -+++ gdb-7.6.90.20140127/gdb/spu-multiarch.c 2014-02-06 18:07:58.927916021 +0100 -@@ -118,7 +118,7 @@ spu_thread_architecture (struct target_o - +--- gdb-7.7.90.20140613.orig/gdb/spu-multiarch.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/spu-multiarch.c 2014-06-24 16:07:27.266986898 +0200 +@@ -119,7 +119,7 @@ spu_thread_architecture (struct target_o /* Override the to_region_ok_for_hw_watchpoint routine. */ static int --spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+spu_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + spu_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { struct target_ops *ops_beneath = find_target_beneath (&spu_ops); while (ops_beneath && !ops_beneath->to_region_ok_for_hw_watchpoint) -Index: gdb-7.6.90.20140127/gdb/stack.c +Index: gdb-7.7.90.20140613/gdb/stack.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/stack.c 2014-02-06 18:07:54.375911129 +0100 -+++ gdb-7.6.90.20140127/gdb/stack.c 2014-02-06 18:07:58.927916021 +0100 -@@ -180,7 +180,7 @@ print_stack_frame (struct frame_info *fr +--- gdb-7.7.90.20140613.orig/gdb/stack.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/stack.c 2014-06-24 16:07:27.267986900 +0200 +@@ -179,7 +179,7 @@ print_stack_frame (struct frame_info *fr argument (not just the first nameless argument). */ static void @@ -3187,7 +3160,7 @@ Index: gdb-7.6.90.20140127/gdb/stack.c int first, struct ui_file *stream) { struct gdbarch *gdbarch = get_frame_arch (frame); -@@ -526,7 +526,7 @@ print_frame_args (struct symbol *func, s +@@ -525,7 +525,7 @@ print_frame_args (struct symbol *func, s /* Offset of next stack argument beyond the one we have seen that is at the highest offset, or -1 if we haven't come to a stack argument yet. */ @@ -3196,7 +3169,7 @@ Index: gdb-7.6.90.20140127/gdb/stack.c /* Number of ints of arguments that we have printed so far. */ int args_printed = 0; struct cleanup *old_chain; -@@ -564,8 +564,8 @@ print_frame_args (struct symbol *func, s +@@ -559,8 +559,8 @@ print_frame_args (struct symbol *func, s case LOC_ARG: case LOC_REF_ARG: { @@ -3207,7 +3180,7 @@ Index: gdb-7.6.90.20140127/gdb/stack.c /* Compute address of next argument by adding the size of this argument and rounding to an int boundary. */ -@@ -700,7 +700,7 @@ print_frame_args (struct symbol *func, s +@@ -695,7 +695,7 @@ print_frame_args (struct symbol *func, s enough about the stack to find them. */ if (num != -1) { @@ -3216,11 +3189,11 @@ Index: gdb-7.6.90.20140127/gdb/stack.c if (highest_offset == -1) start = gdbarch_frame_args_skip (get_frame_arch (frame)); -Index: gdb-7.6.90.20140127/gdb/symmisc.c +Index: gdb-7.7.90.20140613/gdb/symmisc.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/symmisc.c 2014-02-06 18:07:54.375911129 +0100 -+++ gdb-7.6.90.20140127/gdb/symmisc.c 2014-02-06 18:07:58.927916021 +0100 -@@ -529,11 +529,11 @@ print_symbol (void *args) +--- gdb-7.7.90.20140613.orig/gdb/symmisc.c 2014-06-24 16:07:26.747986322 +0200 ++++ gdb-7.7.90.20140613/gdb/symmisc.c 2014-06-24 16:07:27.267986900 +0200 +@@ -530,11 +530,11 @@ print_symbol (void *args) case LOC_CONST_BYTES: { @@ -3235,64 +3208,64 @@ Index: gdb-7.6.90.20140127/gdb/symmisc.c for (i = 0; i < TYPE_LENGTH (type); i++) fprintf_filtered (outfile, " %02x", (unsigned) SYMBOL_VALUE_BYTES (symbol)[i]); -Index: gdb-7.6.90.20140127/gdb/target.c +Index: gdb-7.7.90.20140613/gdb/target.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/target.c 2014-02-06 18:07:54.376911130 +0100 -+++ gdb-7.6.90.20140127/gdb/target.c 2014-02-06 18:07:58.928916022 +0100 -@@ -52,7 +52,7 @@ static void default_terminal_info (const - static int default_watchpoint_addr_within_range (struct target_ops *, +--- gdb-7.7.90.20140613.orig/gdb/target.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/target.c 2014-06-24 16:07:27.268986901 +0200 +@@ -55,7 +55,7 @@ static int default_watchpoint_addr_withi CORE_ADDR, CORE_ADDR, int); --static int default_region_ok_for_hw_watchpoint (CORE_ADDR, int); -+static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); + static int default_region_ok_for_hw_watchpoint (struct target_ops *, +- CORE_ADDR, int); ++ CORE_ADDR, LONGEST); - static void tcomplain (void) ATTRIBUTE_NORETURN; + static void default_rcmd (struct target_ops *, char *, struct ui_file *); -@@ -116,7 +116,7 @@ static int debug_to_stopped_data_address - static int debug_to_watchpoint_addr_within_range (struct target_ops *, +@@ -153,7 +153,7 @@ static int debug_to_watchpoint_addr_with CORE_ADDR, CORE_ADDR, int); --static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, int); -+static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); - - static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, - struct expression *); -@@ -3599,7 +3599,7 @@ target_fileio_read_stralloc (const char + static int debug_to_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR, int); ++ CORE_ADDR, LONGEST); + static int debug_to_can_accel_watchpoint_condition (struct target_ops *self, + CORE_ADDR, int, int, +@@ -2951,7 +2951,7 @@ target_fileio_read_stralloc (const char static int --default_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+default_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + default_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { return (len <= gdbarch_ptr_bit (target_gdbarch ()) / TARGET_CHAR_BIT); } -@@ -4566,7 +4566,7 @@ debug_to_can_use_hw_breakpoint (int type - } +@@ -3664,7 +3664,7 @@ debug_to_can_use_hw_breakpoint (struct t static int --debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, int len) -+debug_to_region_ok_for_hw_watchpoint (CORE_ADDR addr, LONGEST len) + debug_to_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) { CORE_ADDR retval; -Index: gdb-7.6.90.20140127/gdb/target.h +Index: gdb-7.7.90.20140613/gdb/target.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/target.h 2014-02-06 18:07:54.377911131 +0100 -+++ gdb-7.6.90.20140127/gdb/target.h 2014-02-06 18:07:58.929916023 +0100 -@@ -428,7 +428,7 @@ struct target_ops - +--- gdb-7.7.90.20140613.orig/gdb/target.h 2014-06-24 16:07:27.060986670 +0200 ++++ gdb-7.7.90.20140613/gdb/target.h 2014-06-24 16:07:27.268986901 +0200 +@@ -475,7 +475,7 @@ struct target_ops /* Documentation of this routine is provided with the corresponding target_* macro. */ -- int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, int); -+ int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); + int (*to_region_ok_for_hw_watchpoint) (struct target_ops *, +- CORE_ADDR, int) ++ CORE_ADDR, LONGEST) + TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); - int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, - struct expression *); -Index: gdb-7.6.90.20140127/gdb/tracepoint.c + int (*to_can_accel_watchpoint_condition) (struct target_ops *, +Index: gdb-7.7.90.20140613/gdb/tracepoint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/tracepoint.c 2014-02-06 18:07:54.379911134 +0100 -+++ gdb-7.6.90.20140127/gdb/tracepoint.c 2014-02-06 18:07:58.930916024 +0100 -@@ -935,13 +935,13 @@ add_register (struct collection_list *co +--- gdb-7.7.90.20140613.orig/gdb/tracepoint.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/tracepoint.c 2014-06-24 16:07:27.269986902 +0200 +@@ -930,13 +930,13 @@ add_register (struct collection_list *co static void add_memrange (struct collection_list *memranges, int type, bfd_signed_vma base, @@ -3308,7 +3281,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c } /* type: memrange_absolute == memory, other n == basereg */ -@@ -971,7 +971,7 @@ collect_symbol (struct collection_list * +@@ -966,7 +966,7 @@ collect_symbol (struct collection_list * CORE_ADDR scope, int trace_string) { @@ -3317,7 +3290,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c unsigned int reg; bfd_signed_vma offset; int treat_as_expr = 0; -@@ -995,8 +995,8 @@ collect_symbol (struct collection_list * +@@ -990,8 +990,8 @@ collect_symbol (struct collection_list * char tmp[40]; sprintf_vma (tmp, offset); @@ -3328,7 +3301,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c tmp /* address */); } /* A struct may be a C++ class with static fields, go to general -@@ -1028,8 +1028,8 @@ collect_symbol (struct collection_list * +@@ -1023,8 +1023,8 @@ collect_symbol (struct collection_list * offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3339,7 +3312,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } -@@ -1040,8 +1040,8 @@ collect_symbol (struct collection_list * +@@ -1035,8 +1035,8 @@ collect_symbol (struct collection_list * offset = 0; if (info_verbose) { @@ -3350,7 +3323,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from reg %d\n", reg); } -@@ -1052,8 +1052,8 @@ collect_symbol (struct collection_list * +@@ -1047,8 +1047,8 @@ collect_symbol (struct collection_list * offset = frame_offset + SYMBOL_VALUE (sym); if (info_verbose) { @@ -3361,7 +3334,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c printf_vma (offset); printf_filtered (" from frame ptr reg %d\n", reg); } -@@ -2711,7 +2711,8 @@ scope_info (char *args, int from_tty) +@@ -2709,7 +2709,8 @@ scope_info (char *args, int from_tty) const char *symname; char *save_args = args; struct block_iterator iter; @@ -3371,7 +3344,7 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c struct gdbarch *gdbarch; int regno; -@@ -2847,8 +2848,11 @@ scope_info (char *args, int from_tty) +@@ -2845,8 +2846,11 @@ scope_info (char *args, int from_tty) } } if (SYMBOL_TYPE (sym)) @@ -3385,11 +3358,11 @@ Index: gdb-7.6.90.20140127/gdb/tracepoint.c } if (BLOCK_FUNCTION (block)) break; -Index: gdb-7.6.90.20140127/gdb/typeprint.c +Index: gdb-7.7.90.20140613/gdb/typeprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/typeprint.c 2014-02-06 18:07:54.379911134 +0100 -+++ gdb-7.6.90.20140127/gdb/typeprint.c 2014-02-06 18:07:58.930916024 +0100 -@@ -409,7 +409,7 @@ whatis_exp (char *exp, int show) +--- gdb-7.7.90.20140613.orig/gdb/typeprint.c 2014-06-24 16:07:26.339985870 +0200 ++++ gdb-7.7.90.20140613/gdb/typeprint.c 2014-06-24 16:07:27.269986902 +0200 +@@ -405,7 +405,7 @@ whatis_exp (char *exp, int show) struct type *real_type = NULL; struct type *type; int full = 0; @@ -3398,31 +3371,39 @@ Index: gdb-7.6.90.20140127/gdb/typeprint.c int using_enc = 0; struct value_print_options opts; struct type_print_options flags = default_ptype_flags; -Index: gdb-7.6.90.20140127/gdb/valarith.c +Index: gdb-7.7.90.20140613/gdb/valarith.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/valarith.c 2014-02-06 18:07:54.380911135 +0100 -+++ gdb-7.6.90.20140127/gdb/valarith.c 2014-02-06 18:07:58.930916024 +0100 -@@ -190,15 +190,15 @@ value_subscript (struct value *array, LO +--- gdb-7.7.90.20140613.orig/gdb/valarith.c 2014-06-24 16:07:26.411985950 +0200 ++++ gdb-7.7.90.20140613/gdb/valarith.c 2014-06-24 16:07:27.269986902 +0200 +@@ -190,12 +190,13 @@ value_subscript (struct value *array, LO to doubles, but no longer does. */ struct value * -value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) -+value_subscripted_rvalue (struct value *array, LONGEST index, LONGEST lowerbound) ++value_subscripted_rvalue (struct value *array, LONGEST index, ++ LONGEST lowerbound) { 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_stride +- unsigned int elt_offs; + ULONGEST elt_size = TYPE_LENGTH (elt_type); -+ ULONGEST elt_stride - = (TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)) == 0 - ? elt_size : TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type))); -- unsigned int elt_offs = elt_stride * longest_to_int (index - lowerbound); -+ ULONGEST elt_offs = elt_stride * longest_to_int (index - lowerbound); ++ ULONGEST elt_offs; + LONGEST elt_stride = TYPE_BYTE_STRIDE (TYPE_INDEX_TYPE (array_type)); struct value *v; - if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) -@@ -635,7 +635,7 @@ value_concat (struct value *arg1, struct +@@ -204,7 +205,9 @@ value_subscripted_rvalue (struct value * + if (TYPE_NOT_ALLOCATED (array_type)) + error (_("no such vector element because not allocated")); + +- elt_offs = longest_to_int (index - lowerbound); ++ if (index < lowerbound) ++ error (_("no such vector element")); ++ elt_offs = index - lowerbound; + + if (elt_stride > 0) + elt_offs *= elt_stride; +@@ -662,7 +665,7 @@ value_concat (struct value *arg1, struct struct value *inval1; struct value *inval2; struct value *outval = NULL; @@ -3431,7 +3412,7 @@ Index: gdb-7.6.90.20140127/gdb/valarith.c int count, idx; char *ptr; char inchar; -@@ -1488,7 +1488,7 @@ value_binop (struct value *arg1, struct +@@ -1515,7 +1518,7 @@ value_binop (struct value *arg1, struct int value_logical_not (struct value *arg1) { @@ -3440,7 +3421,7 @@ Index: gdb-7.6.90.20140127/gdb/valarith.c const gdb_byte *p; struct type *type1; -@@ -1519,11 +1519,11 @@ value_logical_not (struct value *arg1) +@@ -1546,11 +1549,11 @@ value_logical_not (struct value *arg1) static int value_strcmp (struct value *arg1, struct value *arg2) { @@ -3455,10 +3436,10 @@ Index: gdb-7.6.90.20140127/gdb/valarith.c for (i = 0; i < len; i++) { -Index: gdb-7.6.90.20140127/gdb/valops.c +Index: gdb-7.7.90.20140613/gdb/valops.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/valops.c 2014-02-06 18:07:54.382911137 +0100 -+++ gdb-7.6.90.20140127/gdb/valops.c 2014-02-06 18:11:09.072119918 +0100 +--- gdb-7.7.90.20140613.orig/gdb/valops.c 2014-06-24 16:07:26.946986543 +0200 ++++ gdb-7.7.90.20140613/gdb/valops.c 2014-06-24 16:07:27.270986903 +0200 @@ -51,11 +51,11 @@ static int typecmp (int staticp, int var struct field t1[], struct value *t2[]); @@ -3479,21 +3460,22 @@ Index: gdb-7.6.90.20140127/gdb/valops.c static struct value *value_struct_elt_for_reference (struct type *, - int, struct type *, + LONGEST, struct type *, - char *, + const char *, struct type *, int, enum noside); -@@ -100,8 +100,8 @@ static CORE_ADDR allocate_space_in_infer +@@ -100,9 +100,9 @@ static CORE_ADDR allocate_space_in_infer static struct value *cast_into_complex (struct type *, struct value *); - static struct fn_field *find_method_list (struct value **, const char *, -- int, struct type *, int *, -- struct type **, int *); -+ LONGEST, struct type *, int *, -+ struct type **, LONGEST *); + static void find_method_list (struct value **, const char *, +- int, struct type *, struct fn_field **, int *, ++ LONGEST, struct type *, struct fn_field **, int *, + VEC (xmethod_worker_ptr) **, +- struct type **, int *); ++ struct type **, LONGEST *); void _initialize_valops (void); -@@ -186,7 +186,7 @@ find_function_in_inferior (const char *n +@@ -187,7 +187,7 @@ find_function_in_inferior (const char *n space. */ struct value * @@ -3502,7 +3484,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c { struct objfile *objf; struct value *val = find_function_in_inferior ("malloc", &objf); -@@ -259,7 +259,8 @@ value_cast_structs (struct type *type, s +@@ -260,7 +260,8 @@ value_cast_structs (struct type *type, s if (TYPE_NAME (t2) != NULL) { /* Try downcasting using the run-time type of the value. */ @@ -3512,7 +3494,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c struct type *real_type; real_type = value_rtti_type (v2, &full, &top, &using_enc); -@@ -398,12 +399,12 @@ value_cast (struct type *type, struct va +@@ -400,12 +401,12 @@ value_cast (struct type *type, struct va if (code1 == TYPE_CODE_ARRAY) { struct type *element_type = TYPE_TARGET_TYPE (type); @@ -3527,7 +3509,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c LONGEST low_bound, high_bound, new_length; if (get_discrete_bounds (range_type, &low_bound, &high_bound) < 0) -@@ -637,7 +638,7 @@ value_reinterpret_cast (struct type *typ +@@ -639,7 +640,7 @@ value_reinterpret_cast (struct type *typ static int dynamic_cast_check_1 (struct type *desired_type, const gdb_byte *valaddr, @@ -3536,7 +3518,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c CORE_ADDR address, struct value *val, struct type *search_type, -@@ -649,8 +650,8 @@ dynamic_cast_check_1 (struct type *desir +@@ -651,8 +652,8 @@ dynamic_cast_check_1 (struct type *desir for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { @@ -3547,7 +3529,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (class_types_same_p (desired_type, TYPE_BASECLASS (search_type, i))) { -@@ -684,7 +685,7 @@ dynamic_cast_check_1 (struct type *desir +@@ -686,7 +687,7 @@ dynamic_cast_check_1 (struct type *desir static int dynamic_cast_check_2 (struct type *desired_type, const gdb_byte *valaddr, @@ -3556,7 +3538,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c CORE_ADDR address, struct value *val, struct type *search_type, -@@ -694,7 +695,7 @@ dynamic_cast_check_2 (struct type *desir +@@ -696,7 +697,7 @@ dynamic_cast_check_2 (struct type *desir for (i = 0; i < TYPE_N_BASECLASSES (search_type) && result_count < 2; ++i) { @@ -3565,7 +3547,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (! BASETYPE_VIA_PUBLIC (search_type, i)) continue; -@@ -725,7 +726,8 @@ dynamic_cast_check_2 (struct type *desir +@@ -727,7 +728,8 @@ dynamic_cast_check_2 (struct type *desir struct value * value_dynamic_cast (struct type *type, struct value *arg) { @@ -3575,7 +3557,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c struct type *resolved_type = check_typedef (type); struct type *arg_type = check_typedef (value_type (arg)); struct type *class_type, *rtti_type; -@@ -1005,7 +1007,7 @@ value_at_lazy (struct type *type, CORE_A +@@ -958,7 +960,7 @@ value_at_lazy (struct type *type, CORE_A } void @@ -3584,7 +3566,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length) { -@@ -1155,7 +1157,7 @@ value_assign (struct value *toval, struc +@@ -1058,7 +1060,7 @@ value_assign (struct value *toval, struc { const gdb_byte *dest_buffer; CORE_ADDR changed_addr; @@ -3593,7 +3575,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c gdb_byte buffer[sizeof (LONGEST)]; if (value_bitsize (toval)) -@@ -1234,7 +1236,7 @@ value_assign (struct value *toval, struc +@@ -1137,7 +1139,7 @@ value_assign (struct value *toval, struc if (value_bitsize (toval)) { struct value *parent = value_parent (toval); @@ -3602,7 +3584,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c int changed_len; gdb_byte buffer[sizeof (LONGEST)]; int optim, unavail; -@@ -1715,7 +1717,7 @@ value_array (int lowbound, int highbound +@@ -1605,7 +1607,7 @@ value_array (int lowbound, int highbound { int nelem; int idx; @@ -3611,7 +3593,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c struct value *val; struct type *arraytype; -@@ -1890,7 +1892,7 @@ typecmp (int staticp, int varargs, int n +@@ -1780,7 +1782,7 @@ typecmp (int staticp, int varargs, int n static void update_search_result (struct value **result_ptr, struct value *v, @@ -3620,7 +3602,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c const char *name, struct type *type) { if (v != NULL) -@@ -1914,10 +1916,10 @@ update_search_result (struct value **res +@@ -1804,10 +1806,10 @@ update_search_result (struct value **res lookup is ambiguous. */ static void @@ -3633,7 +3615,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c struct type *outermost_type) { int i; -@@ -1966,7 +1968,7 @@ do_search_struct_field (const char *name +@@ -1856,7 +1858,7 @@ do_search_struct_field (const char *name . */ struct value *v = NULL; @@ -3642,7 +3624,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c /* This is pretty gross. In G++, the offset in an anonymous union is relative to the beginning of the -@@ -2005,7 +2007,7 @@ do_search_struct_field (const char *name +@@ -1895,7 +1897,7 @@ do_search_struct_field (const char *name && (strcmp_iw (name, TYPE_BASECLASS_NAME (type, i)) == 0)); @@ -3651,7 +3633,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2078,11 +2080,11 @@ do_search_struct_field (const char *name +@@ -1968,11 +1970,11 @@ do_search_struct_field (const char *name fields, look for a baseclass named NAME. */ static struct value * @@ -3665,7 +3647,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c do_search_struct_field (name, arg1, offset, type, looking_for_baseclass, &result, &boffset, type); -@@ -2099,7 +2101,7 @@ search_struct_field (const char *name, s +@@ -1989,7 +1991,7 @@ search_struct_field (const char *name, s static struct value * search_struct_method (const char *name, struct value **arg1p, @@ -3674,7 +3656,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c int *static_memfuncp, struct type *type) { int i; -@@ -2163,8 +2165,8 @@ search_struct_method (const char *name, +@@ -2053,8 +2055,8 @@ search_struct_method (const char *name, for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { @@ -3685,19 +3667,21 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2391,8 +2393,8 @@ value_struct_elt_bitpos (struct value ** +@@ -2289,10 +2291,10 @@ value_struct_elt_bitpos (struct value ** - static struct fn_field * + static void find_method_list (struct value **argp, const char *method, -- int offset, struct type *type, int *num_fns, +- int offset, struct type *type, ++ LONGEST offset, struct type *type, + struct fn_field **fn_list, int *num_fns, + VEC (xmethod_worker_ptr) **xm_worker_vec, - struct type **basetype, int *boffset) -+ LONGEST offset, struct type *type, int *num_fns, + struct type **basetype, LONGEST *boffset) { int i; - struct fn_field *f; -@@ -2425,7 +2427,7 @@ find_method_list (struct value **argp, c - /* Not found in object, check in base subobjects. */ + struct fn_field *f = NULL; +@@ -2349,7 +2351,7 @@ find_method_list (struct value **argp, c + extension methods. */ for (i = TYPE_N_BASECLASSES (type) - 1; i >= 0; i--) { - int base_offset; @@ -3705,16 +3689,16 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (type, i)) { -@@ -2461,7 +2463,7 @@ find_method_list (struct value **argp, c - static struct fn_field * - value_find_oload_method_list (struct value **argp, const char *method, - int offset, int *num_fns, +@@ -2392,7 +2394,7 @@ value_find_oload_method_list (struct val + int offset, struct fn_field **fn_list, + int *num_fns, + VEC (xmethod_worker_ptr) **xm_worker_vec, - struct type **basetype, int *boffset) + struct type **basetype, LONGEST *boffset) { struct type *t; -@@ -2551,7 +2553,7 @@ find_overload_match (struct value **args +@@ -2496,7 +2498,7 @@ find_overload_match (struct value **args /* Number of overloaded instances being considered. */ int num_fns = 0; struct type *basetype = NULL; @@ -3723,16 +3707,16 @@ Index: gdb-7.6.90.20140127/gdb/valops.c struct cleanup *all_cleanups = make_cleanup (null_cleanup, NULL); -@@ -3221,7 +3223,7 @@ compare_parameters (struct type *t1, str +@@ -3307,7 +3309,7 @@ compare_parameters (struct type *t1, str the form "DOMAIN::NAME". */ static struct value * -value_struct_elt_for_reference (struct type *domain, int offset, +value_struct_elt_for_reference (struct type *domain, LONGEST offset, - struct type *curtype, char *name, + struct type *curtype, const char *name, struct type *intype, int want_address, -@@ -3255,7 +3257,7 @@ value_struct_elt_for_reference (struct t +@@ -3341,7 +3343,7 @@ value_struct_elt_for_reference (struct t if (want_address) return value_from_longest (lookup_memberptr_type (TYPE_FIELD_TYPE (t, i), domain), @@ -3741,7 +3725,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c else if (noside != EVAL_NORMAL) return allocate_value (TYPE_FIELD_TYPE (t, i)); else -@@ -3423,7 +3425,7 @@ value_struct_elt_for_reference (struct t +@@ -3509,7 +3511,7 @@ value_struct_elt_for_reference (struct t for (i = TYPE_N_BASECLASSES (t) - 1; i >= 0; i--) { struct value *v; @@ -3750,7 +3734,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c if (BASETYPE_VIA_VIRTUAL (t, i)) base_offset = 0; -@@ -3513,7 +3515,7 @@ value_maybe_namespace_elt (const struct +@@ -3599,7 +3601,7 @@ value_maybe_namespace_elt (const struct struct type * value_rtti_indirect_type (struct value *v, int *full, @@ -3759,7 +3743,7 @@ Index: gdb-7.6.90.20140127/gdb/valops.c { struct value *target; struct type *type, *real_type, *target_type; -@@ -3563,12 +3565,12 @@ value_rtti_indirect_type (struct value * +@@ -3649,12 +3651,12 @@ value_rtti_indirect_type (struct value * struct value * value_full_object (struct value *argp, struct type *rtype, @@ -3774,10 +3758,10 @@ Index: gdb-7.6.90.20140127/gdb/valops.c int using_enc = 0; struct value *new_val; -Index: gdb-7.6.90.20140127/gdb/valprint.c +Index: gdb-7.7.90.20140613/gdb/valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/valprint.c 2014-02-06 18:07:54.383911138 +0100 -+++ gdb-7.6.90.20140127/gdb/valprint.c 2014-02-06 18:07:58.932916026 +0100 +--- gdb-7.7.90.20140613.orig/gdb/valprint.c 2014-06-24 16:07:26.247985768 +0200 ++++ gdb-7.7.90.20140613/gdb/valprint.c 2014-06-24 16:07:27.270986903 +0200 @@ -302,7 +302,7 @@ val_print_scalar_type_p (struct type *ty int valprint_check_validity (struct ui_file *stream, @@ -3787,7 +3771,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c const struct value *val) { CHECK_TYPEDEF (type); -@@ -375,7 +375,7 @@ val_print_invalid_address (struct ui_fil +@@ -399,7 +399,7 @@ val_print_not_associated (struct ui_file void generic_val_print (struct type *type, const gdb_byte *valaddr, @@ -3796,7 +3780,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c struct ui_file *stream, int recurse, const struct value *original_value, const struct value_print_options *options, -@@ -737,7 +737,7 @@ generic_val_print (struct type *type, co +@@ -761,7 +761,7 @@ generic_val_print (struct type *type, co RECURSE. */ void @@ -3805,7 +3789,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c CORE_ADDR address, struct ui_file *stream, int recurse, const struct value *val, const struct value_print_options *options, -@@ -958,7 +958,7 @@ val_print_type_code_flags (struct type * +@@ -999,7 +999,7 @@ val_print_type_code_flags (struct type * void val_print_scalar_formatted (struct type *type, @@ -3814,7 +3798,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c const struct value *val, const struct value_print_options *options, int size, -@@ -1499,7 +1499,7 @@ print_decimal_chars (struct ui_file *str +@@ -1540,7 +1540,7 @@ print_decimal_chars (struct ui_file *str void print_hex_chars (struct ui_file *stream, const gdb_byte *valaddr, @@ -3823,7 +3807,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c { const gdb_byte *p; -@@ -1616,23 +1616,23 @@ maybe_print_array_index (struct type *in +@@ -1657,22 +1657,22 @@ maybe_print_array_index (struct type *in void val_print_array_elements (struct type *type, @@ -3839,7 +3823,6 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c unsigned int things_printed = 0; - unsigned len; + ULONGEST len; - struct type *saved_type = type; struct type *elttype, *index_type; - unsigned eltlen; + ULONGEST eltlen; @@ -3851,9 +3834,9 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c - unsigned int reps; + ULONGEST reps; LONGEST low_bound, high_bound; - struct cleanup *back_to; - CORE_ADDR saved_address = address; -@@ -1727,7 +1727,7 @@ val_print_array_elements (struct type *t + + elttype = TYPE_TARGET_TYPE (type); +@@ -1743,7 +1743,7 @@ val_print_array_elements (struct type *t address, stream, recurse + 1, val, options, current_language); annotate_elt_rep (reps); @@ -3862,7 +3845,7 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c annotate_elt_rep_end (); i = rep1 - 1; -@@ -2382,7 +2382,7 @@ print_converted_chars_to_obstack (struct +@@ -2400,7 +2400,7 @@ print_converted_chars_to_obstack (struct void generic_printstr (struct ui_file *stream, struct type *type, @@ -3871,10 +3854,10 @@ Index: gdb-7.6.90.20140127/gdb/valprint.c const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options) -Index: gdb-7.6.90.20140127/gdb/valprint.h +Index: gdb-7.7.90.20140613/gdb/valprint.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/valprint.h 2014-02-06 18:07:54.384911139 +0100 -+++ gdb-7.6.90.20140127/gdb/valprint.h 2014-02-06 18:07:58.932916026 +0100 +--- gdb-7.7.90.20140613.orig/gdb/valprint.h 2014-06-24 16:07:26.247985768 +0200 ++++ gdb-7.7.90.20140613/gdb/valprint.h 2014-06-24 16:07:27.271986904 +0200 @@ -115,11 +115,11 @@ extern void maybe_print_array_index (str struct ui_file *stream, const struct value_print_options *); @@ -3925,10 +3908,10 @@ Index: gdb-7.6.90.20140127/gdb/valprint.h const char *encoding, int force_ellipses, int quote_char, int c_style_terminator, const struct value_print_options *options); -Index: gdb-7.6.90.20140127/gdb/value.c +Index: gdb-7.7.90.20140613/gdb/value.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/value.c 2014-02-06 18:07:54.386911141 +0100 -+++ gdb-7.6.90.20140127/gdb/value.c 2014-02-06 18:10:39.376088625 +0100 +--- gdb-7.7.90.20140613.orig/gdb/value.c 2014-06-24 16:07:27.026986632 +0200 ++++ gdb-7.7.90.20140613/gdb/value.c 2014-06-24 16:07:27.271986904 +0200 @@ -69,10 +69,10 @@ struct internal_function struct range { @@ -3962,7 +3945,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { range_s what; int i; -@@ -246,7 +246,7 @@ struct value +@@ -252,7 +252,7 @@ struct value lval == lval_register, this is a further offset from location.address within the registers structure. Note also the member embedded_offset below. */ @@ -3971,7 +3954,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c /* Only used for bitfields; number of bits contained in them. */ int bitsize; -@@ -316,8 +316,8 @@ struct value +@@ -322,8 +322,8 @@ struct value `type', and `embedded_offset' is zero, so everything works normally. */ struct type *enclosing_type; @@ -3982,7 +3965,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c /* Values are stored in a chain, so that they can be deleted easily over calls to the inferior. Values assigned to internal -@@ -348,7 +348,8 @@ value_bits_available (const struct value +@@ -351,7 +351,8 @@ value_bits_available (const struct value } int @@ -3992,7 +3975,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { return value_bits_available (value, offset * TARGET_CHAR_BIT, -@@ -555,7 +556,8 @@ mark_value_bits_unavailable (struct valu +@@ -558,7 +559,8 @@ mark_value_bits_unavailable (struct valu } void @@ -4002,7 +3985,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { mark_value_bits_unavailable (value, offset * TARGET_CHAR_BIT, -@@ -569,7 +571,7 @@ mark_value_bytes_unavailable (struct val +@@ -572,7 +574,7 @@ mark_value_bytes_unavailable (struct val static int find_first_range_overlap (VEC(range_s) *ranges, int pos, @@ -4011,7 +3994,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { range_s *r; int i; -@@ -760,9 +762,9 @@ value_available_contents_bits_eq (const +@@ -763,9 +765,9 @@ value_available_contents_bits_eq (const } int @@ -4024,7 +4007,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { return value_available_contents_bits_eq (val1, offset1 * TARGET_CHAR_BIT, val2, offset2 * TARGET_CHAR_BIT, -@@ -927,13 +929,13 @@ deprecated_set_value_type (struct value +@@ -930,13 +932,13 @@ deprecated_set_value_type (struct value value->type = type; } @@ -4040,7 +4023,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { value->offset = offset; } -@@ -1103,8 +1105,9 @@ value_contents_all (struct value *value) +@@ -1106,8 +1108,9 @@ value_contents_all (struct value *value) DST_OFFSET+LENGTH) range are wholly available. */ void @@ -4052,7 +4035,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { range_s *r; int i; -@@ -1156,8 +1159,8 @@ value_contents_copy_raw (struct value *d +@@ -1159,8 +1162,8 @@ value_contents_copy_raw (struct value *d DST_OFFSET+LENGTH) range are wholly available. */ void @@ -4063,7 +4046,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { require_not_optimized_out (src); -@@ -1262,7 +1265,7 @@ value_entirely_optimized_out (const stru +@@ -1265,7 +1268,7 @@ value_entirely_optimized_out (const stru } int @@ -4072,7 +4055,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { if (!value->optimized_out) return 1; -@@ -1275,7 +1278,7 @@ value_bits_valid (const struct value *va +@@ -1278,7 +1281,7 @@ value_bits_valid (const struct value *va int value_bits_synthetic_pointer (const struct value *value, @@ -4081,7 +4064,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { if (value->lval != lval_computed || !value->location.computed.funcs->check_synthetic_pointer) -@@ -1285,26 +1288,26 @@ value_bits_synthetic_pointer (const stru +@@ -1288,26 +1291,26 @@ value_bits_synthetic_pointer (const stru length); } @@ -4112,7 +4095,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { value->pointed_to_offset = val; } -@@ -2157,7 +2160,7 @@ get_internalvar_function (struct interna +@@ -2154,7 +2157,7 @@ get_internalvar_function (struct interna } void @@ -4121,7 +4104,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c int bitsize, struct value *newval) { gdb_byte *addr; -@@ -2863,7 +2866,7 @@ set_value_enclosing_type (struct value * +@@ -2860,7 +2863,7 @@ set_value_enclosing_type (struct value * FIELDNO says which field. */ struct value * @@ -4130,7 +4113,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c int fieldno, struct type *arg_type) { struct value *v; -@@ -2891,7 +2894,7 @@ value_primitive_field (struct value *arg +@@ -2888,7 +2891,7 @@ value_primitive_field (struct value *arg bit. Assume that the address, offset, and embedded offset are sufficiently aligned. */ @@ -4139,7 +4122,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c int container_bitsize = TYPE_LENGTH (type) * 8; if (arg1->optimized_out) -@@ -2918,7 +2921,7 @@ value_primitive_field (struct value *arg +@@ -2915,7 +2918,7 @@ value_primitive_field (struct value *arg /* This field is actually a base subobject, so preserve the entire object's contents for later references to virtual bases, etc. */ @@ -4148,7 +4131,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c /* Lazy register values with offsets are not supported. */ if (VALUE_LVAL (arg1) == lval_register && value_lazy (arg1)) -@@ -3008,7 +3011,7 @@ value_field (struct value *arg1, int fie +@@ -3014,7 +3017,7 @@ value_field (struct value *arg1, int fie struct value * value_fn_field (struct value **arg1p, struct fn_field *f, int j, struct type *type, @@ -4157,7 +4140,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { struct value *v; struct type *ftype = TYPE_FN_FIELD_TYPE (f, j); -@@ -3068,8 +3071,8 @@ value_fn_field (struct value **arg1p, st +@@ -3074,8 +3077,8 @@ value_fn_field (struct value **arg1p, st static int unpack_value_bits_as_long_1 (struct type *field_type, const gdb_byte *valaddr, @@ -4168,7 +4151,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c LONGEST *result) { enum bfd_endian byte_order = gdbarch_byte_order (get_type_arch (field_type)); -@@ -3077,7 +3080,7 @@ unpack_value_bits_as_long_1 (struct type +@@ -3083,7 +3086,7 @@ unpack_value_bits_as_long_1 (struct type ULONGEST valmask; int lsbcount; int bytes_read; @@ -4177,7 +4160,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c /* Read the minimum number of bytes required; there may not be enough bytes to read an entire ULONGEST. */ -@@ -3147,7 +3150,7 @@ unpack_value_bits_as_long_1 (struct type +@@ -3153,7 +3156,7 @@ unpack_value_bits_as_long_1 (struct type int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, @@ -4186,7 +4169,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c const struct value *original_value, LONGEST *result) { -@@ -3165,10 +3168,10 @@ unpack_value_bits_as_long (struct type * +@@ -3171,10 +3174,10 @@ unpack_value_bits_as_long (struct type * static int unpack_value_field_as_long_1 (struct type *type, const gdb_byte *valaddr, @@ -4199,7 +4182,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c int bitsize = TYPE_FIELD_BITSIZE (type, fieldno); struct type *field_type = TYPE_FIELD_TYPE (type, fieldno); -@@ -3184,7 +3187,7 @@ unpack_value_field_as_long_1 (struct typ +@@ -3190,7 +3193,7 @@ unpack_value_field_as_long_1 (struct typ int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, @@ -4208,7 +4191,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c const struct value *val, LONGEST *result) { gdb_assert (val != NULL); -@@ -3216,7 +3219,7 @@ unpack_field_as_long (struct type *type, +@@ -3222,7 +3225,7 @@ unpack_field_as_long (struct type *type, struct value * value_field_bitfield (struct type *type, int fieldno, const gdb_byte *valaddr, @@ -4217,7 +4200,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c { LONGEST l; -@@ -3243,12 +3246,12 @@ value_field_bitfield (struct type *type, +@@ -3249,12 +3252,12 @@ value_field_bitfield (struct type *type, void modify_field (struct type *type, gdb_byte *addr, @@ -4232,11 +4215,11 @@ Index: gdb-7.6.90.20140127/gdb/value.c /* Normalize BITPOS. */ addr += bitpos / 8; -Index: gdb-7.6.90.20140127/gdb/value.h +Index: gdb-7.7.90.20140613/gdb/value.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/value.h 2014-02-06 18:07:54.387911142 +0100 -+++ gdb-7.6.90.20140127/gdb/value.h 2014-02-06 18:09:23.064006360 +0100 -@@ -82,8 +82,8 @@ extern void set_value_parent (struct val +--- gdb-7.7.90.20140613.orig/gdb/value.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/value.h 2014-06-24 16:07:27.272986905 +0200 +@@ -83,8 +83,8 @@ extern void set_value_parent (struct val within the registers structure. Note also the member embedded_offset below. */ @@ -4247,7 +4230,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* The comment from "struct value" reads: ``Is it modifiable? Only relevant if lval != not_lval.''. Shouldn't the value instead be -@@ -152,10 +152,10 @@ extern struct type *value_actual_type (s +@@ -153,10 +153,10 @@ extern struct type *value_actual_type (s int resolve_simple_types, int *real_type_found); @@ -4262,7 +4245,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* For lval_computed values, this structure holds functions used to retrieve and set the value (or portions of the value). -@@ -183,7 +183,8 @@ struct lval_funcs +@@ -184,7 +184,8 @@ struct lval_funcs /* Check the validity of some bits in VALUE. This should return 1 if all the bits starting at OFFSET and extending for LENGTH bits are valid, or 0 if any bit is invalid. */ @@ -4272,7 +4255,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Return 1 if any bit in VALUE is valid, 0 if they are all invalid. */ int (*check_any_valid) (const struct value *value); -@@ -201,7 +202,7 @@ struct lval_funcs +@@ -202,7 +203,7 @@ struct lval_funcs /* If non-NULL, this is used to determine whether the indicated bits of VALUE are a synthetic pointer. */ int (*check_synthetic_pointer) (const struct value *value, @@ -4281,7 +4264,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Return a duplicate of VALUE's closure, for use in a new value. This may simply return the same closure, if VALUE's is -@@ -238,7 +239,7 @@ extern struct value *allocate_computed_v +@@ -239,7 +240,7 @@ extern struct value *allocate_computed_v Otherwise, return 1. */ extern int valprint_check_validity (struct ui_file *stream, struct type *type, @@ -4290,7 +4273,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h const struct value *val); extern struct value *allocate_optimized_out_value (struct type *type); -@@ -420,13 +421,13 @@ extern struct value *coerce_array (struc +@@ -421,13 +422,13 @@ extern struct value *coerce_array (struc bits in the given range are valid, zero if any bit is invalid. */ extern int value_bits_valid (const struct value *value, @@ -4306,7 +4289,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Given a value, determine whether the contents bytes starting at OFFSET and extending for LENGTH bytes are available. This returns -@@ -434,7 +435,7 @@ extern int value_bits_synthetic_pointer +@@ -435,7 +436,7 @@ extern int value_bits_synthetic_pointer byte is unavailable. */ extern int value_bytes_available (const struct value *value, @@ -4315,7 +4298,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Given a value, determine whether the contents bits starting at OFFSET and extending for LENGTH bits are available. This returns -@@ -456,7 +457,7 @@ extern int value_entirely_unavailable (s +@@ -457,7 +458,7 @@ extern int value_entirely_unavailable (s LENGTH bytes as unavailable. */ extern void mark_value_bytes_unavailable (struct value *value, @@ -4324,7 +4307,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Mark VALUE's content bits starting at OFFSET and extending for LENGTH bits as unavailable. */ -@@ -472,7 +473,7 @@ extern void mark_value_bits_unavailable +@@ -473,7 +474,7 @@ extern void mark_value_bits_unavailable example, to compare a complete object value with itself, including its enclosing type chunk, you'd do: @@ -4333,7 +4316,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h value_available_contents (val, 0, val, 0, len); Returns true iff the set of available contents match. Unavailable -@@ -499,9 +500,9 @@ extern void mark_value_bits_unavailable +@@ -500,9 +501,9 @@ extern void mark_value_bits_unavailable gone, it works with const values. Therefore, this routine must not be called with lazy values. */ @@ -4346,7 +4329,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* Read LENGTH bytes of memory starting at MEMADDR into BUFFER, which is (or will be copied to) VAL's contents buffer offset by -@@ -510,7 +511,7 @@ extern int value_available_contents_eq ( +@@ -511,7 +512,7 @@ extern int value_available_contents_eq ( memory is likewise unavailable. STACK indicates whether the memory is known to be stack memory. */ @@ -4355,7 +4338,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h int stack, CORE_ADDR memaddr, gdb_byte *buffer, size_t length); -@@ -544,7 +545,7 @@ extern CORE_ADDR unpack_pointer (struct +@@ -545,7 +546,7 @@ extern CORE_ADDR unpack_pointer (struct extern int unpack_value_bits_as_long (struct type *field_type, const gdb_byte *valaddr, @@ -4364,7 +4347,7 @@ Index: gdb-7.6.90.20140127/gdb/value.h int bitsize, const struct value *original_value, LONGEST *result); -@@ -553,12 +554,12 @@ extern LONGEST unpack_field_as_long (str +@@ -554,12 +555,12 @@ extern LONGEST unpack_field_as_long (str const gdb_byte *valaddr, int fieldno); extern int unpack_value_field_as_long (struct type *type, const gdb_byte *valaddr, @@ -4469,3 +4452,68 @@ Index: gdb-7.6.90.20140127/gdb/value.h /* User function handler. */ +Index: gdb-7.7.90.20140613/gdb/s390-linux-nat.c +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/s390-linux-nat.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/s390-linux-nat.c 2014-06-24 16:07:27.272986905 +0200 +@@ -567,7 +567,7 @@ s390_can_use_hw_breakpoint (struct targe + + static int + s390_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int cnt) ++ CORE_ADDR addr, LONGEST cnt) + { + return 1; + } +Index: gdb-7.7.90.20140613/gdb/extension-priv.h +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/extension-priv.h 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/extension-priv.h 2014-06-24 16:07:27.272986905 +0200 +@@ -175,7 +175,7 @@ struct extension_language_ops + enum ext_lang_rc (*apply_val_pretty_printer) + (const struct extension_language_defn *, + struct type *type, const gdb_byte *valaddr, +- int embedded_offset, CORE_ADDR address, ++ LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, + const struct value *val, const struct value_print_options *options, + const struct language_defn *language); +Index: gdb-7.7.90.20140613/gdb/python/python-internal.h +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/python/python-internal.h 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/python/python-internal.h 2014-06-24 16:07:27.272986905 +0200 +@@ -317,7 +317,7 @@ extern int gdbpy_auto_load_enabled (cons + extern enum ext_lang_rc gdbpy_apply_val_pretty_printer + (const struct extension_language_defn *, + struct type *type, const gdb_byte *valaddr, +- int embedded_offset, CORE_ADDR address, ++ LONGEST embedded_offset, CORE_ADDR address, + struct ui_file *stream, int recurse, + const struct value *val, + const struct value_print_options *options, +Index: gdb-7.7.90.20140613/gdb/target-delegates.c +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/target-delegates.c 2014-06-13 03:59:37.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/target-delegates.c 2014-06-24 16:07:27.272986905 +0200 +@@ -268,7 +268,7 @@ delegate_watchpoint_addr_within_range (s + } + + static int +-delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, int arg2) ++delegate_region_ok_for_hw_watchpoint (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2) + { + self = self->beneath; + return self->to_region_ok_for_hw_watchpoint (self, arg1, arg2); +Index: gdb-7.7.90.20140613/gdb/aarch64-linux-nat.c +=================================================================== +--- gdb-7.7.90.20140613.orig/gdb/aarch64-linux-nat.c 2014-06-13 03:59:36.000000000 +0200 ++++ gdb-7.7.90.20140613/gdb/aarch64-linux-nat.c 2014-06-24 16:08:06.722030653 +0200 +@@ -1407,7 +1407,7 @@ aarch64_linux_remove_watchpoint (struct + + static int + aarch64_linux_region_ok_for_hw_watchpoint (struct target_ops *self, +- CORE_ADDR addr, int len) ++ CORE_ADDR addr, LONGEST len) + { + CORE_ADDR aligned_addr; + diff --git a/gdb-rhbz795424-bitpos-21of25.patch b/gdb-rhbz795424-bitpos-21of25.patch index ab286a5..26d1bb6 100644 --- a/gdb-rhbz795424-bitpos-21of25.patch +++ b/gdb-rhbz795424-bitpos-21of25.patch @@ -52,10 +52,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-ensure-size_t.patch -Index: gdb-7.6.90.20140127/gdb/alpha-tdep.c +Index: gdb-7.7.90.20140613/gdb/alpha-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/alpha-tdep.c 2014-02-06 18:18:51.005616676 +0100 -+++ gdb-7.6.90.20140127/gdb/alpha-tdep.c 2014-02-06 18:18:53.671621349 +0100 +--- gdb-7.7.90.20140613.orig/gdb/alpha-tdep.c 2014-06-13 22:14:49.725846383 +0200 ++++ gdb-7.7.90.20140613/gdb/alpha-tdep.c 2014-06-13 22:14:53.163850081 +0200 @@ -414,6 +414,13 @@ alpha_push_dummy_call (struct gdbarch *g accumulate_size = 0; else @@ -70,11 +70,11 @@ Index: gdb-7.6.90.20140127/gdb/alpha-tdep.c sp -= accumulate_size; /* Keep sp aligned to a multiple of 16 as the ABI requires. */ -Index: gdb-7.6.90.20140127/gdb/cp-valprint.c +Index: gdb-7.7.90.20140613/gdb/cp-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/cp-valprint.c 2014-02-06 18:18:51.006616677 +0100 -+++ gdb-7.6.90.20140127/gdb/cp-valprint.c 2014-02-06 18:18:53.671621349 +0100 -@@ -537,6 +537,8 @@ cp_print_value (struct type *type, struc +--- gdb-7.7.90.20140613.orig/gdb/cp-valprint.c 2014-06-13 22:14:49.725846383 +0200 ++++ gdb-7.7.90.20140613/gdb/cp-valprint.c 2014-06-13 22:14:53.164850081 +0200 +@@ -538,6 +538,8 @@ cp_print_value (struct type *type, struc gdb_byte *buf; struct cleanup *back_to; @@ -83,11 +83,11 @@ Index: gdb-7.6.90.20140127/gdb/cp-valprint.c buf = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, buf); -Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c +Index: gdb-7.7.90.20140613/gdb/dwarf2loc.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/dwarf2loc.c 2014-02-06 18:18:51.007616678 +0100 -+++ gdb-7.6.90.20140127/gdb/dwarf2loc.c 2014-02-06 18:18:53.672621293 +0100 -@@ -1821,6 +1821,8 @@ read_pieced_value (struct value *v) +--- gdb-7.7.90.20140613.orig/gdb/dwarf2loc.c 2014-06-13 22:14:49.726846384 +0200 ++++ gdb-7.7.90.20140613/gdb/dwarf2loc.c 2014-06-13 22:14:53.166850084 +0200 +@@ -1666,6 +1666,8 @@ read_pieced_value (struct value *v) this_size = (this_size_bits + source_offset_bits % 8 + 7) / 8; source_offset = source_offset_bits / 8; @@ -96,7 +96,7 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c if (buffer_size < this_size) { buffer_size = this_size; -@@ -2012,6 +2014,7 @@ write_pieced_value (struct value *to, st +@@ -1857,6 +1859,7 @@ write_pieced_value (struct value *to, st } else { @@ -104,10 +104,10 @@ Index: gdb-7.6.90.20140127/gdb/dwarf2loc.c if (buffer_size < this_size) { buffer_size = this_size; -Index: gdb-7.6.90.20140127/gdb/findcmd.c +Index: gdb-7.7.90.20140613/gdb/findcmd.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/findcmd.c 2014-02-06 18:18:51.008616679 +0100 -+++ gdb-7.6.90.20140127/gdb/findcmd.c 2014-02-06 18:18:53.673621239 +0100 +--- gdb-7.7.90.20140613.orig/gdb/findcmd.c 2014-06-13 22:14:49.726846384 +0200 ++++ gdb-7.7.90.20140613/gdb/findcmd.c 2014-06-13 22:14:53.166850084 +0200 @@ -185,6 +185,7 @@ parse_find_args (char *args, ULONGEST *m size_t current_offset = pattern_buf_end - pattern_buf; @@ -116,11 +116,11 @@ Index: gdb-7.6.90.20140127/gdb/findcmd.c pattern_buf = xrealloc (pattern_buf, pattern_buf_size); pattern_buf_end = pattern_buf + current_offset; } -Index: gdb-7.6.90.20140127/gdb/p-valprint.c +Index: gdb-7.7.90.20140613/gdb/p-valprint.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/p-valprint.c 2014-02-06 18:18:51.008616679 +0100 -+++ gdb-7.6.90.20140127/gdb/p-valprint.c 2014-02-06 18:18:53.673621239 +0100 -@@ -798,6 +798,7 @@ pascal_object_print_value (struct type * +--- gdb-7.7.90.20140613.orig/gdb/p-valprint.c 2014-06-13 22:14:49.728846387 +0200 ++++ gdb-7.7.90.20140613/gdb/p-valprint.c 2014-06-13 22:14:53.166850084 +0200 +@@ -772,6 +772,7 @@ pascal_object_print_value (struct type * gdb_byte *buf; struct cleanup *back_to; @@ -128,12 +128,12 @@ Index: gdb-7.6.90.20140127/gdb/p-valprint.c buf = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, buf); -Index: gdb-7.6.90.20140127/gdb/utils.c +Index: gdb-7.7.90.20140613/gdb/utils.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/utils.c 2014-02-06 18:18:51.008616679 +0100 -+++ gdb-7.6.90.20140127/gdb/utils.c 2014-02-06 18:18:53.674621186 +0100 -@@ -3169,6 +3169,18 @@ host_address_to_string (const void *addr - return str; +--- gdb-7.7.90.20140613.orig/gdb/utils.c 2014-06-13 22:14:53.166850084 +0200 ++++ gdb-7.7.90.20140613/gdb/utils.c 2014-06-13 22:15:16.839875341 +0200 +@@ -2838,6 +2838,18 @@ string_to_core_addr (const char *my_stri + return addr; } +/* Ensure that the input NUM is not larger than the maximum capacity of the @@ -151,11 +151,11 @@ Index: gdb-7.6.90.20140127/gdb/utils.c char * gdb_realpath (const char *filename) { -Index: gdb-7.6.90.20140127/gdb/valops.c +Index: gdb-7.7.90.20140613/gdb/valops.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/valops.c 2014-02-06 18:18:51.009616680 +0100 -+++ gdb-7.6.90.20140127/gdb/valops.c 2014-02-06 18:18:53.675621135 +0100 -@@ -2184,6 +2184,7 @@ search_struct_method (const char *name, +--- gdb-7.7.90.20140613.orig/gdb/valops.c 2014-06-13 22:14:49.730846389 +0200 ++++ gdb-7.7.90.20140613/gdb/valops.c 2014-06-13 22:14:53.169850088 +0200 +@@ -2074,6 +2074,7 @@ search_struct_method (const char *name, struct cleanup *back_to; CORE_ADDR address; @@ -163,11 +163,11 @@ Index: gdb-7.6.90.20140127/gdb/valops.c tmp = xmalloc (TYPE_LENGTH (baseclass)); back_to = make_cleanup (xfree, tmp); address = value_address (*arg1p); -Index: gdb-7.6.90.20140127/gdb/value.c +Index: gdb-7.7.90.20140613/gdb/value.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/value.c 2014-02-06 18:18:51.010616681 +0100 -+++ gdb-7.6.90.20140127/gdb/value.c 2014-02-06 18:19:10.261637398 +0100 -@@ -822,6 +822,7 @@ allocate_value_lazy (struct type *type) +--- gdb-7.7.90.20140613.orig/gdb/value.c 2014-06-13 22:14:49.732846391 +0200 ++++ gdb-7.7.90.20140613/gdb/value.c 2014-06-13 22:14:53.169850088 +0200 +@@ -824,6 +824,7 @@ allocate_value_lazy (struct type *type) description correctly. */ check_typedef (type); @@ -175,7 +175,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c val = (struct value *) xzalloc (sizeof (struct value)); val->contents = NULL; val->next = all_values; -@@ -853,6 +854,8 @@ allocate_value_lazy (struct type *type) +@@ -855,6 +856,8 @@ allocate_value_lazy (struct type *type) static void allocate_value_contents (struct value *val) { @@ -184,7 +184,7 @@ Index: gdb-7.6.90.20140127/gdb/value.c if (!val->contents) val->contents = (gdb_byte *) xzalloc (TYPE_LENGTH (val->enclosing_type)); } -@@ -2854,8 +2857,12 @@ void +@@ -2831,8 +2834,12 @@ void set_value_enclosing_type (struct value *val, struct type *new_encl_type) { if (TYPE_LENGTH (new_encl_type) > TYPE_LENGTH (value_enclosing_type (val))) @@ -199,10 +199,10 @@ Index: gdb-7.6.90.20140127/gdb/value.c val->enclosing_type = new_encl_type; } -Index: gdb-7.6.90.20140127/gdb/vax-tdep.c +Index: gdb-7.7.90.20140613/gdb/vax-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/vax-tdep.c 2014-02-06 18:18:51.370617068 +0100 -+++ gdb-7.6.90.20140127/gdb/vax-tdep.c 2014-02-06 18:18:53.676621086 +0100 +--- gdb-7.7.90.20140613.orig/gdb/vax-tdep.c 2014-06-13 22:14:49.732846391 +0200 ++++ gdb-7.7.90.20140613/gdb/vax-tdep.c 2014-06-13 22:14:53.169850088 +0200 @@ -223,6 +223,7 @@ vax_return_value (struct gdbarch *gdbarc ULONGEST addr; @@ -211,11 +211,11 @@ Index: gdb-7.6.90.20140127/gdb/vax-tdep.c read_memory (addr, readbuf, len); } -Index: gdb-7.6.90.20140127/gdb/defs.h +Index: gdb-7.7.90.20140613/gdb/defs.h =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/defs.h 2014-02-06 18:18:51.370617068 +0100 -+++ gdb-7.6.90.20140127/gdb/defs.h 2014-02-06 18:18:53.677621038 +0100 -@@ -768,4 +768,6 @@ enum block_enum +--- gdb-7.7.90.20140613.orig/gdb/defs.h 2014-06-13 22:14:49.732846391 +0200 ++++ gdb-7.7.90.20140613/gdb/defs.h 2014-06-13 22:14:53.169850088 +0200 +@@ -756,4 +756,6 @@ enum block_enum #include "utils.h" diff --git a/gdb-rhbz795424-bitpos-22of25.patch b/gdb-rhbz795424-bitpos-22of25.patch index 0e0a007..984cbb3 100644 --- a/gdb-rhbz795424-bitpos-22of25.patch +++ b/gdb-rhbz795424-bitpos-22of25.patch @@ -96,29 +96,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-wp.patch -Index: gdb-7.6.50.20130731-cvs/gdb/arm-linux-nat.c +Index: gdb-7.8/gdb/arm-linux-nat.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/arm-linux-nat.c 2013-08-02 16:42:29.565632895 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/arm-linux-nat.c 2013-08-02 16:42:34.094639104 +0200 -@@ -1105,7 +1105,7 @@ arm_linux_region_ok_for_hw_watchpoint (C - - /* Insert a Hardware breakpoint. */ - static int --arm_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, -+arm_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) - { - struct lwp_info *lp; -@@ -1123,7 +1123,7 @@ arm_linux_insert_watchpoint (CORE_ADDR a - - /* Remove a hardware breakpoint. */ - static int --arm_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, -+arm_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) - { - struct lwp_info *lp; -@@ -1180,7 +1180,7 @@ arm_linux_stopped_by_watchpoint (void) +--- gdb-7.8.orig/gdb/arm-linux-nat.c 2014-08-01 23:27:30.183773676 +0200 ++++ gdb-7.8/gdb/arm-linux-nat.c 2014-08-01 23:27:30.241773754 +0200 +@@ -1296,7 +1296,7 @@ arm_linux_stopped_by_watchpoint (struct static int arm_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -127,151 +109,11 @@ Index: gdb-7.6.50.20130731-cvs/gdb/arm-linux-nat.c { return start <= addr && start + length - 1 >= addr; } -Index: gdb-7.6.50.20130731-cvs/gdb/i386-nat.c +Index: gdb-7.8/gdb/ppc-linux-nat.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/i386-nat.c 2013-08-02 16:42:29.566632896 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/i386-nat.c 2013-08-02 16:42:34.095639105 +0200 -@@ -589,7 +589,7 @@ i386_update_inferior_debug_regs (struct - of the type TYPE. Return 0 on success, -1 on failure. */ - - static int --i386_insert_watchpoint (CORE_ADDR addr, int len, int type, -+i386_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct i386_debug_reg_state *state -@@ -627,7 +627,7 @@ i386_insert_watchpoint (CORE_ADDR addr, - address ADDR, whose length is LEN bytes, and for accesses of the - type TYPE. Return 0 on success, -1 on failure. */ - static int --i386_remove_watchpoint (CORE_ADDR addr, int len, int type, -+i386_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct i386_debug_reg_state *state -Index: gdb-7.6.50.20130731-cvs/gdb/ia64-linux-nat.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/ia64-linux-nat.c 2013-08-02 16:42:29.566632896 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/ia64-linux-nat.c 2013-08-02 16:42:34.095639105 +0200 -@@ -542,7 +542,7 @@ is_power_of_2 (int val) - } - - static int --ia64_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, -+ia64_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) - { - struct lwp_info *lp; -@@ -596,7 +596,7 @@ ia64_linux_insert_watchpoint (CORE_ADDR - } - - static int --ia64_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, -+ia64_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int idx; -Index: gdb-7.6.50.20130731-cvs/gdb/inf-ttrace.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/inf-ttrace.c 2013-08-02 16:42:29.567632898 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/inf-ttrace.c 2013-08-02 16:42:34.095639105 +0200 -@@ -314,14 +314,14 @@ inf_ttrace_disable_page_protections (pid - type TYPE. */ - - static int --inf_ttrace_insert_watchpoint (CORE_ADDR addr, int len, int type, -+inf_ttrace_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - const int pagesize = inf_ttrace_page_dict.pagesize; - pid_t pid = ptid_get_pid (inferior_ptid); - CORE_ADDR page_addr; -- int num_pages; -- int page; -+ LONGEST num_pages; -+ LONGEST page; - - gdb_assert (type == hw_write); - -@@ -338,14 +338,14 @@ inf_ttrace_insert_watchpoint (CORE_ADDR - type TYPE. */ - - static int --inf_ttrace_remove_watchpoint (CORE_ADDR addr, int len, int type, -+inf_ttrace_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - const int pagesize = inf_ttrace_page_dict.pagesize; - pid_t pid = ptid_get_pid (inferior_ptid); - CORE_ADDR page_addr; -- int num_pages; -- int page; -+ LONGEST num_pages; -+ LONGEST page; - - gdb_assert (type == hw_write); - -Index: gdb-7.6.50.20130731-cvs/gdb/mips-linux-nat.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/mips-linux-nat.c 2013-08-02 16:42:29.568632899 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/mips-linux-nat.c 2013-08-02 16:42:34.096639106 +0200 -@@ -644,7 +644,7 @@ mips_linux_new_thread (struct lwp_info * - watch. Return zero on success. */ - - static int --mips_linux_insert_watchpoint (CORE_ADDR addr, int len, int type, -+mips_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct pt_watch_regs regs; -@@ -697,7 +697,7 @@ mips_linux_insert_watchpoint (CORE_ADDR - Return zero on success. */ - - static int --mips_linux_remove_watchpoint (CORE_ADDR addr, int len, int type, -+mips_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int retval; -Index: gdb-7.6.50.20130731-cvs/gdb/nto-procfs.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/nto-procfs.c 2013-08-02 16:42:29.568632899 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/nto-procfs.c 2013-08-02 16:42:34.096639106 +0200 -@@ -69,10 +69,10 @@ static ptid_t do_attach (ptid_t ptid); - - static int procfs_can_use_hw_breakpoint (int, int, int); - --static int procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, -+static int procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond); - --static int procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, -+static int procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond); - - static int procfs_stopped_by_watchpoint (void); -@@ -1493,14 +1493,14 @@ procfs_can_use_hw_breakpoint (int type, - } - - static int --procfs_remove_hw_watchpoint (CORE_ADDR addr, int len, int type, -+procfs_remove_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - return procfs_hw_watchpoint (addr, -1, type); - } - - static int --procfs_insert_hw_watchpoint (CORE_ADDR addr, int len, int type, -+procfs_insert_hw_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - return procfs_hw_watchpoint (addr, len, type); -Index: gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/ppc-linux-nat.c 2013-08-02 16:42:29.570632902 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c 2013-08-02 16:42:34.097639108 +0200 -@@ -1853,11 +1853,11 @@ can_use_watchpoint_cond_accel (void) +--- gdb-7.8.orig/gdb/ppc-linux-nat.c 2014-08-01 23:27:30.202773701 +0200 ++++ gdb-7.8/gdb/ppc-linux-nat.c 2014-08-01 23:29:38.311944925 +0200 +@@ -1862,11 +1862,11 @@ can_use_watchpoint_cond_accel (void) CONDITION_VALUE will hold the value which should be put in the DVC register. */ static void @@ -286,7 +128,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c CORE_ADDR addr_end_data, addr_end_dvc; /* The DVC register compares bytes within fixed-length windows which -@@ -1944,7 +1944,7 @@ num_memory_accesses (struct value *v) +@@ -1953,7 +1953,7 @@ num_memory_accesses (struct value *v) of the constant. */ static int check_condition (CORE_ADDR watch_addr, struct expression *cond, @@ -295,16 +137,16 @@ Index: gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c { int pc = 1, num_accesses_left, num_accesses_right; struct value *left_val, *right_val, *left_chain, *right_chain; -@@ -2011,7 +2011,7 @@ check_condition (CORE_ADDR watch_addr, s - the condition expression, thus only triggering the watchpoint when it is +@@ -2021,7 +2021,7 @@ check_condition (CORE_ADDR watch_addr, s true. */ static int --ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, -+ppc_linux_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, + ppc_linux_can_accel_watchpoint_condition (struct target_ops *self, +- CORE_ADDR addr, int len, int rw, ++ CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { CORE_ADDR data_value; -@@ -2028,7 +2028,7 @@ ppc_linux_can_accel_watchpoint_condition +@@ -2038,7 +2038,7 @@ ppc_linux_can_accel_watchpoint_condition static void create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr, @@ -313,25 +155,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c int insert) { if (len == 1 -@@ -2073,7 +2073,7 @@ create_watchpoint_request (struct ppc_hw - } - - static int --ppc_linux_insert_watchpoint (CORE_ADDR addr, int len, int rw, -+ppc_linux_insert_watchpoint (CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) - { - struct lwp_info *lp; -@@ -2141,7 +2141,7 @@ ppc_linux_insert_watchpoint (CORE_ADDR a - } - - static int --ppc_linux_remove_watchpoint (CORE_ADDR addr, int len, int rw, -+ppc_linux_remove_watchpoint (CORE_ADDR addr, LONGEST len, int rw, - struct expression *cond) - { - struct lwp_info *lp; -@@ -2292,7 +2292,7 @@ ppc_linux_stopped_by_watchpoint (void) +@@ -2304,7 +2304,7 @@ ppc_linux_stopped_by_watchpoint (struct static int ppc_linux_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -340,11 +164,11 @@ Index: gdb-7.6.50.20130731-cvs/gdb/ppc-linux-nat.c { int mask; -Index: gdb-7.6.50.20130731-cvs/gdb/procfs.c +Index: gdb-7.8/gdb/procfs.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/procfs.c 2013-08-02 16:42:29.572632904 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/procfs.c 2013-08-02 16:42:34.098639109 +0200 -@@ -2433,7 +2433,7 @@ procfs_address_to_host_pointer (CORE_ADD +--- gdb-7.8.orig/gdb/procfs.c 2014-08-01 23:27:30.203773703 +0200 ++++ gdb-7.8/gdb/procfs.c 2014-08-01 23:27:30.243773756 +0200 +@@ -2429,7 +2429,7 @@ procfs_address_to_host_pointer (CORE_ADD #endif static int @@ -353,7 +177,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/procfs.c { #if !defined (PCWATCH) && !defined (PIOCSWATCH) /* If neither or these is defined, we can't support watchpoints. -@@ -4777,7 +4777,7 @@ procfs_pid_to_str (struct target_ops *op +@@ -4762,7 +4762,7 @@ procfs_pid_to_str (struct target_ops *op /* Insert a watchpoint. */ static int @@ -362,102 +186,11 @@ Index: gdb-7.6.50.20130731-cvs/gdb/procfs.c int after) { #ifndef AIX5 -@@ -4897,7 +4897,7 @@ procfs_stopped_data_address (struct targ - } - - static int --procfs_insert_watchpoint (CORE_ADDR addr, int len, int type, -+procfs_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - if (!target_have_steppable_watchpoint -@@ -4919,7 +4919,7 @@ procfs_insert_watchpoint (CORE_ADDR addr - } - - static int --procfs_remove_watchpoint (CORE_ADDR addr, int len, int type, -+procfs_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - return procfs_set_watchpoint (inferior_ptid, addr, 0, 0, 0); -Index: gdb-7.6.50.20130731-cvs/gdb/remote-m32r-sdi.c +Index: gdb-7.8/gdb/remote.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/remote-m32r-sdi.c 2013-08-02 16:42:29.573632906 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/remote-m32r-sdi.c 2013-08-02 16:42:34.099639111 +0200 -@@ -1416,14 +1416,15 @@ m32r_can_use_hw_watchpoint (int type, in - watchpoint. */ - - static int --m32r_insert_watchpoint (CORE_ADDR addr, int len, int type, -+m32r_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int i; - - if (remote_debug) -- fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%d,%d)\n", -- paddress (target_gdbarch (), addr), len, type); -+ fprintf_unfiltered (gdb_stdlog, "m32r_insert_watchpoint(%s,%s,%d)\n", -+ paddress (target_gdbarch (), addr), plongest (len), -+ type); - - for (i = 0; i < MAX_ACCESS_BREAKS; i++) - { -@@ -1441,14 +1442,15 @@ m32r_insert_watchpoint (CORE_ADDR addr, - } - - static int --m32r_remove_watchpoint (CORE_ADDR addr, int len, int type, -+m32r_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int i; - - if (remote_debug) -- fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%d,%d)\n", -- paddress (target_gdbarch (), addr), len, type); -+ fprintf_unfiltered (gdb_stdlog, "m32r_remove_watchpoint(%s,%s,%d)\n", -+ paddress (target_gdbarch (), addr), plongest (len), -+ type); - - for (i = 0; i < MAX_ACCESS_BREAKS; i++) - { -Index: gdb-7.6.50.20130731-cvs/gdb/remote-mips.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/remote-mips.c 2013-08-02 16:42:29.574632907 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/remote-mips.c 2013-08-02 16:42:34.100639112 +0200 -@@ -2426,7 +2426,7 @@ calculate_mask (CORE_ADDR addr, int len) - watchpoint. */ - - static int --mips_insert_watchpoint (CORE_ADDR addr, int len, int type, -+mips_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - if (mips_set_breakpoint (addr, len, type)) -@@ -2438,7 +2438,7 @@ mips_insert_watchpoint (CORE_ADDR addr, - /* Remove a watchpoint. */ - - static int --mips_remove_watchpoint (CORE_ADDR addr, int len, int type, -+mips_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - if (mips_clear_breakpoint (addr, len, type)) -Index: gdb-7.6.50.20130731-cvs/gdb/remote.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/remote.c 2013-08-02 16:42:29.577632911 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/remote.c 2013-08-02 16:42:34.103639116 +0200 -@@ -8277,7 +8277,7 @@ watchpoint_to_Z_packet (int type) - } - - static int --remote_insert_watchpoint (CORE_ADDR addr, int len, int type, -+remote_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct remote_state *rs = get_remote_state (); -@@ -8297,7 +8297,7 @@ remote_insert_watchpoint (CORE_ADDR addr +--- gdb-7.8.orig/gdb/remote.c 2014-08-01 23:27:30.205773705 +0200 ++++ gdb-7.8/gdb/remote.c 2014-08-01 23:27:30.246773760 +0200 +@@ -8206,7 +8206,7 @@ remote_insert_watchpoint (struct target_ p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -466,7 +199,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -@@ -8317,7 +8317,7 @@ remote_insert_watchpoint (CORE_ADDR addr +@@ -8226,7 +8226,7 @@ remote_insert_watchpoint (struct target_ static int remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -475,16 +208,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/remote.c { CORE_ADDR diff = remote_address_masked (addr - start); -@@ -8326,7 +8326,7 @@ remote_watchpoint_addr_within_range (str - - - static int --remote_remove_watchpoint (CORE_ADDR addr, int len, int type, -+remote_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct remote_state *rs = get_remote_state (); -@@ -8346,7 +8346,7 @@ remote_remove_watchpoint (CORE_ADDR addr +@@ -8256,7 +8256,7 @@ remote_remove_watchpoint (struct target_ p = strchr (rs->buf, '\0'); addr = remote_address_masked (addr); p += hexnumstr (p, (ULONGEST) addr); @@ -493,92 +217,36 @@ Index: gdb-7.6.50.20130731-cvs/gdb/remote.c putpkt (rs->buf); getpkt (&rs->buf, &rs->buf_size, 0); -Index: gdb-7.6.50.20130731-cvs/gdb/s390-linux-nat.c +Index: gdb-7.8/gdb/target.c =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/s390-linux-nat.c 2013-08-02 16:42:29.578632913 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/s390-linux-nat.c 2013-08-02 16:42:34.103639116 +0200 -@@ -516,7 +516,7 @@ s390_fix_watch_points (struct lwp_info * - } - - static int --s390_insert_watchpoint (CORE_ADDR addr, int len, int type, -+s390_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct lwp_info *lp; -@@ -537,7 +537,7 @@ s390_insert_watchpoint (CORE_ADDR addr, - } - - static int --s390_remove_watchpoint (CORE_ADDR addr, int len, int type, -+s390_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - struct lwp_info *lp; -Index: gdb-7.6.50.20130731-cvs/gdb/target.c -=================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/target.c 2013-08-02 16:42:29.580632915 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/target.c 2013-08-02 16:42:52.160663787 +0200 -@@ -49,7 +49,7 @@ static void target_info (char *, int); - static void default_terminal_info (const char *, int); +--- gdb-7.8.orig/gdb/target.c 2014-08-01 23:27:30.206773707 +0200 ++++ gdb-7.8/gdb/target.c 2014-08-01 23:29:38.314944857 +0200 +@@ -52,7 +52,7 @@ static void target_info (char *, int); + static void default_terminal_info (struct target_ops *, const char *, int); static int default_watchpoint_addr_within_range (struct target_ops *, - CORE_ADDR, CORE_ADDR, int); + CORE_ADDR, CORE_ADDR, LONGEST); - static int default_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); - -@@ -114,10 +114,10 @@ static int debug_to_insert_hw_breakpoint - static int debug_to_remove_hw_breakpoint (struct gdbarch *, - struct bp_target_info *); - --static int debug_to_insert_watchpoint (CORE_ADDR, int, int, -+static int debug_to_insert_watchpoint (CORE_ADDR, LONGEST, int, - struct expression *); - --static int debug_to_remove_watchpoint (CORE_ADDR, int, int, -+static int debug_to_remove_watchpoint (CORE_ADDR, LONGEST, int, - struct expression *); - - static int debug_to_stopped_by_watchpoint (void); -@@ -125,11 +125,12 @@ static int debug_to_stopped_by_watchpoin + static int default_region_ok_for_hw_watchpoint (struct target_ops *, + CORE_ADDR, LONGEST); +@@ -150,13 +150,13 @@ static int debug_to_remove_watchpoint (s static int debug_to_stopped_data_address (struct target_ops *, CORE_ADDR *); static int debug_to_watchpoint_addr_within_range (struct target_ops *, - CORE_ADDR, CORE_ADDR, int); -+ CORE_ADDR, CORE_ADDR, -+ LONGEST); ++ CORE_ADDR, CORE_ADDR, LONGEST); - static int debug_to_region_ok_for_hw_watchpoint (CORE_ADDR, LONGEST); + static int debug_to_region_ok_for_hw_watchpoint (struct target_ops *self, + CORE_ADDR, LONGEST); --static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, int, int, -+static int debug_to_can_accel_watchpoint_condition (CORE_ADDR, LONGEST, int, + static int debug_to_can_accel_watchpoint_condition (struct target_ops *self, +- CORE_ADDR, int, int, ++ CORE_ADDR, LONGEST, int, struct expression *); - static void debug_to_terminal_init (void); -@@ -790,10 +791,10 @@ update_current_target (void) - (int (*) (struct gdbarch *, struct bp_target_info *)) - return_minus_one); - de_fault (to_insert_watchpoint, -- (int (*) (CORE_ADDR, int, int, struct expression *)) -+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) - return_minus_one); - de_fault (to_remove_watchpoint, -- (int (*) (CORE_ADDR, int, int, struct expression *)) -+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) - return_minus_one); - de_fault (to_stopped_by_watchpoint, - (int (*) (void)) -@@ -806,7 +807,7 @@ update_current_target (void) - de_fault (to_region_ok_for_hw_watchpoint, - default_region_ok_for_hw_watchpoint); - de_fault (to_can_accel_watchpoint_condition, -- (int (*) (CORE_ADDR, int, int, struct expression *)) -+ (int (*) (CORE_ADDR, LONGEST, int, struct expression *)) - return_zero); - de_fault (to_terminal_init, - (void (*) (void)) -@@ -3594,7 +3595,7 @@ default_region_ok_for_hw_watchpoint (COR + static void debug_to_terminal_init (struct target_ops *self); +@@ -2960,7 +2960,7 @@ default_region_ok_for_hw_watchpoint (str static int default_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -587,16 +255,16 @@ Index: gdb-7.6.50.20130731-cvs/gdb/target.c { return addr >= start && addr < start + length; } -@@ -4555,7 +4556,7 @@ debug_to_region_ok_for_hw_watchpoint (CO - } +@@ -3681,7 +3681,7 @@ debug_to_region_ok_for_hw_watchpoint (st static int --debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, int len, int rw, -+debug_to_can_accel_watchpoint_condition (CORE_ADDR addr, LONGEST len, int rw, + debug_to_can_accel_watchpoint_condition (struct target_ops *self, +- CORE_ADDR addr, int len, int rw, ++ CORE_ADDR addr, LONGEST len, int rw, struct expression *cond) { int retval; -@@ -4565,8 +4566,8 @@ debug_to_can_accel_watchpoint_condition +@@ -3692,8 +3692,8 @@ debug_to_can_accel_watchpoint_condition fprintf_unfiltered (gdb_stdlog, "target_can_accel_watchpoint_condition " @@ -607,7 +275,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/target.c host_address_to_string (cond), (unsigned long) retval); return retval; } -@@ -4601,7 +4602,7 @@ debug_to_stopped_data_address (struct ta +@@ -3728,7 +3728,7 @@ debug_to_stopped_data_address (struct ta static int debug_to_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr, @@ -616,7 +284,7 @@ Index: gdb-7.6.50.20130731-cvs/gdb/target.c { int retval; -@@ -4609,9 +4610,9 @@ debug_to_watchpoint_addr_within_range (s +@@ -3736,9 +3736,9 @@ debug_to_watchpoint_addr_within_range (s start, length); fprintf_filtered (gdb_stdlog, @@ -628,72 +296,137 @@ Index: gdb-7.6.50.20130731-cvs/gdb/target.c return retval; } -@@ -4646,7 +4647,7 @@ debug_to_remove_hw_breakpoint (struct gd - } - - static int --debug_to_insert_watchpoint (CORE_ADDR addr, int len, int type, -+debug_to_insert_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int retval; -@@ -4654,14 +4655,14 @@ debug_to_insert_watchpoint (CORE_ADDR ad - retval = debug_target.to_insert_watchpoint (addr, len, type, cond); - - fprintf_unfiltered (gdb_stdlog, -- "target_insert_watchpoint (%s, %d, %d, %s) = %ld\n", -- core_addr_to_string (addr), len, type, -+ "target_insert_watchpoint (%s, %s, %d, %s) = %ld\n", -+ core_addr_to_string (addr), plongest (len), type, - host_address_to_string (cond), (unsigned long) retval); - return retval; - } - - static int --debug_to_remove_watchpoint (CORE_ADDR addr, int len, int type, -+debug_to_remove_watchpoint (CORE_ADDR addr, LONGEST len, int type, - struct expression *cond) - { - int retval; -@@ -4669,8 +4670,8 @@ debug_to_remove_watchpoint (CORE_ADDR ad - retval = debug_target.to_remove_watchpoint (addr, len, type, cond); - - fprintf_unfiltered (gdb_stdlog, -- "target_remove_watchpoint (%s, %d, %d, %s) = %ld\n", -- core_addr_to_string (addr), len, type, -+ "target_remove_watchpoint (%s, %s, %d, %s) = %ld\n", -+ core_addr_to_string (addr), plongest (len), type, - host_address_to_string (cond), (unsigned long) retval); - return retval; - } -Index: gdb-7.6.50.20130731-cvs/gdb/target.h +Index: gdb-7.8/gdb/target.h =================================================================== ---- gdb-7.6.50.20130731-cvs.orig/gdb/target.h 2013-08-02 16:42:29.580632915 +0200 -+++ gdb-7.6.50.20130731-cvs/gdb/target.h 2013-08-02 16:42:34.105639119 +0200 -@@ -373,8 +373,8 @@ struct target_ops - - /* Documentation of what the two routines below are expected to do is - provided with the corresponding target_* macros. */ -- int (*to_remove_watchpoint) (CORE_ADDR, int, int, struct expression *); -- int (*to_insert_watchpoint) (CORE_ADDR, int, int, struct expression *); -+ int (*to_remove_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); -+ int (*to_insert_watchpoint) (CORE_ADDR, LONGEST, int, struct expression *); - - int (*to_insert_mask_watchpoint) (struct target_ops *, - CORE_ADDR, CORE_ADDR, int); -@@ -385,13 +385,13 @@ struct target_ops - int to_have_continuable_watchpoint; - int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *); +--- gdb-7.8.orig/gdb/target.h 2014-08-01 23:27:30.207773708 +0200 ++++ gdb-7.8/gdb/target.h 2014-08-01 23:29:38.315944839 +0200 +@@ -469,7 +469,7 @@ struct target_ops + int (*to_stopped_data_address) (struct target_ops *, CORE_ADDR *) + TARGET_DEFAULT_RETURN (0); int (*to_watchpoint_addr_within_range) (struct target_ops *, -- CORE_ADDR, CORE_ADDR, int); -+ CORE_ADDR, CORE_ADDR, LONGEST); +- CORE_ADDR, CORE_ADDR, int) ++ CORE_ADDR, CORE_ADDR, LONGEST) + TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range); /* Documentation of this routine is provided with the corresponding - target_* macro. */ - int (*to_region_ok_for_hw_watchpoint) (CORE_ADDR, LONGEST); +@@ -479,7 +479,7 @@ struct target_ops + TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint); -- int (*to_can_accel_watchpoint_condition) (CORE_ADDR, int, int, -+ int (*to_can_accel_watchpoint_condition) (CORE_ADDR, LONGEST, int, - struct expression *); + int (*to_can_accel_watchpoint_condition) (struct target_ops *, +- CORE_ADDR, int, int, ++ CORE_ADDR, LONGEST, int, + struct expression *) + TARGET_DEFAULT_RETURN (0); int (*to_masked_watch_num_registers) (struct target_ops *, - CORE_ADDR, CORE_ADDR); +Index: gdb-7.8/gdb/aarch64-linux-nat.c +=================================================================== +--- gdb-7.8.orig/gdb/aarch64-linux-nat.c 2014-08-01 23:27:30.212773715 +0200 ++++ gdb-7.8/gdb/aarch64-linux-nat.c 2014-08-01 23:27:30.248773763 +0200 +@@ -428,14 +428,14 @@ aarch64_notify_debug_reg_change (const s + static void + aarch64_show_debug_reg_state (struct aarch64_debug_reg_state *state, + const char *func, CORE_ADDR addr, +- int len, int type) ++ LONGEST len, int type) + { + int i; + + fprintf_unfiltered (gdb_stdlog, "%s", func); + if (addr || len) +- fprintf_unfiltered (gdb_stdlog, " (addr=0x%08lx, len=%d, type=%s)", +- (unsigned long) addr, len, ++ fprintf_unfiltered (gdb_stdlog, " (addr=0x%08lx, len=%s, type=%s)", ++ (unsigned long) addr, plongest (len), + type == hw_write ? "hw-write-watchpoint" + : (type == hw_read ? "hw-read-watchpoint" + : (type == hw_access ? "hw-access-watchpoint" +@@ -869,9 +869,10 @@ aarch64_linux_read_description (struct t + gdbserver/linux-aarch64-low.c for more information. */ + + static void +-aarch64_align_watchpoint (CORE_ADDR addr, int len, CORE_ADDR *aligned_addr_p, ++aarch64_align_watchpoint (CORE_ADDR addr, LONGEST len, ++ CORE_ADDR *aligned_addr_p, + int *aligned_len_p, CORE_ADDR *next_addr_p, +- int *next_len_p) ++ LONGEST *next_len_p) + { + int aligned_len; + unsigned int offset; +@@ -1038,7 +1039,7 @@ aarch64_point_encode_ctrl_reg (int type, + Return 0 for any non-compliant ADDR and/or LEN; return 1 otherwise. */ + + static int +-aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, int len) ++aarch64_point_is_aligned (int is_watchpoint, CORE_ADDR addr, LONGEST len) + { + unsigned int alignment = is_watchpoint ? AARCH64_HWP_ALIGNMENT + : AARCH64_HBP_ALIGNMENT; +@@ -1290,7 +1291,7 @@ aarch64_handle_aligned_watchpoint (int t + Return 0 if succeed. */ + + static int +-aarch64_handle_unaligned_watchpoint (int type, CORE_ADDR addr, int len, ++aarch64_handle_unaligned_watchpoint (int type, CORE_ADDR addr, LONGEST len, + int is_insert) + { + struct aarch64_debug_reg_state *state +@@ -1315,8 +1316,8 @@ aarch64_handle_unaligned_watchpoint (int + fprintf_unfiltered (gdb_stdlog, + "handle_unaligned_watchpoint: is_insert: %d\n" + " aligned_addr: 0x%08lx, aligned_len: %d\n" +-" next_addr: 0x%08lx, next_len: %d\n", +- is_insert, aligned_addr, aligned_len, addr, len); ++" next_addr: 0x%08lx, next_len: %s\n", ++ is_insert, aligned_addr, aligned_len, addr, plongest (len)); + + if (ret != 0) + return ret; +@@ -1328,7 +1329,7 @@ aarch64_handle_unaligned_watchpoint (int + /* Implements insertion and removal of a single watchpoint. */ + + static int +-aarch64_handle_watchpoint (int type, CORE_ADDR addr, int len, int is_insert) ++aarch64_handle_watchpoint (int type, CORE_ADDR addr, LONGEST len, int is_insert) + { + if (aarch64_point_is_aligned (1 /* is_watchpoint */ , addr, len)) + return aarch64_handle_aligned_watchpoint (type, addr, len, is_insert); +@@ -1497,7 +1498,7 @@ aarch64_linux_stopped_by_watchpoint (str + static int + aarch64_linux_watchpoint_addr_within_range (struct target_ops *target, + CORE_ADDR addr, +- CORE_ADDR start, int length) ++ CORE_ADDR start, LONGEST length) + { + return start <= addr && start + length - 1 >= addr; + } +Index: gdb-7.8/gdb/target-delegates.c +=================================================================== +--- gdb-7.8.orig/gdb/target-delegates.c 2014-08-01 23:27:30.212773715 +0200 ++++ gdb-7.8/gdb/target-delegates.c 2014-08-01 23:29:38.313944877 +0200 +@@ -261,7 +261,7 @@ tdefault_stopped_data_address (struct ta + } + + static int +-delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, int arg3) ++delegate_watchpoint_addr_within_range (struct target_ops *self, CORE_ADDR arg1, CORE_ADDR arg2, LONGEST arg3) + { + self = self->beneath; + return self->to_watchpoint_addr_within_range (self, arg1, arg2, arg3); +@@ -275,14 +275,14 @@ delegate_region_ok_for_hw_watchpoint (st + } + + static int +-delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4) ++delegate_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4) + { + self = self->beneath; + return self->to_can_accel_watchpoint_condition (self, arg1, arg2, arg3, arg4); + } + + static int +-tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, int arg2, int arg3, struct expression *arg4) ++tdefault_can_accel_watchpoint_condition (struct target_ops *self, CORE_ADDR arg1, LONGEST arg2, int arg3, struct expression *arg4) + { + return 0; + } diff --git a/gdb-rhbz795424-bitpos-23of25.patch b/gdb-rhbz795424-bitpos-23of25.patch index dd49926..0699f8b 100644 --- a/gdb-rhbz795424-bitpos-23of25.patch +++ b/gdb-rhbz795424-bitpos-23of25.patch @@ -137,10 +137,10 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=bitpos-tdep.patch -Index: gdb-7.6.90.20140127/gdb/alpha-tdep.c +Index: gdb-7.7.1/gdb/alpha-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/alpha-tdep.c 2014-02-06 18:20:52.970747716 +0100 -+++ gdb-7.6.90.20140127/gdb/alpha-tdep.c 2014-02-06 18:20:57.294752362 +0100 +--- gdb-7.7.1.orig/gdb/alpha-tdep.c 2014-05-09 19:24:18.677252769 +0200 ++++ gdb-7.7.1/gdb/alpha-tdep.c 2014-05-09 20:02:09.620703767 +0200 @@ -299,18 +299,18 @@ alpha_push_dummy_call (struct gdbarch *g { enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -184,10 +184,10 @@ Index: gdb-7.6.90.20140127/gdb/alpha-tdep.c memcpy (arg_reg_buffer + offset, contents, tlen); offset += tlen; contents += tlen; -Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c +Index: gdb-7.7.1/gdb/amd64-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/amd64-tdep.c 2014-02-06 18:20:52.972747718 +0100 -+++ gdb-7.6.90.20140127/gdb/amd64-tdep.c 2014-02-06 18:21:51.106810814 +0100 +--- gdb-7.7.1.orig/gdb/amd64-tdep.c 2014-05-09 19:24:18.678252770 +0200 ++++ gdb-7.7.1/gdb/amd64-tdep.c 2014-05-09 20:02:09.620703767 +0200 @@ -633,7 +633,7 @@ amd64_return_value (struct gdbarch *gdba gdb_byte *readbuf, const gdb_byte *writebuf) { @@ -217,10 +217,10 @@ Index: gdb-7.6.90.20140127/gdb/amd64-tdep.c enum amd64_reg_class class[2]; int needed_integer_regs = 0; int needed_sse_regs = 0; -Index: gdb-7.6.90.20140127/gdb/amd64-windows-tdep.c +Index: gdb-7.7.1/gdb/amd64-windows-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/amd64-windows-tdep.c 2014-02-06 18:20:52.973747720 +0100 -+++ gdb-7.6.90.20140127/gdb/amd64-windows-tdep.c 2014-02-06 18:20:57.296752364 +0100 +--- gdb-7.7.1.orig/gdb/amd64-windows-tdep.c 2014-05-09 19:24:18.679252770 +0200 ++++ gdb-7.7.1/gdb/amd64-windows-tdep.c 2014-05-09 20:02:09.620703767 +0200 @@ -288,7 +288,7 @@ amd64_windows_return_value (struct gdbar struct type *type, struct regcache *regcache, gdb_byte *readbuf, const gdb_byte *writebuf) @@ -230,10 +230,10 @@ Index: gdb-7.6.90.20140127/gdb/amd64-windows-tdep.c int regnum = -1; /* See if our value is returned through a register. If it is, then -Index: gdb-7.6.90.20140127/gdb/arm-tdep.c +Index: gdb-7.7.1/gdb/arm-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/arm-tdep.c 2014-02-06 18:20:52.978747725 +0100 -+++ gdb-7.6.90.20140127/gdb/arm-tdep.c 2014-02-06 18:20:57.299752367 +0100 +--- gdb-7.7.1.orig/gdb/arm-tdep.c 2014-05-09 19:24:18.684252770 +0200 ++++ gdb-7.7.1/gdb/arm-tdep.c 2014-05-09 20:02:09.622703768 +0200 @@ -3498,7 +3498,7 @@ arm_vfp_cprc_reg_char (enum arm_vfp_cprc array). Vectors and complex types are not currently supported, matching the generic AAPCS support. */ @@ -308,10 +308,10 @@ Index: gdb-7.6.90.20140127/gdb/arm-tdep.c struct type *arg_type; struct type *target_type; enum type_code typecode; -Index: gdb-7.6.90.20140127/gdb/avr-tdep.c +Index: gdb-7.7.1/gdb/avr-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/avr-tdep.c 2014-02-06 18:20:52.980747727 +0100 -+++ gdb-7.6.90.20140127/gdb/avr-tdep.c 2014-02-06 18:20:57.299752367 +0100 +--- gdb-7.7.1.orig/gdb/avr-tdep.c 2014-05-09 19:24:18.686252771 +0200 ++++ gdb-7.7.1/gdb/avr-tdep.c 2014-05-09 20:02:09.623703768 +0200 @@ -1167,13 +1167,14 @@ avr_dummy_id (struct gdbarch *gdbarch, s struct stack_item @@ -345,10 +345,10 @@ Index: gdb-7.6.90.20140127/gdb/avr-tdep.c /* Calculate the potential last register needed. */ last_regnum = regnum - (len + (len & 1)); -Index: gdb-7.6.90.20140127/gdb/bfin-tdep.c +Index: gdb-7.7.1/gdb/bfin-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/bfin-tdep.c 2014-02-06 18:20:52.980747727 +0100 -+++ gdb-7.6.90.20140127/gdb/bfin-tdep.c 2014-02-06 18:20:57.300752368 +0100 +--- gdb-7.7.1.orig/gdb/bfin-tdep.c 2014-05-09 19:24:18.686252771 +0200 ++++ gdb-7.7.1/gdb/bfin-tdep.c 2014-05-09 20:02:09.623703768 +0200 @@ -506,7 +506,7 @@ bfin_push_dummy_call (struct gdbarch *gd gdb_byte buf[4]; int i; @@ -367,10 +367,10 @@ Index: gdb-7.6.90.20140127/gdb/bfin-tdep.c sp -= container_len; write_memory (sp, value_contents_writeable (args[i]), container_len); -Index: gdb-7.6.90.20140127/gdb/cris-tdep.c +Index: gdb-7.7.1/gdb/cris-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/cris-tdep.c 2014-02-06 18:20:52.981747728 +0100 -+++ gdb-7.6.90.20140127/gdb/cris-tdep.c 2014-02-06 18:20:57.301752369 +0100 +--- gdb-7.7.1.orig/gdb/cris-tdep.c 2014-05-09 19:24:18.687252771 +0200 ++++ gdb-7.7.1/gdb/cris-tdep.c 2014-05-09 20:02:09.623703768 +0200 @@ -665,13 +665,13 @@ static CORE_ADDR cris_unwind_sp (struct struct stack_item @@ -405,10 +405,10 @@ Index: gdb-7.6.90.20140127/gdb/cris-tdep.c /* How may registers worth of storage do we need for this argument? */ reg_demand = (len / 4) + (len % 4 != 0 ? 1 : 0); -Index: gdb-7.6.90.20140127/gdb/h8300-tdep.c +Index: gdb-7.7.1/gdb/h8300-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/h8300-tdep.c 2014-02-06 18:20:52.981747728 +0100 -+++ gdb-7.6.90.20140127/gdb/h8300-tdep.c 2014-02-06 18:20:57.301752369 +0100 +--- gdb-7.7.1.orig/gdb/h8300-tdep.c 2014-05-09 19:24:18.688252771 +0200 ++++ gdb-7.7.1/gdb/h8300-tdep.c 2014-05-09 20:02:09.624703768 +0200 @@ -640,7 +640,7 @@ h8300_push_dummy_call (struct gdbarch *g int struct_return, CORE_ADDR struct_addr) { @@ -441,10 +441,10 @@ Index: gdb-7.6.90.20140127/gdb/h8300-tdep.c for (offset = 0; offset < padded_len; offset += wordsize) { -Index: gdb-7.6.90.20140127/gdb/hppa-tdep.c +Index: gdb-7.7.1/gdb/hppa-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/hppa-tdep.c 2014-02-06 18:20:52.982747729 +0100 -+++ gdb-7.6.90.20140127/gdb/hppa-tdep.c 2014-02-06 18:20:57.302752371 +0100 +--- gdb-7.7.1.orig/gdb/hppa-tdep.c 2014-05-09 19:24:18.690252771 +0200 ++++ gdb-7.7.1/gdb/hppa-tdep.c 2014-05-09 20:02:09.624703768 +0200 @@ -961,7 +961,7 @@ hppa64_push_dummy_call (struct gdbarch * { struct value *arg = args[i]; @@ -463,10 +463,10 @@ Index: gdb-7.6.90.20140127/gdb/hppa-tdep.c int regnum, offset; if (len > 16) -Index: gdb-7.6.90.20140127/gdb/i386-darwin-tdep.c +Index: gdb-7.7.1/gdb/i386-darwin-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/i386-darwin-tdep.c 2014-02-06 18:20:52.982747729 +0100 -+++ gdb-7.6.90.20140127/gdb/i386-darwin-tdep.c 2014-02-06 18:20:57.302752371 +0100 +--- gdb-7.7.1.orig/gdb/i386-darwin-tdep.c 2014-05-09 19:24:18.690252771 +0200 ++++ gdb-7.7.1/gdb/i386-darwin-tdep.c 2014-05-09 20:02:09.624703768 +0200 @@ -164,7 +164,7 @@ i386_darwin_push_dummy_call (struct gdba for (write_pass = 0; write_pass < 2; write_pass++) @@ -476,10 +476,10 @@ Index: gdb-7.6.90.20140127/gdb/i386-darwin-tdep.c int num_m128 = 0; if (struct_return) -Index: gdb-7.6.90.20140127/gdb/i386-tdep.c +Index: gdb-7.7.1/gdb/i386-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/i386-tdep.c 2014-02-06 18:20:52.985747732 +0100 -+++ gdb-7.6.90.20140127/gdb/i386-tdep.c 2014-02-06 18:20:57.303752372 +0100 +--- gdb-7.7.1.orig/gdb/i386-tdep.c 2014-05-09 19:24:18.692252771 +0200 ++++ gdb-7.7.1/gdb/i386-tdep.c 2014-05-09 20:02:09.625703769 +0200 @@ -2473,7 +2473,7 @@ i386_push_dummy_call (struct gdbarch *gd gdb_byte buf[4]; int i; @@ -543,10 +543,10 @@ Index: gdb-7.6.90.20140127/gdb/i386-tdep.c if (i386_fp_regnum_p (get_frame_arch (frame), regnum)) { -Index: gdb-7.6.90.20140127/gdb/ia64-tdep.c +Index: gdb-7.7.1/gdb/ia64-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ia64-tdep.c 2014-02-06 18:20:52.986747733 +0100 -+++ gdb-7.6.90.20140127/gdb/ia64-tdep.c 2014-02-06 18:20:57.304752373 +0100 +--- gdb-7.7.1.orig/gdb/ia64-tdep.c 2014-05-09 19:24:18.693252771 +0200 ++++ gdb-7.7.1/gdb/ia64-tdep.c 2014-05-09 20:02:09.626703769 +0200 @@ -3851,8 +3851,10 @@ ia64_push_dummy_call (struct gdbarch *gd int argno; struct value *arg; @@ -560,10 +560,10 @@ Index: gdb-7.6.90.20140127/gdb/ia64-tdep.c int floatreg; ULONGEST bsp; CORE_ADDR funcdescaddr, pc, global_pointer; -Index: gdb-7.6.90.20140127/gdb/iq2000-tdep.c +Index: gdb-7.7.1/gdb/iq2000-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/iq2000-tdep.c 2014-02-06 18:20:52.986747733 +0100 -+++ gdb-7.6.90.20140127/gdb/iq2000-tdep.c 2014-02-06 18:20:57.304752373 +0100 +--- gdb-7.7.1.orig/gdb/iq2000-tdep.c 2014-05-09 19:24:18.693252771 +0200 ++++ gdb-7.7.1/gdb/iq2000-tdep.c 2014-05-09 20:02:09.626703769 +0200 @@ -654,8 +654,9 @@ iq2000_push_dummy_call (struct gdbarch * const bfd_byte *val; bfd_byte buf[4]; @@ -576,10 +576,10 @@ Index: gdb-7.6.90.20140127/gdb/iq2000-tdep.c /* Used to copy struct arguments into the stack. */ CORE_ADDR struct_ptr; -Index: gdb-7.6.90.20140127/gdb/m32r-tdep.c +Index: gdb-7.7.1/gdb/m32r-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m32r-tdep.c 2014-02-06 18:20:52.986747733 +0100 -+++ gdb-7.6.90.20140127/gdb/m32r-tdep.c 2014-02-06 18:20:57.304752373 +0100 +--- gdb-7.7.1.orig/gdb/m32r-tdep.c 2014-05-09 19:24:18.693252771 +0200 ++++ gdb-7.7.1/gdb/m32r-tdep.c 2014-05-09 20:02:09.626703769 +0200 @@ -689,7 +689,7 @@ m32r_push_dummy_call (struct gdbarch *gd CORE_ADDR regval; gdb_byte *val; @@ -589,10 +589,10 @@ Index: gdb-7.6.90.20140127/gdb/m32r-tdep.c /* First force sp to a 4-byte alignment. */ sp = sp & ~3; -Index: gdb-7.6.90.20140127/gdb/m68k-tdep.c +Index: gdb-7.7.1/gdb/m68k-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m68k-tdep.c 2014-02-06 18:20:52.987747735 +0100 -+++ gdb-7.6.90.20140127/gdb/m68k-tdep.c 2014-02-06 18:20:57.305752374 +0100 +--- gdb-7.7.1.orig/gdb/m68k-tdep.c 2014-05-09 19:24:18.694252771 +0200 ++++ gdb-7.7.1/gdb/m68k-tdep.c 2014-05-09 20:02:09.627703769 +0200 @@ -384,7 +384,7 @@ m68k_reg_struct_return_p (struct gdbarch { struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); @@ -615,10 +615,10 @@ Index: gdb-7.6.90.20140127/gdb/m68k-tdep.c /* Non-scalars bigger than 4 bytes are left aligned, others are right aligned. */ -Index: gdb-7.6.90.20140127/gdb/m88k-tdep.c +Index: gdb-7.7.1/gdb/m88k-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/m88k-tdep.c 2014-02-06 18:20:52.987747735 +0100 -+++ gdb-7.6.90.20140127/gdb/m88k-tdep.c 2014-02-06 18:20:57.305752374 +0100 +--- gdb-7.7.1.orig/gdb/m88k-tdep.c 2014-05-09 19:24:18.694252771 +0200 ++++ gdb-7.7.1/gdb/m88k-tdep.c 2014-05-09 20:02:09.627703769 +0200 @@ -260,13 +260,13 @@ m88k_store_arguments (struct regcache *r { struct gdbarch *gdbarch = get_regcache_arch (regcache); @@ -646,10 +646,10 @@ Index: gdb-7.6.90.20140127/gdb/m88k-tdep.c if (m88k_in_register_p (type)) { -Index: gdb-7.6.90.20140127/gdb/mep-tdep.c +Index: gdb-7.7.1/gdb/mep-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/mep-tdep.c 2014-02-06 18:20:52.987747735 +0100 -+++ gdb-7.6.90.20140127/gdb/mep-tdep.c 2014-02-06 18:20:57.306752375 +0100 +--- gdb-7.7.1.orig/gdb/mep-tdep.c 2014-05-09 19:24:18.695252772 +0200 ++++ gdb-7.7.1/gdb/mep-tdep.c 2014-05-09 20:02:09.627703769 +0200 @@ -2272,7 +2272,7 @@ push_large_arguments (CORE_ADDR sp, int for (i = 0; i < argc; i++) @@ -659,10 +659,10 @@ Index: gdb-7.6.90.20140127/gdb/mep-tdep.c if (arg_len > MEP_GPR_SIZE) { -Index: gdb-7.6.90.20140127/gdb/mips-tdep.c +Index: gdb-7.7.1/gdb/mips-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/mips-tdep.c 2014-02-06 18:20:52.990747738 +0100 -+++ gdb-7.6.90.20140127/gdb/mips-tdep.c 2014-02-06 18:20:57.307752376 +0100 +--- gdb-7.7.1.orig/gdb/mips-tdep.c 2014-05-09 19:24:18.698252772 +0200 ++++ gdb-7.7.1/gdb/mips-tdep.c 2014-05-09 20:02:09.628703769 +0200 @@ -402,7 +402,7 @@ static void mips_xfer_register (struct gdbarch *gdbarch, struct regcache *regcache, int reg_num, int length, @@ -808,10 +808,10 @@ Index: gdb-7.6.90.20140127/gdb/mips-tdep.c val = value_contents (arg); -Index: gdb-7.6.90.20140127/gdb/mn10300-tdep.c +Index: gdb-7.7.1/gdb/mn10300-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/mn10300-tdep.c 2014-02-06 18:20:52.991747739 +0100 -+++ gdb-7.6.90.20140127/gdb/mn10300-tdep.c 2014-02-06 18:20:57.308752377 +0100 +--- gdb-7.7.1.orig/gdb/mn10300-tdep.c 2014-05-09 19:24:18.698252772 +0200 ++++ gdb-7.7.1/gdb/mn10300-tdep.c 2014-05-09 20:02:09.629703770 +0200 @@ -1227,7 +1227,7 @@ mn10300_push_dummy_call (struct gdbarch enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); const int push_size = register_size (gdbarch, E_PC_REGNUM); @@ -821,10 +821,10 @@ Index: gdb-7.6.90.20140127/gdb/mn10300-tdep.c int stack_offset = 0; int argnum; const gdb_byte *val; -Index: gdb-7.6.90.20140127/gdb/mt-tdep.c +Index: gdb-7.7.1/gdb/mt-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/mt-tdep.c 2014-02-06 18:20:52.991747739 +0100 -+++ gdb-7.6.90.20140127/gdb/mt-tdep.c 2014-02-06 18:20:57.308752377 +0100 +--- gdb-7.7.1.orig/gdb/mt-tdep.c 2014-05-09 19:24:18.699252772 +0200 ++++ gdb-7.7.1/gdb/mt-tdep.c 2014-05-09 20:02:09.629703770 +0200 @@ -783,9 +783,9 @@ mt_push_dummy_call (struct gdbarch *gdba gdb_byte buf[MT_MAX_STRUCT_SIZE]; int argreg = MT_1ST_ARGREG; @@ -837,10 +837,10 @@ Index: gdb-7.6.90.20140127/gdb/mt-tdep.c int i, j; /* First handle however many args we can fit into MT_1ST_ARGREG thru -Index: gdb-7.6.90.20140127/gdb/ppc-sysv-tdep.c +Index: gdb-7.7.1/gdb/ppc-sysv-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/ppc-sysv-tdep.c 2014-02-06 18:20:52.992747740 +0100 -+++ gdb-7.6.90.20140127/gdb/ppc-sysv-tdep.c 2014-02-06 18:20:57.308752377 +0100 +--- gdb-7.7.1.orig/gdb/ppc-sysv-tdep.c 2014-05-09 19:24:18.699252772 +0200 ++++ gdb-7.7.1/gdb/ppc-sysv-tdep.c 2014-05-09 20:10:13.994807709 +0200 @@ -68,7 +68,7 @@ ppc_sysv_abi_push_dummy_call (struct gdb enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int opencl_abi = ppc_sysv_use_opencl_abi (value_type (function)); @@ -871,36 +871,24 @@ Index: gdb-7.6.90.20140127/gdb/ppc-sysv-tdep.c const bfd_byte *val = value_contents (arg); if (TYPE_CODE (type) == TYPE_CODE_FLT && len <= 8 -@@ -1613,14 +1613,14 @@ ppc64_sysv_abi_push_dummy_call (struct g - } - else - { -- int byte; -+ ssize_t byte; - for (byte = 0; byte < TYPE_LENGTH (type); - byte += tdep->wordsize) - { - if (write_pass && greg <= 10) - { - gdb_byte regval[MAX_REGISTER_SIZE]; -- int len = TYPE_LENGTH (type) - byte; -+ ssize_t len = TYPE_LENGTH (type) - byte; - if (len > tdep->wordsize) - len = tdep->wordsize; - memset (regval, 0, sizeof regval); -@@ -1648,7 +1648,7 @@ ppc64_sysv_abi_push_dummy_call (struct g - register. Work around this by always writing the - value to memory. Fortunately, doing this - simplifies the code. */ -- int len = TYPE_LENGTH (type); -+ ssize_t len = TYPE_LENGTH (type); - if (len < tdep->wordsize) - write_memory (gparam + tdep->wordsize - len, val, len); - else -Index: gdb-7.6.90.20140127/gdb/rl78-tdep.c +@@ -1285,11 +1285,11 @@ struct ppc64_sysv_argpos + + static void + ppc64_sysv_abi_push_val (struct gdbarch *gdbarch, +- const bfd_byte *val, int len, int align, ++ const bfd_byte *val, ssize_t len, int align, + struct ppc64_sysv_argpos *argpos) + { + struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); +- int offset = 0; ++ ssize_t offset = 0; + + /* Enforce alignment of stack location, if requested. */ + if (align > tdep->wordsize) +Index: gdb-7.7.1/gdb/rl78-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/rl78-tdep.c 2014-02-06 18:20:52.992747740 +0100 -+++ gdb-7.6.90.20140127/gdb/rl78-tdep.c 2014-02-06 18:20:57.309752378 +0100 +--- gdb-7.7.1.orig/gdb/rl78-tdep.c 2014-05-09 19:24:18.700252772 +0200 ++++ gdb-7.7.1/gdb/rl78-tdep.c 2014-05-09 20:02:09.630703770 +0200 @@ -1052,8 +1052,8 @@ rl78_push_dummy_call (struct gdbarch *gd for (i = nargs - 1; i >= 0; i--) { @@ -912,10 +900,10 @@ Index: gdb-7.6.90.20140127/gdb/rl78-tdep.c sp -= container_len; write_memory (rl78_make_data_address (sp), -Index: gdb-7.6.90.20140127/gdb/rs6000-aix-tdep.c +Index: gdb-7.7.1/gdb/rs6000-aix-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/rs6000-aix-tdep.c 2014-02-06 18:20:52.993747741 +0100 -+++ gdb-7.6.90.20140127/gdb/rs6000-aix-tdep.c 2014-02-06 18:20:57.309752378 +0100 +--- gdb-7.7.1.orig/gdb/rs6000-aix-tdep.c 2014-05-09 19:24:18.700252772 +0200 ++++ gdb-7.7.1/gdb/rs6000-aix-tdep.c 2014-05-09 20:02:09.630703770 +0200 @@ -196,9 +196,9 @@ rs6000_push_dummy_call (struct gdbarch * struct gdbarch_tdep *tdep = gdbarch_tdep (gdbarch); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -937,10 +925,10 @@ Index: gdb-7.6.90.20140127/gdb/rs6000-aix-tdep.c if (argbytes) { -Index: gdb-7.6.90.20140127/gdb/s390-linux-tdep.c +Index: gdb-7.7.1/gdb/s390-linux-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/s390-linux-tdep.c 2014-02-06 18:20:52.993747741 +0100 -+++ gdb-7.6.90.20140127/gdb/s390-linux-tdep.c 2014-02-06 18:22:17.330838389 +0100 +--- gdb-7.7.1.orig/gdb/s390-linux-tdep.c 2014-05-09 19:24:18.701252772 +0200 ++++ gdb-7.7.1/gdb/s390-linux-tdep.c 2014-05-09 20:02:09.631703770 +0200 @@ -2526,7 +2526,7 @@ is_float_like (struct type *type) @@ -959,10 +947,10 @@ Index: gdb-7.6.90.20140127/gdb/s390-linux-tdep.c if (s390_function_arg_pass_by_reference (type)) { -Index: gdb-7.6.90.20140127/gdb/score-tdep.c +Index: gdb-7.7.1/gdb/score-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/score-tdep.c 2014-02-06 18:20:52.994747742 +0100 -+++ gdb-7.6.90.20140127/gdb/score-tdep.c 2014-02-06 18:20:57.310752379 +0100 +--- gdb-7.7.1.orig/gdb/score-tdep.c 2014-05-09 19:24:18.701252772 +0200 ++++ gdb-7.7.1/gdb/score-tdep.c 2014-05-09 20:02:09.631703770 +0200 @@ -515,7 +515,7 @@ score_push_dummy_call (struct gdbarch *g enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argnum; @@ -972,10 +960,10 @@ Index: gdb-7.6.90.20140127/gdb/score-tdep.c CORE_ADDR stack_offset = 0; CORE_ADDR addr = 0; -Index: gdb-7.6.90.20140127/gdb/sh-tdep.c +Index: gdb-7.7.1/gdb/sh-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/sh-tdep.c 2014-02-06 18:20:52.995747743 +0100 -+++ gdb-7.6.90.20140127/gdb/sh-tdep.c 2014-02-06 18:20:57.310752379 +0100 +--- gdb-7.7.1.orig/gdb/sh-tdep.c 2014-05-09 19:24:18.702252772 +0200 ++++ gdb-7.7.1/gdb/sh-tdep.c 2014-05-09 20:02:09.631703770 +0200 @@ -807,7 +807,7 @@ sh_skip_prologue (struct gdbarch *gdbarc static int sh_use_struct_convention (int renesas_abi, struct type *type) @@ -1014,10 +1002,10 @@ Index: gdb-7.6.90.20140127/gdb/sh-tdep.c int pass_on_stack = 0; int last_reg_arg = INT_MAX; -Index: gdb-7.6.90.20140127/gdb/sh64-tdep.c +Index: gdb-7.7.1/gdb/sh64-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/sh64-tdep.c 2014-02-06 18:20:52.995747743 +0100 -+++ gdb-7.6.90.20140127/gdb/sh64-tdep.c 2014-02-06 18:20:57.311752380 +0100 +--- gdb-7.7.1.orig/gdb/sh64-tdep.c 2014-05-09 19:24:18.702252772 +0200 ++++ gdb-7.7.1/gdb/sh64-tdep.c 2014-05-09 20:02:09.632703771 +0200 @@ -1058,7 +1058,7 @@ sh64_push_dummy_call (struct gdbarch *gd CORE_ADDR struct_addr) { @@ -1036,10 +1024,10 @@ Index: gdb-7.6.90.20140127/gdb/sh64-tdep.c int argreg_size; int fp_args[12]; -Index: gdb-7.6.90.20140127/gdb/sparc-tdep.c +Index: gdb-7.7.1/gdb/sparc-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/sparc-tdep.c 2014-02-06 18:20:52.996747744 +0100 -+++ gdb-7.6.90.20140127/gdb/sparc-tdep.c 2014-02-06 18:20:57.311752380 +0100 +--- gdb-7.7.1.orig/gdb/sparc-tdep.c 2014-05-09 19:24:18.703252772 +0200 ++++ gdb-7.7.1/gdb/sparc-tdep.c 2014-05-09 20:02:09.632703771 +0200 @@ -502,7 +502,7 @@ sparc32_store_arguments (struct regcache for (i = 0; i < nargs; i++) { @@ -1049,10 +1037,10 @@ Index: gdb-7.6.90.20140127/gdb/sparc-tdep.c if (sparc_structure_or_union_p (type) || (sparc_floating_p (type) && len == 16) -Index: gdb-7.6.90.20140127/gdb/sparc64-tdep.c +Index: gdb-7.7.1/gdb/sparc64-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/sparc64-tdep.c 2014-02-06 18:20:52.996747744 +0100 -+++ gdb-7.6.90.20140127/gdb/sparc64-tdep.c 2014-02-06 18:20:57.311752380 +0100 +--- gdb-7.7.1.orig/gdb/sparc64-tdep.c 2014-05-09 19:24:18.704252773 +0200 ++++ gdb-7.7.1/gdb/sparc64-tdep.c 2014-05-09 20:02:09.632703771 +0200 @@ -639,7 +639,8 @@ sparc64_16_byte_align_p (struct type *ty static void @@ -1108,10 +1096,10 @@ Index: gdb-7.6.90.20140127/gdb/sparc64-tdep.c int regnum = -1; gdb_byte buf[16]; -Index: gdb-7.6.90.20140127/gdb/spu-tdep.c +Index: gdb-7.7.1/gdb/spu-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/spu-tdep.c 2014-02-06 18:20:52.997747745 +0100 -+++ gdb-7.6.90.20140127/gdb/spu-tdep.c 2014-02-06 18:20:57.312752381 +0100 +--- gdb-7.7.1.orig/gdb/spu-tdep.c 2014-05-09 19:24:18.704252773 +0200 ++++ gdb-7.7.1/gdb/spu-tdep.c 2014-05-09 20:02:09.633703771 +0200 @@ -1376,7 +1376,7 @@ spu_push_dummy_call (struct gdbarch *gdb struct value *arg = args[i]; struct type *type = check_typedef (value_type (arg)); @@ -1130,10 +1118,10 @@ Index: gdb-7.6.90.20140127/gdb/spu-tdep.c int preferred_slot; if (spu_scalar_value_p (type)) -Index: gdb-7.6.90.20140127/gdb/tic6x-tdep.c +Index: gdb-7.7.1/gdb/tic6x-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/tic6x-tdep.c 2014-02-06 18:20:52.997747745 +0100 -+++ gdb-7.6.90.20140127/gdb/tic6x-tdep.c 2014-02-06 18:20:57.312752381 +0100 +--- gdb-7.7.1.orig/gdb/tic6x-tdep.c 2014-05-09 19:24:18.705252773 +0200 ++++ gdb-7.7.1/gdb/tic6x-tdep.c 2014-05-09 20:02:09.633703771 +0200 @@ -896,7 +896,7 @@ tic6x_push_dummy_call (struct gdbarch *g int argreg = 0; int argnum; @@ -1171,10 +1159,10 @@ Index: gdb-7.6.90.20140127/gdb/tic6x-tdep.c addr = sp + stack_offset; write_memory (addr, val, len); -Index: gdb-7.6.90.20140127/gdb/tilegx-tdep.c +Index: gdb-7.7.1/gdb/tilegx-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/tilegx-tdep.c 2014-02-06 18:20:52.998747746 +0100 -+++ gdb-7.6.90.20140127/gdb/tilegx-tdep.c 2014-02-06 18:20:57.312752381 +0100 +--- gdb-7.7.1.orig/gdb/tilegx-tdep.c 2014-05-09 19:24:18.705252773 +0200 ++++ gdb-7.7.1/gdb/tilegx-tdep.c 2014-05-09 20:02:09.633703771 +0200 @@ -290,7 +290,7 @@ tilegx_push_dummy_call (struct gdbarch * CORE_ADDR stack_dest = sp; int argreg = TILEGX_R0_REGNUM; @@ -1184,10 +1172,10 @@ Index: gdb-7.6.90.20140127/gdb/tilegx-tdep.c static const gdb_byte four_zero_words[16] = { 0 }; /* If struct_return is 1, then the struct return address will -Index: gdb-7.6.90.20140127/gdb/v850-tdep.c +Index: gdb-7.7.1/gdb/v850-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/v850-tdep.c 2014-02-06 18:20:52.998747746 +0100 -+++ gdb-7.6.90.20140127/gdb/v850-tdep.c 2014-02-06 18:20:57.313752383 +0100 +--- gdb-7.7.1.orig/gdb/v850-tdep.c 2014-05-09 19:24:18.705252773 +0200 ++++ gdb-7.7.1/gdb/v850-tdep.c 2014-05-09 20:02:09.634703771 +0200 @@ -1021,7 +1021,7 @@ v850_push_dummy_call (struct gdbarch *gd enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); int argreg; @@ -1206,10 +1194,10 @@ Index: gdb-7.6.90.20140127/gdb/v850-tdep.c gdb_byte *val; gdb_byte valbuf[v850_reg_size]; -Index: gdb-7.6.90.20140127/gdb/vax-tdep.c +Index: gdb-7.7.1/gdb/vax-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/vax-tdep.c 2014-02-06 18:20:52.998747746 +0100 -+++ gdb-7.6.90.20140127/gdb/vax-tdep.c 2014-02-06 18:20:57.313752383 +0100 +--- gdb-7.7.1.orig/gdb/vax-tdep.c 2014-05-09 19:24:18.706252773 +0200 ++++ gdb-7.7.1/gdb/vax-tdep.c 2014-05-09 20:02:09.634703771 +0200 @@ -115,7 +115,7 @@ vax_store_arguments (struct regcache *re struct gdbarch *gdbarch = get_regcache_arch (regcache); enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); @@ -1228,10 +1216,10 @@ Index: gdb-7.6.90.20140127/gdb/vax-tdep.c sp -= (len + 3) & ~3; count += (len + 3) / 4; -Index: gdb-7.6.90.20140127/gdb/xstormy16-tdep.c +Index: gdb-7.7.1/gdb/xstormy16-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/xstormy16-tdep.c 2014-02-06 18:20:52.999747748 +0100 -+++ gdb-7.6.90.20140127/gdb/xstormy16-tdep.c 2014-02-06 18:20:57.313752383 +0100 +--- gdb-7.7.1.orig/gdb/xstormy16-tdep.c 2014-05-09 19:24:18.706252773 +0200 ++++ gdb-7.7.1/gdb/xstormy16-tdep.c 2014-05-09 20:02:09.634703771 +0200 @@ -235,8 +235,9 @@ xstormy16_push_dummy_call (struct gdbarc enum bfd_endian byte_order = gdbarch_byte_order (gdbarch); CORE_ADDR stack_dest = sp; @@ -1244,10 +1232,10 @@ Index: gdb-7.6.90.20140127/gdb/xstormy16-tdep.c const gdb_byte *val; gdb_byte buf[xstormy16_pc_size]; -Index: gdb-7.6.90.20140127/gdb/xtensa-tdep.c +Index: gdb-7.7.1/gdb/xtensa-tdep.c =================================================================== ---- gdb-7.6.90.20140127.orig/gdb/xtensa-tdep.c 2014-02-06 18:20:53.000747749 +0100 -+++ gdb-7.6.90.20140127/gdb/xtensa-tdep.c 2014-02-06 18:20:57.314752384 +0100 +--- gdb-7.7.1.orig/gdb/xtensa-tdep.c 2014-05-09 19:24:18.707252773 +0200 ++++ gdb-7.7.1/gdb/xtensa-tdep.c 2014-05-09 20:02:09.634703771 +0200 @@ -1652,8 +1652,7 @@ xtensa_store_return_value (struct type * if (len > (callsize > 8 ? 8 : 16)) diff --git a/gdb-rhbz795424-bitpos-25of25.patch b/gdb-rhbz795424-bitpos-25of25.patch index b9cb210..329bd01 100644 --- a/gdb-rhbz795424-bitpos-25of25.patch +++ b/gdb-rhbz795424-bitpos-25of25.patch @@ -47,11 +47,11 @@ Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=f77-bounds.patch -Index: gdb-7.5.50.20130118/gdb/f-lang.h +Index: gdb-7.7.90.20140613/gdb/f-lang.h =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/f-lang.h 2013-01-18 23:39:40.209500968 +0100 -+++ gdb-7.5.50.20130118/gdb/f-lang.h 2013-01-18 23:40:04.010531177 +0100 -@@ -65,9 +65,9 @@ struct common_block +--- gdb-7.7.90.20140613.orig/gdb/f-lang.h 2014-06-16 22:45:00.404470944 +0200 ++++ gdb-7.7.90.20140613/gdb/f-lang.h 2014-06-16 22:45:10.352477761 +0200 +@@ -62,9 +62,9 @@ struct common_block struct symbol *contents[1]; }; @@ -63,11 +63,11 @@ Index: gdb-7.5.50.20130118/gdb/f-lang.h extern void f77_get_dynamic_array_length (struct type *); -Index: gdb-7.5.50.20130118/gdb/f-typeprint.c +Index: gdb-7.7.90.20140613/gdb/f-typeprint.c =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/f-typeprint.c 2013-01-18 23:39:37.564497620 +0100 -+++ gdb-7.5.50.20130118/gdb/f-typeprint.c 2013-01-18 23:39:40.210500970 +0100 -@@ -180,7 +180,7 @@ f_type_print_varspec_suffix (struct type +--- gdb-7.7.90.20140613.orig/gdb/f-typeprint.c 2014-06-16 22:45:00.404470944 +0200 ++++ gdb-7.7.90.20140613/gdb/f-typeprint.c 2014-06-16 22:45:10.353477761 +0200 +@@ -161,7 +161,7 @@ f_type_print_varspec_suffix (struct type int show, int passed_a_ptr, int demangled_args, int arrayprint_recurse_level) { @@ -76,25 +76,25 @@ Index: gdb-7.5.50.20130118/gdb/f-typeprint.c /* No static variables are permitted as an error call may occur during execution of this function. */ -@@ -210,7 +210,7 @@ f_type_print_varspec_suffix (struct type +@@ -195,7 +195,7 @@ f_type_print_varspec_suffix (struct type - lower_bound = f77_get_lowerbound (type); - if (lower_bound != 1) /* Not the default. */ -- fprintf_filtered (stream, "%d:", lower_bound); -+ fprintf_filtered (stream, "%s:", plongest (lower_bound)); + lower_bound = f77_get_lowerbound (type); + if (lower_bound != 1) /* Not the default. */ +- fprintf_filtered (stream, "%d:", lower_bound); ++ fprintf_filtered (stream, "%s:", plongest (lower_bound)); - /* Make sure that, if we have an assumed size array, we - print out a warning and print the upperbound as '*'. */ -@@ -220,7 +220,7 @@ f_type_print_varspec_suffix (struct type - else - { - upper_bound = f77_get_upperbound (type); -- fprintf_filtered (stream, "%d", upper_bound); -+ fprintf_filtered (stream, "%s", plongest (upper_bound)); - } + /* Make sure that, if we have an assumed size array, we + print out a warning and print the upperbound as '*'. */ +@@ -205,7 +205,7 @@ f_type_print_varspec_suffix (struct type + else + { + upper_bound = f77_get_upperbound (type); +- fprintf_filtered (stream, "%d", upper_bound); ++ fprintf_filtered (stream, "%s", plongest (upper_bound)); + } - if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) -@@ -288,7 +288,7 @@ void + if (TYPE_CODE (TYPE_TARGET_TYPE (type)) != TYPE_CODE_ARRAY) +@@ -274,7 +274,7 @@ void f_type_print_base (struct type *type, struct ui_file *stream, int show, int level) { @@ -103,7 +103,7 @@ Index: gdb-7.5.50.20130118/gdb/f-typeprint.c int index; QUIT; -@@ -370,7 +370,7 @@ f_type_print_base (struct type *type, st +@@ -356,7 +356,7 @@ f_type_print_base (struct type *type, st else { upper_bound = f77_get_upperbound (type); @@ -112,20 +112,20 @@ Index: gdb-7.5.50.20130118/gdb/f-typeprint.c } break; -Index: gdb-7.5.50.20130118/gdb/f-valprint.c +Index: gdb-7.7.90.20140613/gdb/f-valprint.c =================================================================== ---- gdb-7.5.50.20130118.orig/gdb/f-valprint.c 2013-01-18 23:39:37.564497620 +0100 -+++ gdb-7.5.50.20130118/gdb/f-valprint.c 2013-01-18 23:39:40.210500970 +0100 -@@ -57,7 +57,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN - - #define F77_DIM_BYTE_STRIDE(n) (f77_array_offset_tbl[n][0]) +--- gdb-7.7.90.20140613.orig/gdb/f-valprint.c 2014-06-16 22:45:34.901495069 +0200 ++++ gdb-7.7.90.20140613/gdb/f-valprint.c 2014-06-16 22:45:44.933502067 +0200 +@@ -46,7 +46,7 @@ LONGEST f77_array_offset_tbl[MAX_FORTRAN + /* 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. */ -int +LONGEST f77_get_lowerbound (struct type *type) { - f_object_address_data_valid_or_error (type); -@@ -68,7 +68,7 @@ f77_get_lowerbound (struct type *type) + if (TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED (type)) +@@ -55,7 +55,7 @@ f77_get_lowerbound (struct type *type) return TYPE_ARRAY_LOWER_BOUND_VALUE (type); } @@ -133,24 +133,4 @@ Index: gdb-7.5.50.20130118/gdb/f-valprint.c +LONGEST f77_get_upperbound (struct type *type) { - f_object_address_data_valid_or_error (type); -@@ -92,8 +92,8 @@ f77_get_upperbound (struct type *type) - static void - f77_get_dynamic_length_of_aggregate (struct type *type) - { -- int upper_bound = -1; -- int lower_bound = 1; -+ LONGEST upper_bound = -1; -+ LONGEST lower_bound = 1; - - /* Recursively go all the way down into a possibly multi-dimensional - F77 array and get the bounds. For simple arrays, this is pretty -@@ -128,7 +128,7 @@ f77_create_arrayprint_offset_tbl (struct - struct type *tmp_type; - LONGEST eltlen; - int ndimen = 1; -- int upper, lower; -+ LONGEST upper, lower; - - tmp_type = type; - + if (TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (type)) diff --git a/gdb-upstream.patch b/gdb-upstream.patch index 3e42a47..8e94025 100644 --- a/gdb-upstream.patch +++ b/gdb-upstream.patch @@ -1,66 +1,67 @@ -http://sourceware.org/ml/gdb-patches/2014-02/msg00179.html -Subject: [obv] testsuite: Fix i386-sse-stack-align.exp regression since GDB_PARALLEL +http://sourceware.org/ml/gdb-patches/2014-07/msg00274.html +Subject: [obv] Fix false argv0-symlink.exp FAIL running under a very long directory name +Hi, ---u3/rZRmxL6MmkK24 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline +checked in as obvious: -Hi Tom, - -$ make check//unix/-m32 RUNTESTFLAGS="gdb.arch/i386-sse-stack-align.exp GDB_PARALLEL=1" +Starting program: /home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff/gdb/testsuite/gdb.base/argv0-symlink-filelink ^M [...] -Running /home/jkratoch/redhat/gdb-clean/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp ... -ERROR: (/home/jkratoch/redhat/gdb-clean/gdb/testsuite.unix.-m32/outputs/gdb.arch/i386-sse-stack-align/i386-sse-stack-align) No such file or directory +(gdb) print argv[0]^M +$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-", 'f' ...^M +(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name +after "set print repeats 10000": -Checked in. +print argv[0]^M +$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"...^M +(gdb) FAIL: gdb.base/argv0-symlink.exp: kept file symbolic link name +after "set print elements 10000": -Jan +print argv[0]^M +$1 = 0x7fffffffda39 "/home/jkratoch/redhat/gdb-test-fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff/gdb/testsuite/gdb.base/argv0-symlink-filelink"^M +(gdb) PASS: gdb.base/argv0-symlink.exp: kept file symbolic link name ---u3/rZRmxL6MmkK24 -Content-Type: text/plain; charset=us-ascii -Content-Disposition: inline; filename=1 - -commit 3c77faf33dc4c7bb693f05f44077ed687e9f8217 +commit 218c2655603748b844dcaf103e34fd14d8ee8aef Author: Jan Kratochvil -Date: Thu Feb 6 23:14:20 2014 +0100 - - Fix i386-sse-stack-align.exp regression since GDB_PARALLEL. - - gdb/testsuite/ - 2014-02-06 Jan Kratochvil - - Fix i386-sse-stack-align.exp regression since GDB_PARALLEL. - * gdb.arch/i386-sse-stack-align.exp: Use standard_output_file. +Date: Fri Jul 11 17:26:42 2014 +0200 diff --git a/gdb/testsuite/ChangeLog b/gdb/testsuite/ChangeLog -index 8c846b8..13ccaf3 100644 +index 74f7bce..253eeeb 100644 ### a/gdb/testsuite/ChangeLog ### b/gdb/testsuite/ChangeLog -## -1,3 +1,8 @@ -+2014-02-06 Jan Kratochvil +## -1,3 +1,9 @@ ++2014-07-11 Jan Kratochvil + -+ Fix i386-sse-stack-align.exp regression since GDB_PARALLEL. -+ * gdb.arch/i386-sse-stack-align.exp: Use standard_output_file. ++ Fix false FAIL running under a very long directory name. ++ * gdb.base/argv0-symlink.exp: Add "set print repeats 10000" ++ and "set print elements 10000". Twice. + - 2014-02-06 Doug Evans + 2014-07-11 Yao Qi - * gdb.python/py-breakpoint.exp (test_bkpt_eval_funcs): Update expected -diff --git a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp -index b5a7e1e..462df1f 100644 ---- a/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp -+++ b/gdb/testsuite/gdb.arch/i386-sse-stack-align.exp -@@ -22,7 +22,7 @@ set testfile "i386-sse-stack-align" - set srcfile ${testfile}.S - set csrcfile ${testfile}.c - set executable ${testfile} --set binfile ${objdir}/${subdir}/${executable} -+set binfile [standard_output_file ${executable}] - set opts {} + * gdb.base/exprs.exp: "set print symbol off". +diff --git a/gdb/testsuite/gdb.base/argv0-symlink.exp b/gdb/testsuite/gdb.base/argv0-symlink.exp +index 0e0202d..d849b4c 100644 +--- a/gdb/testsuite/gdb.base/argv0-symlink.exp ++++ b/gdb/testsuite/gdb.base/argv0-symlink.exp +@@ -36,6 +36,9 @@ if ![runto_main] { + return -1 + } - if [info exists COMPILE] { - ---u3/rZRmxL6MmkK24-- - ++gdb_test_no_output "set print repeats 10000" ++gdb_test_no_output "set print elements 10000" ++ + gdb_test {print argv[0]} "/$filelink\"" $test + + # For a link named /PATH/TO/DIR/LINK, we want to check the output +@@ -67,6 +70,9 @@ if ![runto_main] { + return -1 + } + ++gdb_test_no_output "set print repeats 10000" ++gdb_test_no_output "set print elements 10000" ++ + # gdbserver does not have this issue. + if ![is_remote target] { + setup_kfail "*-*-*" gdb/15934 diff --git a/gdb-vla-intel-04of23-fix.patch b/gdb-vla-intel-04of23-fix.patch new file mode 100644 index 0000000..27a6c6a --- /dev/null +++ b/gdb-vla-intel-04of23-fix.patch @@ -0,0 +1,42 @@ +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 +=================================================================== +--- 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 * + 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_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")); ++ if (TYPE_NOT_ALLOCATED (array_type)) ++ error (_("no such vector element because 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 * + + if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type) + && elt_offs >= TYPE_LENGTH (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")); +- else +- error (_("no such vector element")); +- } ++ error (_("no such vector element")); + + if (VALUE_LVAL (array) == lval_memory && value_lazy (array)) + v = allocate_value_lazy (elt_type); diff --git a/gdb-vla-intel-stringbt-fix.patch b/gdb-vla-intel-stringbt-fix.patch new file mode 100644 index 0000000..a994cd5 --- /dev/null +++ b/gdb-vla-intel-stringbt-fix.patch @@ -0,0 +1,165 @@ +http://sourceware.org/ml/gdb-patches/2014-08/msg00025.html +Subject: [patch 1/2] Re: Crash regression(?) printing Fortran strings in bt [Re: [V2 00/23] Fortran dynamic array support] + + +--FCuugMFkClbJLl1L +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline + +On Fri, 01 Aug 2014 09:20:19 +0200, Keven Boell wrote: +> I just tried it on Fedora 20 i686. Applied the patch, you mentioned, on top of +> the Fortran VLA series and executed your dynamic-other-frame test. Everything +> is working fine here, I cannot reproduce the crash. + +I have it reproducible on Fedora 20 i686 with plain +CFLAGS=-g ./configure;make;cd gdb/testsuite;make site.exp;runtest gdb.fortran/dynamic-other-frame.exp + +Besides that I have updated the testcase with + gdb_test_no_output "set print frame-arguments all" +so that there is no longer needed the patch: + [patch] Display Fortran strings in backtraces + https://sourceware.org/ml/gdb-patches/2014-07/msg00709.html + +The fix below has no regressions for me. Unfortunately I do not see why you +cannot reproduce it. + + +Thanks, +Jan + +--FCuugMFkClbJLl1L +Content-Type: text/plain; charset=us-ascii +Content-Disposition: inline; filename="vlastringonly.patch" + +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index 53cae2c..cf7ac26 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -1659,6 +1659,7 @@ is_dynamic_type_internal (struct type *type, int top_level) + return !has_static_range (TYPE_RANGE_DATA (type)); + + case TYPE_CODE_ARRAY: ++ case TYPE_CODE_STRING: + { + gdb_assert (TYPE_NFIELDS (type) == 1); + +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 +new file mode 100644 +index 0000000..261ce17 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 +@@ -0,0 +1,24 @@ ++! Copyright 2010 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine bar ++ real :: dummy ++ dummy = 1 ++end subroutine bar +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +new file mode 100644 +index 0000000..570a28c +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp +@@ -0,0 +1,39 @@ ++# Copyright 2010 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. ++ ++set testfile "dynamic-other-frame" ++set srcfile1 ${testfile}.f90 ++set srcfile2 ${testfile}-stub.f90 ++set objfile2 [standard_output_file ${testfile}-stub.o] ++set executable ${testfile} ++set binfile [standard_output_file ${executable}] ++ ++if { [gdb_compile "${srcdir}/${subdir}/${srcfile2}" "${objfile2}" object {f90}] != "" ++ || [gdb_compile "${srcdir}/${subdir}/${srcfile1} ${objfile2}" "${binfile}" executable {debug f90}] != "" } { ++ untested "Couldn't compile ${srcfile1} or ${srcfile2}" ++ return -1 ++} ++ ++clean_restart ${executable} ++ ++gdb_test_no_output "set print frame-arguments all" ++ ++if ![runto bar_] then { ++ perror "couldn't run to bar_" ++ continue ++} ++ ++gdb_test "bt" {foo \(string='hello'.*} +diff --git a/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 +new file mode 100644 +index 0000000..2bc637d +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 +@@ -0,0 +1,36 @@ ++! Copyright 2010 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. ++! ++! Ihis file is the Fortran source file for dynamic.exp. ++! Original file written by Jakub Jelinek . ++! Modified for the GDB testcase by Jan Kratochvil . ++ ++subroutine foo (string) ++ interface ++ subroutine bar ++ end subroutine ++ end interface ++ character string*(*) ++ call bar ! stop-here ++end subroutine foo ++program test ++ interface ++ subroutine foo (string) ++ character string*(*) ++ end subroutine ++ end interface ++ call foo ('hello') ++end + +--FCuugMFkClbJLl1L-- + diff --git a/gdb-vla-intel.patch b/gdb-vla-intel.patch new file mode 100644 index 0000000..2b6cb3e --- /dev/null +++ b/gdb-vla-intel.patch @@ -0,0 +1,3235 @@ +[PATCH 00/23] Fortran dynamic array support +https://sourceware.org/ml/gdb-patches/2014-06/msg00108.html +https://github.com/intel-gdb/vla/tree/vla-fortran + +GIT snapshot: +commit 511bff520372ffc10fa2ff569c176bdf1e6e475d + + +diff --git a/gdb/NEWS b/gdb/NEWS +index d9a19ae..e6885d2 100644 +### a/gdb/NEWS +### b/gdb/NEWS +@@ -3,6 +3,9 @@ + + *** Changes since GDB 7.8 + ++* Fortran dynamic array support: It allows the user to evaluate ++ dynamic arrays like an ordinary static array. ++ + *** Changes in GDB 7.8 + + * New command line options +diff --git a/gdb/c-valprint.c b/gdb/c-valprint.c +index f4694b0..8c45276 100644 +--- a/gdb/c-valprint.c ++++ b/gdb/c-valprint.c +@@ -538,7 +538,16 @@ c_value_print (struct value *val, struct ui_file *stream, + { + /* normal case */ + fprintf_filtered (stream, "("); +- type_print (value_type (val), "", stream, -1); ++ if (is_dynamic_type (TYPE_TARGET_TYPE (type))) ++ { ++ struct value *v; ++ ++ v = value_ind (val); ++ v = value_addr (v); ++ type_print (value_type (v), "", stream, -1); ++ } ++ else ++ type_print (value_type (val), "", stream, -1); + fprintf_filtered (stream, ") "); + } + } +diff --git a/gdb/dwarf2expr.c b/gdb/dwarf2expr.c +index 36c9f66..274ba62 100644 +--- a/gdb/dwarf2expr.c ++++ b/gdb/dwarf2expr.c +@@ -1478,6 +1478,12 @@ execute_stack_op (struct dwarf_expr_context *ctx, + } + break; + ++ case DW_OP_push_object_address: ++ /* Return the address of the object we are currently observing. */ ++ result = (ctx->funcs->get_object_address) (ctx->baton); ++ result_val = value_from_ulongest (address_type, result); ++ break; ++ + default: + error (_("Unhandled dwarf expression opcode 0x%x"), op); + } +diff --git a/gdb/dwarf2expr.h b/gdb/dwarf2expr.h +index 39dadf3..8cebbe8 100644 +--- a/gdb/dwarf2expr.h ++++ b/gdb/dwarf2expr.h +@@ -84,12 +84,8 @@ struct dwarf_expr_context_funcs + This can throw an exception if the index is out of range. */ + CORE_ADDR (*get_addr_index) (void *baton, unsigned int index); + +-#if 0 +- /* Not yet implemented. */ +- + /* Return the `object address' for DW_OP_push_object_address. */ + CORE_ADDR (*get_object_address) (void *baton); +-#endif + }; + + /* The location of a value. */ +diff --git a/gdb/dwarf2loc.c b/gdb/dwarf2loc.c +index fcab9b9..a624dac 100644 +--- a/gdb/dwarf2loc.c ++++ b/gdb/dwarf2loc.c +@@ -306,6 +306,7 @@ struct dwarf_expr_baton + { + struct frame_info *frame; + struct dwarf2_per_cu_data *per_cu; ++ CORE_ADDR obj_address; + }; + + /* Helper functions for dwarf2_evaluate_loc_desc. */ +@@ -1209,6 +1210,7 @@ dwarf_expr_push_dwarf_reg_entry_value (struct dwarf_expr_context *ctx, + + baton_local.frame = caller_frame; + baton_local.per_cu = caller_per_cu; ++ baton_local.obj_address = 0; + + saved_ctx.gdbarch = ctx->gdbarch; + saved_ctx.addr_size = ctx->addr_size; +@@ -1238,6 +1240,22 @@ dwarf_expr_get_addr_index (void *baton, unsigned int index) + return dwarf2_read_addr_index (debaton->per_cu, index); + } + ++/* Callback function for get_object_address. Return the address of the VLA ++ object. */ ++ ++static CORE_ADDR ++dwarf_expr_get_obj_addr (void *baton) ++{ ++ struct dwarf_expr_baton *debaton = baton; ++ ++ gdb_assert (debaton != NULL); ++ ++ if (debaton->obj_address == 0) ++ error (_("Location address is not set.")); ++ ++ return debaton->obj_address; ++} ++ + /* VALUE must be of type lval_computed with entry_data_value_funcs. Perform + the indirect method on it, that is use its stored target value, the sole + purpose of entry_data_value_funcs.. */ +@@ -2202,7 +2220,8 @@ static const struct dwarf_expr_context_funcs dwarf_expr_ctx_funcs = + dwarf_expr_dwarf_call, + dwarf_expr_get_base_type, + dwarf_expr_push_dwarf_reg_entry_value, +- dwarf_expr_get_addr_index ++ dwarf_expr_get_addr_index, ++ dwarf_expr_get_obj_addr + }; + + /* Evaluate a location description, starting at DATA and with length +@@ -2231,6 +2250,7 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, + + baton.frame = frame; + baton.per_cu = per_cu; ++ baton.obj_address = 0; + + ctx = new_dwarf_expr_context (); + old_chain = make_cleanup_free_dwarf_expr_context (ctx); +@@ -2326,6 +2346,11 @@ dwarf2_evaluate_loc_desc_full (struct type *type, struct frame_info *frame, + int in_stack_memory = dwarf_expr_fetch_in_stack_memory (ctx, 0); + + do_cleanups (value_chain); ++ ++ /* Select right frame to correctly evaluate VLA's during a backtrace. */ ++ if (is_dynamic_type (type)) ++ select_frame (frame); ++ + retval = value_at_lazy (type, address + byte_offset); + if (in_stack_memory) + set_value_stack (retval, 1); +@@ -2436,6 +2461,7 @@ dwarf2_evaluate_loc_desc (struct type *type, struct frame_info *frame, + + static int + dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, ++ CORE_ADDR addr, + CORE_ADDR *valp) + { + struct dwarf_expr_context *ctx; +@@ -2451,6 +2477,7 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, + + baton.frame = get_selected_frame (NULL); + baton.per_cu = dlbaton->per_cu; ++ baton.obj_address = addr; + + objfile = dwarf2_per_cu_objfile (dlbaton->per_cu); + +@@ -2491,7 +2518,8 @@ dwarf2_locexpr_baton_eval (const struct dwarf2_locexpr_baton *dlbaton, + /* See dwarf2loc.h. */ + + int +-dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value) ++dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR address, ++ CORE_ADDR *value) + { + if (prop == NULL) + return 0; +@@ -2502,7 +2530,7 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value) + { + const struct dwarf2_property_baton *baton = prop->data.baton; + +- if (dwarf2_locexpr_baton_eval (&baton->locexpr, value)) ++ if (dwarf2_locexpr_baton_eval (&baton->locexpr, address, value)) + { + if (baton->referenced_type) + { +@@ -2546,6 +2574,20 @@ dwarf2_evaluate_property (const struct dynamic_prop *prop, CORE_ADDR *value) + return 0; + } + ++/* See dwarf2loc.h. */ ++ ++int ++dwarf2_address_data_valid (const struct type *type) ++{ ++ if (TYPE_NOT_ASSOCIATED (type)) ++ return 0; ++ ++ if (TYPE_NOT_ALLOCATED (type)) ++ return 0; ++ ++ return 1; ++} ++ + + /* Helper functions and baton for dwarf2_loc_desc_needs_frame. */ + +@@ -2653,6 +2695,15 @@ needs_get_addr_index (void *baton, unsigned int index) + return 1; + } + ++/* DW_OP_push_object_address has a frame already passed through. */ ++ ++static CORE_ADDR ++needs_get_obj_addr (void *baton) ++{ ++ /* Nothing to do. */ ++ return 1; ++} ++ + /* Virtual method table for dwarf2_loc_desc_needs_frame below. */ + + static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs = +@@ -2667,7 +2718,8 @@ static const struct dwarf_expr_context_funcs needs_frame_ctx_funcs = + needs_frame_dwarf_call, + NULL, /* get_base_type */ + needs_dwarf_reg_entry_value, +- needs_get_addr_index ++ needs_get_addr_index, ++ needs_get_obj_addr + }; + + /* Return non-zero iff the location expression at DATA (length SIZE) +@@ -3316,6 +3368,10 @@ dwarf2_compile_expr_to_ax (struct agent_expr *expr, struct axs_value *loc, + unimplemented (op); + break; + ++ case DW_OP_push_object_address: ++ unimplemented (op); ++ break; ++ + case DW_OP_skip: + offset = extract_signed_integer (op_ptr, 2, byte_order); + op_ptr += 2; +diff --git a/gdb/dwarf2loc.h b/gdb/dwarf2loc.h +index 8ad5fa9..fb65c5c 100644 +--- a/gdb/dwarf2loc.h ++++ b/gdb/dwarf2loc.h +@@ -96,11 +96,18 @@ struct value *dwarf2_evaluate_loc_desc (struct type *type, + into VALUE, otherwise returns 0. */ + + int dwarf2_evaluate_property (const struct dynamic_prop *prop, ++ CORE_ADDR address, + CORE_ADDR *value); + + CORE_ADDR dwarf2_read_addr_index (struct dwarf2_per_cu_data *per_cu, + unsigned int addr_index); + ++/* Checks if a dwarf location definition is valid. ++ Returns 1 if valid; 0 otherwise. */ ++ ++extern int dwarf2_address_data_valid (const struct type *type); ++ ++ + /* The symbol location baton types used by the DWARF-2 reader (i.e. + SYMBOL_LOCATION_BATON for a LOC_COMPUTED symbol). "struct + dwarf2_locexpr_baton" is for a symbol with a single location +diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c +index 276d2f1..fbf13ce 100644 +--- a/gdb/dwarf2read.c ++++ b/gdb/dwarf2read.c +@@ -1847,6 +1847,12 @@ static void free_dwo_file_cleanup (void *); + static void process_cu_includes (void); + + static void check_producer (struct dwarf2_cu *cu); ++ ++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. */ + +@@ -14201,29 +14207,92 @@ read_tag_string_type (struct die_info *die, struct dwarf2_cu *cu) + struct gdbarch *gdbarch = get_objfile_arch (objfile); + struct type *type, *range_type, *index_type, *char_type; + struct attribute *attr; +- unsigned int length; ++ unsigned int length = UINT_MAX; ++ ++ index_type = objfile_type (objfile)->builtin_int; ++ range_type = create_static_range_type (NULL, index_type, 1, length); + ++ /* If DW_AT_string_length is defined, the length is stored at some location ++ * in memory. */ + attr = dwarf2_attr (die, DW_AT_string_length, cu); + if (attr) + { +- length = DW_UNSND (attr); ++ if (attr_form_is_block (attr)) ++ { ++ struct attribute *byte_size, *bit_size; ++ struct dynamic_prop high; ++ ++ byte_size = dwarf2_attr (die, DW_AT_byte_size, cu); ++ bit_size = dwarf2_attr (die, DW_AT_bit_size, cu); ++ ++ /* DW_AT_byte_size should never occur together in combination with ++ DW_AT_string_length. */ ++ if ((byte_size == NULL && bit_size != NULL) || ++ (byte_size != NULL && bit_size == NULL)) ++ complaint (&symfile_complaints, _("DW_AT_byte_size AND " ++ "DW_AT_bit_size found together at the same time.")); ++ ++ /* If DW_AT_string_length AND DW_AT_byte_size exist together, it ++ describes the number of bytes that should be read from the length ++ memory location. */ ++ if (byte_size != NULL && bit_size == NULL) ++ { ++ /* Build new dwarf2_locexpr_baton structure with additions to the ++ data attribute, to reflect DWARF specialities to get address ++ sizes. */ ++ const gdb_byte append_ops[] = { ++ /* DW_OP_deref_size: size of an address on the target machine ++ (bytes), where the size will be specified by the next ++ operand. */ ++ DW_OP_deref_size, ++ /* Operand for DW_OP_deref_size. */ ++ DW_UNSND (byte_size) }; ++ ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, ++ append_ops, ARRAY_SIZE (append_ops))) ++ complaint (&symfile_complaints, ++ _("Could not parse DW_AT_byte_size")); ++ } ++ else if (bit_size != NULL && byte_size == NULL) ++ complaint (&symfile_complaints, _("DW_AT_string_length AND " ++ "DW_AT_bit_size found but not supported yet.")); ++ /* If DW_AT_string_length WITHOUT DW_AT_byte_size exist, the default ++ is the address size of the target machine. */ ++ else ++ { ++ const gdb_byte append_ops[] = { DW_OP_deref }; ++ ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, append_ops, ++ ARRAY_SIZE (append_ops))) ++ complaint (&symfile_complaints, ++ _("Could not parse DW_AT_string_length")); ++ } ++ ++ TYPE_RANGE_DATA (range_type)->high = high; ++ } ++ else ++ { ++ TYPE_HIGH_BOUND (range_type) = DW_UNSND (attr); ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; ++ } + } + else + { +- /* Check for the DW_AT_byte_size attribute. */ ++ /* Check for the DW_AT_byte_size attribute, which represents the length ++ in this case. */ + attr = dwarf2_attr (die, DW_AT_byte_size, cu); + if (attr) + { +- length = DW_UNSND (attr); ++ TYPE_HIGH_BOUND (range_type) = DW_UNSND (attr); ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; + } + else + { +- length = 1; ++ TYPE_HIGH_BOUND (range_type) = 1; ++ TYPE_HIGH_BOUND_KIND (range_type) = PROP_CONST; + } + } + +- index_type = objfile_type (objfile)->builtin_int; +- range_type = create_static_range_type (NULL, index_type, 1, length); + char_type = language_string_char_type (cu->language_defn, gdbarch); + type = create_string_type (NULL, char_type, range_type); + +@@ -14540,13 +14609,15 @@ read_base_type (struct die_info *die, struct dwarf2_cu *cu) + return set_die_type (die, type, cu); + } + ++ + /* Parse dwarf attribute if it's a block, reference or constant and put the + resulting value of the attribute into struct bound_prop. + Returns 1 if ATTR could be resolved into PROP, 0 otherwise. */ + + static int + attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, +- struct dwarf2_cu *cu, struct dynamic_prop *prop) ++ struct dwarf2_cu *cu, struct dynamic_prop *prop, ++ const gdb_byte *additional_data, int additional_data_size) + { + struct dwarf2_property_baton *baton; + struct obstack *obstack = &cu->objfile->objfile_obstack; +@@ -14559,8 +14630,25 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, + baton = obstack_alloc (obstack, sizeof (*baton)); + baton->referenced_type = NULL; + baton->locexpr.per_cu = cu->per_cu; +- baton->locexpr.size = DW_BLOCK (attr)->size; +- baton->locexpr.data = DW_BLOCK (attr)->data; ++ ++ if (additional_data != NULL && additional_data_size > 0) ++ { ++ gdb_byte *data; ++ ++ data = obstack_alloc (&cu->objfile->objfile_obstack, ++ DW_BLOCK (attr)->size + additional_data_size); ++ memcpy (data, DW_BLOCK (attr)->data, DW_BLOCK (attr)->size); ++ memcpy (data + DW_BLOCK (attr)->size, ++ additional_data, additional_data_size); ++ ++ baton->locexpr.data = data; ++ baton->locexpr.size = DW_BLOCK (attr)->size + additional_data_size; ++ } ++ else ++ { ++ baton->locexpr.data = DW_BLOCK (attr)->data; ++ baton->locexpr.size = DW_BLOCK (attr)->size; ++ } + prop->data.baton = baton; + prop->kind = PROP_LOCEXPR; + gdb_assert (prop->data.baton != NULL); +@@ -14590,8 +14678,28 @@ attr_to_dynamic_prop (const struct attribute *attr, struct die_info *die, + baton = obstack_alloc (obstack, sizeof (*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; +- baton->locexpr.data = DW_BLOCK (target_attr)->data; ++ ++ if (additional_data != NULL && additional_data_size > 0) ++ { ++ gdb_byte *data; ++ ++ data = obstack_alloc (&cu->objfile->objfile_obstack, ++ DW_BLOCK (target_attr)->size + additional_data_size); ++ memcpy (data, DW_BLOCK (target_attr)->data, ++ DW_BLOCK (target_attr)->size); ++ memcpy (data + DW_BLOCK (target_attr)->size, ++ additional_data, additional_data_size); ++ ++ baton->locexpr.data = data; ++ baton->locexpr.size = (DW_BLOCK (target_attr)->size ++ + additional_data_size); ++ } ++ else ++ { ++ baton->locexpr.data = DW_BLOCK (target_attr)->data; ++ baton->locexpr.size = DW_BLOCK (target_attr)->size; ++ } ++ + prop->data.baton = baton; + prop->kind = PROP_LOCEXPR; + gdb_assert (prop->data.baton != NULL); +@@ -14626,7 +14734,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + struct type *base_type, *orig_base_type; + struct type *range_type; + struct attribute *attr; +- struct dynamic_prop low, high; ++ struct dynamic_prop low, high, stride; + int low_default_is_valid; + int high_bound_is_count = 0; + const char *name; +@@ -14646,7 +14754,9 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + + low.kind = PROP_CONST; + high.kind = PROP_CONST; ++ stride.kind = PROP_CONST; + high.data.const_val = 0; ++ stride.data.const_val = 0; + + /* Set LOW_DEFAULT_IS_VALID if current language and DWARF version allow + omitting DW_AT_lower_bound. */ +@@ -14679,19 +14789,26 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + break; + } + ++ attr = dwarf2_attr (die, DW_AT_byte_stride, cu); ++ if (attr) ++ if (!attr_to_dynamic_prop (attr, die, cu, &stride, NULL, 0)) ++ complaint (&symfile_complaints, _("Missing DW_AT_byte_stride " ++ "- DIE at 0x%x [in module %s]"), ++ die->offset.sect_off, objfile_name (cu->objfile)); ++ + attr = dwarf2_attr (die, DW_AT_lower_bound, cu); + if (attr) +- attr_to_dynamic_prop (attr, die, cu, &low); ++ attr_to_dynamic_prop (attr, die, cu, &low, NULL, 0); + else if (!low_default_is_valid) + complaint (&symfile_complaints, _("Missing DW_AT_lower_bound " + "- DIE at 0x%x [in module %s]"), + die->offset.sect_off, objfile_name (cu->objfile)); + + attr = dwarf2_attr (die, DW_AT_upper_bound, cu); +- if (!attr_to_dynamic_prop (attr, die, cu, &high)) ++ if (!attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) + { + attr = dwarf2_attr (die, DW_AT_count, cu); +- if (attr_to_dynamic_prop (attr, die, cu, &high)) ++ if (attr_to_dynamic_prop (attr, die, cu, &high, NULL, 0)) + { + /* If bounds are constant do the final calculation here. */ + if (low.kind == PROP_CONST && high.kind == PROP_CONST) +@@ -14755,7 +14872,7 @@ read_subrange_type (struct die_info *die, struct dwarf2_cu *cu) + && !TYPE_UNSIGNED (base_type) && (high.data.const_val & negative_mask)) + high.data.const_val |= negative_mask; + +- range_type = create_range_type (NULL, orig_base_type, &low, &high); ++ range_type = create_range_type (NULL, orig_base_type, &low, &high, &stride); + + if (high_bound_is_count) + TYPE_RANGE_DATA (range_type)->flag_upper_bound_is_count = 1; +@@ -21673,6 +21790,8 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + { + struct dwarf2_per_cu_offset_and_type **slot, ofs; + struct objfile *objfile = cu->objfile; ++ struct attribute *attr; ++ struct dynamic_prop prop; + + /* For Ada types, make sure that the gnat-specific data is always + initialized (if not already set). There are a few types where +@@ -21687,6 +21806,43 @@ set_die_type (struct die_info *die, struct type *type, struct dwarf2_cu *cu) + && !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; ++ ++ 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; ++ ++ 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; ++ } ++ } ++ ++ /* 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, NULL, 0)) ++ { ++ TYPE_DATA_LOCATION (type) ++ = obstack_alloc (&objfile->objfile_obstack, sizeof (prop)); ++ *TYPE_DATA_LOCATION (type) = prop; ++ } ++ + if (dwarf2_per_objfile->die_type_hash == NULL) + { + dwarf2_per_objfile->die_type_hash = +diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c +index 8356aab..69e67f4 100644 +--- a/gdb/f-typeprint.c ++++ b/gdb/f-typeprint.c +@@ -30,6 +30,7 @@ + #include "gdbcore.h" + #include "target.h" + #include "f-lang.h" ++#include "valprint.h" + + #include + #include +@@ -56,6 +57,17 @@ f_print_type (struct type *type, const char *varstring, struct ui_file *stream, + enum type_code code; + int demangled_args; + ++ if (TYPE_NOT_ASSOCIATED (type)) ++ { ++ val_print_not_associated (stream); ++ return; ++ } ++ if (TYPE_NOT_ALLOCATED (type)) ++ { ++ val_print_not_allocated (stream); ++ return; ++ } ++ + f_type_print_base (type, stream, show, level); + code = TYPE_CODE (type); + if ((varstring != NULL && *varstring != '\0') +@@ -170,28 +182,36 @@ f_type_print_varspec_suffix (struct type *type, struct ui_file *stream, + 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 +diff --git a/gdb/f-valprint.c b/gdb/f-valprint.c +index 408c8cc..38f32e0 100644 +--- a/gdb/f-valprint.c ++++ b/gdb/f-valprint.c +@@ -39,8 +39,6 @@ + + extern void _initialize_f_valprint (void); + static void info_common_command (char *, int); +-static void f77_create_arrayprint_offset_tbl (struct type *, +- struct ui_file *); + static void f77_get_dynamic_length_of_aggregate (struct type *); + + int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; +@@ -48,15 +46,6 @@ int f77_array_offset_tbl[MAX_FORTRAN_DIMS + 1][2]; + /* 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. */ + +-/* The following macro gives us the size of the nth dimension, Where +- n is 1 based. */ +- +-#define F77_DIM_SIZE(n) (f77_array_offset_tbl[n][1]) +- +-/* The following gives us the offset for row n where n is 1-based. */ +- +-#define F77_DIM_OFFSET(n) (f77_array_offset_tbl[n][0]) +- + int + f77_get_lowerbound (struct type *type) + { +@@ -114,47 +103,6 @@ f77_get_dynamic_length_of_aggregate (struct type *type) + * TYPE_LENGTH (check_typedef (TYPE_TARGET_TYPE (type))); + } + +-/* Function that sets up the array offset,size table for the array +- type "type". */ +- +-static void +-f77_create_arrayprint_offset_tbl (struct type *type, struct ui_file *stream) +-{ +- struct type *tmp_type; +- int eltlen; +- int ndimen = 1; +- int upper, lower; +- +- tmp_type = type; +- +- while (TYPE_CODE (tmp_type) == TYPE_CODE_ARRAY) +- { +- upper = f77_get_upperbound (tmp_type); +- lower = f77_get_lowerbound (tmp_type); +- +- F77_DIM_SIZE (ndimen) = upper - lower + 1; +- +- tmp_type = TYPE_TARGET_TYPE (tmp_type); +- ndimen++; +- } +- +- /* Now we multiply eltlen by all the offsets, so that later we +- can print out array elements correctly. Up till now we +- know an offset to apply to get the item but we also +- have to know how much to add to get to the next item. */ +- +- ndimen--; +- eltlen = TYPE_LENGTH (tmp_type); +- F77_DIM_OFFSET (ndimen) = eltlen; +- while (--ndimen > 0) +- { +- eltlen *= F77_DIM_SIZE (ndimen + 1); +- F77_DIM_OFFSET (ndimen) = eltlen; +- } +-} +- +- +- + /* Actual function which prints out F77 arrays, Valaddr == address in + the superior. Address == the address in the inferior. */ + +@@ -167,41 +115,62 @@ f77_print_array_1 (int nss, int ndimensions, struct type *type, + const struct value_print_options *options, + int *elts) + { ++ struct type *range_type = TYPE_INDEX_TYPE (check_typedef (type)); ++ CORE_ADDR addr = address + embedded_offset; ++ LONGEST lowerbound, upperbound; + int i; + ++ get_discrete_bounds (range_type, &lowerbound, &upperbound); ++ + if (nss != ndimensions) + { +- for (i = 0; +- (i < F77_DIM_SIZE (nss) && (*elts) < options->print_max); ++ size_t dim_size; ++ size_t offs = 0; ++ LONGEST byte_stride = abs (TYPE_BYTE_STRIDE (range_type)); ++ ++ if (byte_stride) ++ dim_size = byte_stride; ++ else ++ dim_size = TYPE_LENGTH (TYPE_TARGET_TYPE (type)); ++ ++ for (i = lowerbound; ++ (i < upperbound + 1 && (*elts) < options->print_max); + i++) + { ++ struct value *subarray = value_from_contents_and_address ++ (TYPE_TARGET_TYPE (type), value_contents_for_printing_const (val) ++ + offs, addr + offs); ++ + fprintf_filtered (stream, "( "); +- f77_print_array_1 (nss + 1, ndimensions, TYPE_TARGET_TYPE (type), +- valaddr, +- embedded_offset + i * F77_DIM_OFFSET (nss), +- address, +- stream, recurse, val, options, elts); ++ f77_print_array_1 (nss + 1, ndimensions, value_type (subarray), ++ value_contents_for_printing (subarray), ++ value_embedded_offset (subarray), ++ value_address (subarray), ++ stream, recurse, subarray, options, elts); ++ offs += dim_size; + fprintf_filtered (stream, ") "); + } +- if (*elts >= options->print_max && i < F77_DIM_SIZE (nss)) ++ if (*elts >= options->print_max && i < upperbound) + fprintf_filtered (stream, "..."); + } + else + { +- for (i = 0; i < F77_DIM_SIZE (nss) && (*elts) < options->print_max; ++ for (i = lowerbound; i < upperbound + 1 && (*elts) < options->print_max; + i++, (*elts)++) + { +- val_print (TYPE_TARGET_TYPE (type), +- valaddr, +- embedded_offset + i * F77_DIM_OFFSET (ndimensions), +- address, stream, recurse, +- val, options, current_language); ++ struct value *elt = value_subscript ((struct value *)val, i); ++ ++ val_print (value_type (elt), ++ value_contents_for_printing (elt), ++ value_embedded_offset (elt), ++ value_address (elt), stream, recurse, ++ elt, options, current_language); + +- if (i != (F77_DIM_SIZE (nss) - 1)) ++ if (i != upperbound) + fprintf_filtered (stream, ", "); + + if ((*elts == options->print_max - 1) +- && (i != (F77_DIM_SIZE (nss) - 1))) ++ && (i != upperbound)) + fprintf_filtered (stream, "..."); + } + } +@@ -228,12 +197,6 @@ f77_print_array (struct type *type, const gdb_byte *valaddr, + Type node corrupt! F77 arrays cannot have %d subscripts (%d Max)"), + ndimensions, MAX_FORTRAN_DIMS); + +- /* Since F77 arrays are stored column-major, we set up an +- offset table to get at the various row's elements. The +- offset table contains entries for both offset and subarray size. */ +- +- f77_create_arrayprint_offset_tbl (type, stream); +- + f77_print_array_1 (1, ndimensions, type, valaddr, embedded_offset, + address, stream, recurse, val, options, &elts); + } +@@ -378,12 +341,15 @@ f_val_print (struct type *type, const gdb_byte *valaddr, int embedded_offset, + fprintf_filtered (stream, "( "); + for (index = 0; index < TYPE_NFIELDS (type); index++) + { +- int offset = TYPE_FIELD_BITPOS (type, index) / 8; ++ struct value *field = value_field ++ ((struct value *)original_value, index); ++ ++ val_print (value_type (field), ++ value_contents_for_printing (field), ++ value_embedded_offset (field), ++ value_address (field), stream, recurse + 1, ++ field, options, current_language); + +- val_print (TYPE_FIELD_TYPE (type, index), valaddr, +- embedded_offset + offset, +- address, stream, recurse + 1, +- original_value, options, current_language); + if (index != TYPE_NFIELDS (type) - 1) + fputs_filtered (", ", stream); + } +diff --git a/gdb/gdbtypes.c b/gdb/gdbtypes.c +index e99a2f3..53cae2c 100644 +--- a/gdb/gdbtypes.c ++++ b/gdb/gdbtypes.c +@@ -805,7 +805,8 @@ allocate_stub_method (struct type *type) + struct type * + create_range_type (struct type *result_type, struct type *index_type, + const struct dynamic_prop *low_bound, +- const struct dynamic_prop *high_bound) ++ const struct dynamic_prop *high_bound, ++ const struct dynamic_prop *stride) + { + if (result_type == NULL) + result_type = alloc_type_copy (index_type); +@@ -820,6 +821,7 @@ create_range_type (struct type *result_type, struct type *index_type, + TYPE_ZALLOC (result_type, sizeof (struct range_bounds)); + TYPE_RANGE_DATA (result_type)->low = *low_bound; + TYPE_RANGE_DATA (result_type)->high = *high_bound; ++ TYPE_RANGE_DATA (result_type)->stride = *stride; + + if (low_bound->kind == PROP_CONST && low_bound->data.const_val >= 0) + TYPE_UNSIGNED (result_type) = 1; +@@ -841,7 +843,7 @@ struct type * + create_static_range_type (struct type *result_type, struct type *index_type, + LONGEST low_bound, LONGEST high_bound) + { +- struct dynamic_prop low, high; ++ struct dynamic_prop low, high, stride; + + low.kind = PROP_CONST; + low.data.const_val = low_bound; +@@ -849,7 +851,11 @@ create_static_range_type (struct type *result_type, struct type *index_type, + high.kind = PROP_CONST; + high.data.const_val = high_bound; + +- result_type = create_range_type (result_type, index_type, &low, &high); ++ stride.kind = PROP_CONST; ++ stride.data.const_val = 0; ++ ++ result_type = create_range_type (result_type, index_type, ++ &low, &high, &stride); + + return result_type; + } +@@ -1003,18 +1009,24 @@ create_array_type_with_stride (struct type *result_type, + + 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)) + { +- 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); ++ ++ byte_stride = abs (TYPE_BYTE_STRIDE (range_type)); ++ + /* Be careful when setting the array length. Ada arrays can be + empty arrays with the high_bound being smaller than the low_bound. + In such cases, the array length should be zero. */ + if (high_bound < low_bound) + TYPE_LENGTH (result_type) = 0; ++ else if (byte_stride > 0) ++ TYPE_LENGTH (result_type) = byte_stride * (high_bound - low_bound + 1); + else if (bit_stride > 0) + TYPE_LENGTH (result_type) = + (bit_stride * (high_bound - low_bound + 1) + 7) / 8; +@@ -1616,12 +1628,31 @@ stub_noname_complaint (void) + static int + is_dynamic_type_internal (struct type *type, int top_level) + { ++ int index; ++ ++ if (!type) ++ return 0; ++ + type = check_typedef (type); + + /* We only want to recognize references at the outermost level. */ + if (top_level && TYPE_CODE (type) == TYPE_CODE_REF) + type = check_typedef (TYPE_TARGET_TYPE (type)); + ++ if (TYPE_ASSOCIATED_PROP (type)) ++ return 1; ++ ++ if (TYPE_ALLOCATED_PROP (type)) ++ return 1; ++ ++ /* Scan field types in the Fortran case for nested dynamic types. ++ This will be done only for Fortran as in the C++ case an endless recursion ++ can occur in the area of classes. */ ++ if (current_language->la_language == language_fortran) ++ for (index = 0; index < TYPE_NFIELDS (type); index++) ++ if (is_dynamic_type (TYPE_FIELD_TYPE (type, index))) ++ return 1; ++ + switch (TYPE_CODE (type)) + { + case TYPE_CODE_RANGE: +@@ -1631,11 +1662,19 @@ is_dynamic_type_internal (struct type *type, int top_level) + { + gdb_assert (TYPE_NFIELDS (type) == 1); + +- /* The array is dynamic if either the bounds are dynamic, +- or the elements it contains have a dynamic contents. */ ++ /* The array is dynamic if either ++ - the bounds are dynamic, ++ - the elements it contains have a dynamic contents ++ - a data_locaton attribute was found. */ + if (is_dynamic_type_internal (TYPE_INDEX_TYPE (type), 0)) + return 1; +- return is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0); ++ else if (TYPE_DATA_LOCATION (type) != NULL ++ && (TYPE_DATA_LOCATION_KIND (type) == PROP_LOCEXPR ++ || TYPE_DATA_LOCATION_KIND (type) == PROP_LOCLIST)) ++ return 1; ++ else ++ return is_dynamic_type_internal (TYPE_TARGET_TYPE (type), 0); ++ break; + } + + case TYPE_CODE_STRUCT: +@@ -1648,6 +1687,17 @@ is_dynamic_type_internal (struct type *type, int top_level) + && is_dynamic_type_internal (TYPE_FIELD_TYPE (type, i), 0)) + return 1; + } ++ case TYPE_CODE_PTR: ++ { ++ if (TYPE_TARGET_TYPE (type) ++ && TYPE_CODE (TYPE_TARGET_TYPE (type)) == TYPE_CODE_STRING) ++ return is_dynamic_type (check_typedef (TYPE_TARGET_TYPE (type))); ++ ++ return 0; ++ break; ++ } ++ default: ++ return 0; + break; + } + +@@ -1666,22 +1716,23 @@ static struct type *resolve_dynamic_type_internal (struct type *type, + CORE_ADDR addr, + int top_level); + +-/* Given a dynamic range type (dyn_range_type), return a static version +- of that type. */ ++/* Given a dynamic range type (dyn_range_type) and address, ++ return a static version of that type. */ + + static struct type * +-resolve_dynamic_range (struct type *dyn_range_type) ++resolve_dynamic_range (struct type *dyn_range_type, CORE_ADDR addr) + { + CORE_ADDR value; + struct type *static_range_type; + const struct dynamic_prop *prop; + const struct dwarf2_locexpr_baton *baton; +- struct dynamic_prop low_bound, high_bound; ++ struct dynamic_prop low_bound, high_bound, stride; ++ struct type *range_copy = copy_type (dyn_range_type); + + gdb_assert (TYPE_CODE (dyn_range_type) == TYPE_CODE_RANGE); + + prop = &TYPE_RANGE_DATA (dyn_range_type)->low; +- if (dwarf2_evaluate_property (prop, &value)) ++ if (dwarf2_evaluate_property (prop, addr, &value)) + { + low_bound.kind = PROP_CONST; + low_bound.data.const_val = value; +@@ -1693,7 +1744,7 @@ resolve_dynamic_range (struct type *dyn_range_type) + } + + prop = &TYPE_RANGE_DATA (dyn_range_type)->high; +- if (dwarf2_evaluate_property (prop, &value)) ++ if (dwarf2_evaluate_property (prop, addr, &value)) + { + high_bound.kind = PROP_CONST; + high_bound.data.const_val = value; +@@ -1707,10 +1758,17 @@ resolve_dynamic_range (struct type *dyn_range_type) + high_bound.kind = PROP_UNDEFINED; + high_bound.data.const_val = 0; + } ++ ++ prop = &TYPE_RANGE_DATA (dyn_range_type)->stride; ++ if (dwarf2_evaluate_property (prop, addr, &value)) ++ { ++ stride.kind = PROP_CONST; ++ stride.data.const_val = value; ++ } + +- static_range_type = create_range_type (copy_type (dyn_range_type), +- TYPE_TARGET_TYPE (dyn_range_type), +- &low_bound, &high_bound); ++ static_range_type = create_range_type (range_copy, ++ TYPE_TARGET_TYPE (range_copy), ++ &low_bound, &high_bound, &stride); + TYPE_RANGE_DATA (static_range_type)->flag_bound_evaluated = 1; + return static_range_type; + } +@@ -1720,29 +1778,52 @@ resolve_dynamic_range (struct type *dyn_range_type) + of the associated array. */ + + static struct type * +-resolve_dynamic_array (struct type *type) ++resolve_dynamic_array (struct type *type, CORE_ADDR addr) + { + CORE_ADDR value; + struct type *elt_type; + struct type *range_type; + struct type *ary_dim; ++ struct dynamic_prop *prop; ++ struct type *copy = copy_type (type); + +- 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); ++ range_type = resolve_dynamic_range (range_type, addr); ++ ++ prop = TYPE_ALLOCATED_PROP (type); ++ if (dwarf2_evaluate_property (prop, addr, &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, &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)); ++ 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); + else + elt_type = TYPE_TARGET_TYPE (type); + +- return create_array_type (copy_type (type), +- elt_type, +- range_type); ++ if (TYPE_CODE (type) == TYPE_CODE_STRING) ++ return create_string_type (copy, ++ elt_type, ++ range_type); ++ else ++ return create_array_type (copy, ++ elt_type, ++ range_type); + } + + /* Resolve dynamic bounds of members of the union TYPE to static +@@ -1846,6 +1927,8 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr, + { + struct type *real_type = check_typedef (type); + struct type *resolved_type = type; ++ const struct dynamic_prop *prop; ++ CORE_ADDR value; + + if (!is_dynamic_type_internal (real_type, top_level)) + return type; +@@ -1871,11 +1954,12 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr, + } + + case TYPE_CODE_ARRAY: +- resolved_type = resolve_dynamic_array (type); ++ case TYPE_CODE_STRING: ++ resolved_type = resolve_dynamic_array (type, addr); + break; + + case TYPE_CODE_RANGE: +- resolved_type = resolve_dynamic_range (type); ++ resolved_type = resolve_dynamic_range (type, addr); + break; + + case TYPE_CODE_UNION: +@@ -1887,6 +1971,25 @@ resolve_dynamic_type_internal (struct type *type, CORE_ADDR addr, + break; + } + ++ /* Resolve data_location attribute. */ ++ prop = TYPE_DATA_LOCATION (resolved_type); ++ if (dwarf2_evaluate_property (prop, addr, &value)) ++ { ++ struct type *range_type = TYPE_INDEX_TYPE (resolved_type); ++ ++ /* Adjust the data location with the value of byte stride if set, which ++ can describe the separation between successive elements along the ++ dimension. */ ++ if (TYPE_BYTE_STRIDE (range_type) < 0) ++ value += (TYPE_HIGH_BOUND (range_type) - TYPE_LOW_BOUND (range_type)) ++ * TYPE_BYTE_STRIDE (range_type); ++ ++ TYPE_DATA_LOCATION_ADDR (resolved_type) = value; ++ TYPE_DATA_LOCATION_KIND (resolved_type) = PROP_CONST; ++ } ++ else ++ TYPE_DATA_LOCATION (resolved_type) = NULL; ++ + return resolved_type; + } + +@@ -4104,6 +4207,27 @@ copy_type_recursive (struct objfile *objfile, + *TYPE_RANGE_DATA (new_type) = *TYPE_RANGE_DATA (type); + } + ++ /* Copy the data location information. */ ++ if (TYPE_DATA_LOCATION (type) != NULL) ++ { ++ TYPE_DATA_LOCATION (new_type) = xmalloc (sizeof (struct dynamic_prop)); ++ *TYPE_DATA_LOCATION (new_type) = *TYPE_DATA_LOCATION (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) = +@@ -4150,6 +4274,44 @@ copy_type (const struct type *type) + memcpy (TYPE_MAIN_TYPE (new_type), TYPE_MAIN_TYPE (type), + sizeof (struct main_type)); + ++ 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_DATA_LOCATION (type)) ++ { ++ TYPE_DATA_LOCATION (new_type) ++ = OBSTACK_ZALLOC (&TYPE_OWNER (type).objfile->objfile_obstack, ++ struct dynamic_prop); ++ memcpy (TYPE_DATA_LOCATION (new_type), TYPE_DATA_LOCATION (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; + } + +diff --git a/gdb/gdbtypes.h b/gdb/gdbtypes.h +index 5008ef4..436edf8 100644 +--- a/gdb/gdbtypes.h ++++ b/gdb/gdbtypes.h +@@ -669,6 +669,10 @@ struct main_type + + struct dynamic_prop high; + ++ /* * Stride of range. */ ++ ++ struct dynamic_prop stride; ++ + /* True if HIGH range bound contains the number of elements in the + subrange. This affects how the final hight bound is computed. */ + +@@ -724,6 +728,23 @@ struct main_type + + struct func_type *func_stuff; + } type_specific; ++ ++ /* * Contains a location description value for the current type. Evaluating ++ this field yields to the location of the data for an object. */ ++ ++ struct dynamic_prop *data_location; ++ ++ /* Structure for DW_AT_allocated. ++ The presence of this attribute indicates that the object of the type ++ can be allocated/deallocated. The value can be a dwarf expression, ++ reference, or a constant. */ ++ struct dynamic_prop *allocated; ++ ++ /* Structure for DW_AT_associated. ++ The presence of this attribute indicated that the object of the type ++ can be associated. The value can be a dwarf expression, ++ reference, or a constant. */ ++ struct dynamic_prop *associated; + }; + + /* * A ``struct type'' describes a particular instance of a type, with +@@ -1202,6 +1223,39 @@ extern void allocate_gnat_aux_type (struct type *); + TYPE_RANGE_DATA(range_type)->high.kind + #define TYPE_LOW_BOUND_KIND(range_type) \ + TYPE_RANGE_DATA(range_type)->low.kind ++#define TYPE_BYTE_STRIDE(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.const_val ++#define TYPE_BYTE_STRIDE_BLOCK(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.locexpr ++#define TYPE_BYTE_STRIDE_LOCLIST(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.data.loclist ++#define TYPE_BYTE_STRIDE_KIND(range_type) \ ++ TYPE_RANGE_DATA(range_type)->stride.kind ++ ++ ++/* Attribute accessors for the type data location. */ ++#define TYPE_DATA_LOCATION(thistype) \ ++ TYPE_MAIN_TYPE(thistype)->data_location ++#define TYPE_DATA_LOCATION_BATON(thistype) \ ++ TYPE_DATA_LOCATION (thistype)->data.baton ++#define TYPE_DATA_LOCATION_ADDR(thistype) \ ++ TYPE_DATA_LOCATION (thistype)->data.const_val ++#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) \ ++ && TYPE_ALLOCATED_PROP (t)->kind == PROP_CONST \ ++ && !TYPE_ALLOCATED_PROP (t)->data.const_val) ++ ++/* Associated status of type object. If set to non-zero it means the object ++ is associated. A zero value means it is not associated. */ ++#define TYPE_NOT_ASSOCIATED(t) (TYPE_ASSOCIATED_PROP (t) \ ++ && TYPE_ASSOCIATED_PROP (t)->kind == PROP_CONST \ ++ && !TYPE_ASSOCIATED_PROP (t)->data.const_val) + + /* Moto-specific stuff for FORTRAN arrays. */ + +@@ -1209,6 +1263,9 @@ extern void allocate_gnat_aux_type (struct type *); + TYPE_HIGH_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) + #define TYPE_ARRAY_LOWER_BOUND_IS_UNDEFINED(arraytype) \ + TYPE_LOW_BOUND_UNDEFINED(TYPE_INDEX_TYPE(arraytype)) ++#define TYPE_ARRAY_STRIDE_IS_UNDEFINED(arraytype) \ ++ (TYPE_BYTE_STRIDE(TYPE_INDEX_TYPE(arraytype)) == 0) ++ + + #define TYPE_ARRAY_UPPER_BOUND_VALUE(arraytype) \ + (TYPE_HIGH_BOUND(TYPE_INDEX_TYPE((arraytype)))) +@@ -1677,6 +1734,7 @@ extern struct type *create_array_type_with_stride + + extern struct type *create_range_type (struct type *, struct type *, + const struct dynamic_prop *, ++ const struct dynamic_prop *, + const struct dynamic_prop *); + + extern struct type *create_array_type (struct type *, struct type *, +diff --git a/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp b/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp +new file mode 100644 +index 0000000..20607c3 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-alloc-assoc.exp +@@ -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" +diff --git a/gdb/testsuite/gdb.fortran/vla-datatypes.exp b/gdb/testsuite/gdb.fortran/vla-datatypes.exp +new file mode 100644 +index 0000000..20276d6 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-datatypes.exp +@@ -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)" +diff --git a/gdb/testsuite/gdb.fortran/vla-datatypes.f90 b/gdb/testsuite/gdb.fortran/vla-datatypes.f90 +new file mode 100644 +index 0000000..b11879a +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-datatypes.f90 +@@ -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 +diff --git a/gdb/testsuite/gdb.fortran/vla-func.exp b/gdb/testsuite/gdb.fortran/vla-func.exp +new file mode 100644 +index 0000000..f0f236b +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-func.exp +@@ -0,0 +1,61 @@ ++# 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 ++} ++ ++# Check VLA passed to first Fortran function. ++gdb_breakpoint [gdb_get_line_number "func1-vla-passed"] ++gdb_continue_to_breakpoint "func1-vla-passed" ++gdb_test "print vla" " = \\( *\\( *22, *22, *22,\[()22, .\]*\\)" \ ++ "print vla (func1)" ++gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10,10\\\)" \ ++ "ptype vla (func1)" ++ ++gdb_breakpoint [gdb_get_line_number "func1-vla-modified"] ++gdb_continue_to_breakpoint "func1-vla-modified" ++gdb_test "print vla(5,5)" " = 55" "print vla(5,5) (func1)" ++gdb_test "print vla(7,7)" " = 77" "print vla(5,5) (func1)" ++ ++# Check if the values are correct after returning from func1 ++gdb_breakpoint [gdb_get_line_number "func1-returned"] ++gdb_continue_to_breakpoint "func1-returned" ++gdb_test "print ret" " = .TRUE." "print ret after func1 returned" ++ ++# Check VLA passed to second Fortran function ++gdb_breakpoint [gdb_get_line_number "func2-vla-passed"] ++gdb_continue_to_breakpoint "func2-vla-passed" ++gdb_test "print vla" \ ++ " = \\\(44, 44, 44, 44, 44, 44, 44, 44, 44, 44\\\)" \ ++ "print vla (func2)" ++gdb_test "ptype vla" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ ++ "ptype vla (func2)" ++ ++# Check if the returned VLA has the correct values and ptype. ++gdb_breakpoint [gdb_get_line_number "func2-returned"] ++gdb_continue_to_breakpoint "func2-returned" ++gdb_test "print vla3" " = \\\(1, 2, 44, 4, 44, 44, 44, 8, 44, 44\\\)" \ ++ "print vla3 (after func2)" ++gdb_test "ptype vla3" "type = integer\\\(kind=4\\\) \\\(10\\\)" \ ++ "ptype vla3 (after func2)" +diff --git a/gdb/testsuite/gdb.fortran/vla-func.f90 b/gdb/testsuite/gdb.fortran/vla-func.f90 +new file mode 100644 +index 0000000..4f45da1 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-func.f90 +@@ -0,0 +1,71 @@ ++! 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. ++ ++logical function func1 (vla) ++ implicit none ++ integer, allocatable :: vla (:, :) ++ func1 = allocated(vla) ++ vla(5,5) = 55 ! func1-vla-passed ++ vla(7,7) = 77 ++ return ! func1-vla-modified ++end function func1 ++ ++function func2(vla) ++ implicit none ++ integer :: vla (:) ++ integer :: func2(size(vla)) ++ integer :: k ++ ++ vla(1) = 1 ! func2-vla-passed ++ vla(2) = 2 ++ vla(4) = 4 ++ vla(8) = 8 ++ ++ func2 = vla ++end function func2 ++ ++program vla_func ++ implicit none ++ interface ++ logical function func1 (vla) ++ integer :: vla (:, :) ++ end function ++ end interface ++ interface ++ function func2 (vla) ++ integer :: vla (:) ++ integer func2(size(vla)) ++ end function ++ end interface ++ ++ logical :: ret ++ integer, allocatable :: vla1 (:, :) ++ integer, allocatable :: vla2 (:) ++ integer, allocatable :: vla3 (:) ++ ++ ret = .FALSE. ++ ++ allocate (vla1 (10,10)) ++ vla1(:,:) = 22 ++ ++ allocate (vla2 (10)) ++ vla2(:) = 44 ++ ++ ret = func1(vla1) ++ vla3 = func2(vla2) ! func1-returned ++ ++ ret = .TRUE. ! func2-returned ++end program vla_func +diff --git a/gdb/testsuite/gdb.fortran/vla-history.exp b/gdb/testsuite/gdb.fortran/vla-history.exp +new file mode 100644 +index 0000000..170e1eb +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-history.exp +@@ -0,0 +1,62 @@ ++# 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 ++} ++ ++# 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" +diff --git a/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp b/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp +new file mode 100644 +index 0000000..2ee2914 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-ptype-sub.exp +@@ -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 . ++ ++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 ++} ++ ++# 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)" +diff --git a/gdb/testsuite/gdb.fortran/vla-ptype.exp b/gdb/testsuite/gdb.fortran/vla-ptype.exp +new file mode 100644 +index 0000000..9267723 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-ptype.exp +@@ -0,0 +1,96 @@ ++# 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 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" +diff --git a/gdb/testsuite/gdb.fortran/vla-sizeof.exp b/gdb/testsuite/gdb.fortran/vla-sizeof.exp +new file mode 100644 +index 0000000..6053c17 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-sizeof.exp +@@ -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" +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.exp b/gdb/testsuite/gdb.fortran/vla-stride.exp +new file mode 100644 +index 0000000..35f585d +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.exp +@@ -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" +diff --git a/gdb/testsuite/gdb.fortran/vla-stride.f90 b/gdb/testsuite/gdb.fortran/vla-stride.f90 +new file mode 100644 +index 0000000..6aa4f2b +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-stride.f90 +@@ -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 +diff --git a/gdb/testsuite/gdb.fortran/vla-strings.exp b/gdb/testsuite/gdb.fortran/vla-strings.exp +new file mode 100644 +index 0000000..7fc1734 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-strings.exp +@@ -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-filled-1"] ++gdb_continue_to_breakpoint "var_char-filled-1" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*3 \\)\\) ${hex}" \ ++ "print var_char after filled first time" ++gdb_test "print *var_char" " = 'foo'" \ ++ "print *var_char after filled first time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++ "whatis var_char after filled first time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*3 \\)" \ ++ "ptype var_char after filled first time" ++gdb_test "print var_char(1)" " = 102 'f'" "print var_char(1)" ++gdb_test "print var_char(3)" " = 111 'o'" "print var_char(3)" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-filled-2"] ++gdb_continue_to_breakpoint "var_char-filled-2" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*6 \\)\\) ${hex}" \ ++ "print var_char after allocated second time" ++gdb_test "print *var_char" " = 'foobar'" \ ++ "print *var_char after allocated second time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++ "whatis var_char second time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*6 \\)" \ ++ "ptype var_char second time" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-empty"] ++gdb_continue_to_breakpoint "var_char-empty" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*0 \\)\\) ${hex}" \ ++ "print var_char after set empty" ++gdb_test "print *var_char" " = \"\"" "print *var_char after set empty" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++ "whatis var_char after set empty" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*0 \\)" \ ++ "ptype var_char after set empty" ++ ++gdb_breakpoint [gdb_get_line_number "var_char-allocated-3"] ++gdb_continue_to_breakpoint "var_char-allocated-3" ++gdb_test "print var_char" \ ++ " = \\(PTR TO -> \\( character\\*21 \\)\\) ${hex}" \ ++ "print var_char after allocated third time" ++gdb_test "whatis var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++ "whatis var_char after allocated third time" ++gdb_test "ptype var_char" "type = PTR TO -> \\( character\\*21 \\)" \ ++ "ptype var_char after allocated third time" ++ ++gdb_breakpoint [gdb_get_line_number "var_char_p-associated"] ++gdb_continue_to_breakpoint "var_char_p-associated" ++gdb_test "print var_char_p" \ ++ " = \\(PTR TO -> \\( character\\*7 \\)\\) ${hex}" \ ++ "print var_char_p after associated" ++gdb_test "print *var_char_p" " = 'johndoe'" \ ++ "print *var_char_ after associated" ++gdb_test "whatis var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++ "whatis var_char_p after associated" ++gdb_test "ptype var_char_p" "type = PTR TO -> \\( character\\*7 \\)" \ ++ "ptype var_char_p after associated" +diff --git a/gdb/testsuite/gdb.fortran/vla-strings.f90 b/gdb/testsuite/gdb.fortran/vla-strings.f90 +new file mode 100644 +index 0000000..0a1d522 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-strings.f90 +@@ -0,0 +1,40 @@ ++! 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_strings ++ character(len=:), target, allocatable :: var_char ++ character(len=:), pointer :: var_char_p ++ logical :: l ++ ++ allocate(character(len=10) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-1 ++ var_char = 'foo' ++ deallocate(var_char) ! var_char-filled-1 ++ l = allocated(var_char) ! var_char-deallocated ++ allocate(character(len=42) :: var_char) ++ l = allocated(var_char) ++ var_char = 'foobar' ++ var_char = '' ! var_char-filled-2 ++ var_char = 'bar' ! var_char-empty ++ deallocate(var_char) ++ allocate(character(len=21) :: var_char) ++ l = allocated(var_char) ! var_char-allocated-3 ++ var_char = 'johndoe' ++ var_char_p => var_char ++ l = associated(var_char_p) ! var_char_p-associated ++ var_char_p => null() ++ l = associated(var_char_p) ! var_char_p-not-associated ++end program vla_strings +diff --git a/gdb/testsuite/gdb.fortran/vla-sub.f90 b/gdb/testsuite/gdb.fortran/vla-sub.f90 +new file mode 100644 +index 0000000..8c2c9ff +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-sub.f90 +@@ -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 +diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp b/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp +new file mode 100644 +index 0000000..fd11adb +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-value-sub-arbitrary.exp +@@ -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)" +diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp b/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp +new file mode 100644 +index 0000000..a163617 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-value-sub-finish.exp +@@ -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" ++ +diff --git a/gdb/testsuite/gdb.fortran/vla-value-sub.exp b/gdb/testsuite/gdb.fortran/vla-value-sub.exp +new file mode 100644 +index 0000000..848f9d7 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-value-sub.exp +@@ -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)" +diff --git a/gdb/testsuite/gdb.fortran/vla-value.exp b/gdb/testsuite/gdb.fortran/vla-value.exp +new file mode 100644 +index 0000000..d7b8a1e +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla-value.exp +@@ -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" +diff --git a/gdb/testsuite/gdb.fortran/vla.f90 b/gdb/testsuite/gdb.fortran/vla.f90 +new file mode 100644 +index 0000000..73425f3 +--- /dev/null ++++ b/gdb/testsuite/gdb.fortran/vla.f90 +@@ -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 +diff --git a/gdb/testsuite/gdb.mi/mi-vla-fortran.exp b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +new file mode 100644 +index 0000000..72b0be2 +--- /dev/null ++++ b/gdb/testsuite/gdb.mi/mi-vla-fortran.exp +@@ -0,0 +1,182 @@ ++# 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" ++mi_gdb_test "510-data-evaluate-expression vla1" \ ++ "510\\^done,value=\"\\(0, 0, 0, 0, 0\\)\"" "evaluate allocated vla" ++ ++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 +diff --git a/gdb/testsuite/gdb.mi/vla.f90 b/gdb/testsuite/gdb.mi/vla.f90 +new file mode 100644 +index 0000000..46edad2 +--- /dev/null ++++ b/gdb/testsuite/gdb.mi/vla.f90 +@@ -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 +diff --git a/gdb/typeprint.c b/gdb/typeprint.c +index 026f3a2..4c861ac 100644 +--- a/gdb/typeprint.c ++++ b/gdb/typeprint.c +@@ -459,6 +459,13 @@ whatis_exp (char *exp, int show) + + type = value_type (val); + ++ if (TYPE_CODE (type) == TYPE_CODE_PTR) ++ if (is_dynamic_type (TYPE_TARGET_TYPE (type))) ++ { ++ val = value_addr (value_ind (val)); ++ type = value_type (val); ++ } ++ + get_user_print_options (&opts); + if (opts.objectprint) + { +diff --git a/gdb/valarith.c b/gdb/valarith.c +index 4da41cb..fb9671b 100644 +--- a/gdb/valarith.c ++++ b/gdb/valarith.c +@@ -195,12 +195,31 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound) + 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_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)); + struct value *v; + ++ if (elt_stride > 0) ++ elt_offs *= elt_stride; ++ else if (elt_stride < 0) ++ { ++ int offs = (elt_offs + 1) * elt_stride; ++ ++ elt_offs = TYPE_LENGTH (array_type) + offs; ++ } ++ else ++ 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); +diff --git a/gdb/valprint.c b/gdb/valprint.c +index 8600b34..2f8eac1 100644 +--- a/gdb/valprint.c ++++ b/gdb/valprint.c +@@ -307,6 +307,18 @@ valprint_check_validity (struct ui_file *stream, + { + CHECK_TYPEDEF (type); + ++ if (TYPE_NOT_ASSOCIATED (type)) ++ { ++ val_print_not_associated (stream); ++ return 0; ++ } ++ ++ if (TYPE_NOT_ALLOCATED (type)) ++ { ++ val_print_not_allocated (stream); ++ return 0; ++ } ++ + if (TYPE_CODE (type) != TYPE_CODE_UNION + && TYPE_CODE (type) != TYPE_CODE_STRUCT + && TYPE_CODE (type) != TYPE_CODE_ARRAY) +@@ -362,6 +374,18 @@ val_print_invalid_address (struct ui_file *stream) + 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 +@@ -803,12 +827,16 @@ static int + value_check_printable (struct value *val, struct ui_file *stream, + const struct value_print_options *options) + { ++ const struct type *type; ++ + if (val == 0) + { + fprintf_filtered (stream, _("
")); + return 0; + } + ++ type = value_type (val); ++ + if (value_entirely_optimized_out (val)) + { + if (options->summary && !val_print_scalar_type_p (value_type (val))) +@@ -834,6 +862,18 @@ value_check_printable (struct value *val, struct ui_file *stream, + return 0; + } + ++ if (TYPE_NOT_ASSOCIATED (type)) ++ { ++ val_print_not_associated (stream); ++ return 0; ++ } ++ ++ if (TYPE_NOT_ALLOCATED (type)) ++ { ++ val_print_not_allocated (stream); ++ return 0; ++ } ++ + return 1; + } + +diff --git a/gdb/valprint.h b/gdb/valprint.h +index 6698247..7a415cf 100644 +--- a/gdb/valprint.h ++++ b/gdb/valprint.h +@@ -217,4 +217,8 @@ extern void output_command_const (const char *args, int from_tty); + + extern int val_print_scalar_type_p (struct type *type); + ++extern void val_print_not_allocated (struct ui_file *stream); ++ ++extern void val_print_not_associated (struct ui_file *stream); ++ + #endif +diff --git a/gdb/value.c b/gdb/value.c +index 29abe5f..5efea89 100644 +--- a/gdb/value.c ++++ b/gdb/value.c +@@ -43,6 +43,7 @@ + #include "tracepoint.h" + #include "cp-abi.h" + #include "user-regs.h" ++#include "dwarf2loc.h" + + /* Prototypes for exported functions. */ + +@@ -1627,6 +1628,25 @@ set_value_component_location (struct value *component, + if (funcs->copy_closure) + component->location.computed.closure = funcs->copy_closure (whole); + } ++ ++ /* For dynamic types compute the address of the component value location in ++ sub range types based on the location of the sub range type, if not being ++ an internal GDB variable or parts of it. */ ++ if (VALUE_LVAL (component) != lval_internalvar ++ && VALUE_LVAL (component) != lval_internalvar_component) ++ { ++ CORE_ADDR addr; ++ struct type *type = value_type (whole); ++ ++ addr = value_raw_address (component); ++ ++ if (TYPE_DATA_LOCATION (type) ++ && TYPE_DATA_LOCATION_KIND (type) == PROP_CONST) ++ { ++ addr = TYPE_DATA_LOCATION_ADDR (type); ++ set_value_address (component, addr); ++ } ++ } + } + + +@@ -2931,13 +2951,22 @@ value_primitive_field (struct value *arg1, int offset, + 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)); ++ if (TYPE_DATA_LOCATION (type) ++ && TYPE_DATA_LOCATION_KIND (type) == PROP_CONST) ++ v = value_at_lazy (type, value_address (arg1) + offset); ++ else ++ { ++ v = allocate_value (type); ++ value_contents_copy_raw (v, value_embedded_offset (v), ++ arg1, value_embedded_offset (arg1) + offset, ++ TYPE_LENGTH (type)); ++ } + } +- v->offset = (value_offset (arg1) + offset +- + value_embedded_offset (arg1)); ++ ++ if (!TYPE_DATA_LOCATION (type) ++ || !TYPE_DATA_LOCATION_KIND (type) == PROP_CONST) ++ v->offset = (value_offset (arg1) + offset ++ + value_embedded_offset (arg1)); + } + set_value_component_location (v, arg1); + VALUE_REGNUM (v) = VALUE_REGNUM (arg1); +@@ -3520,7 +3549,8 @@ readjust_indirect_value_type (struct value *value, struct type *enc_type, + struct value *original_value) + { + /* Re-adjust type. */ +- deprecated_set_value_type (value, TYPE_TARGET_TYPE (original_type)); ++ if (!is_dynamic_type (TYPE_TARGET_TYPE (original_type))) ++ deprecated_set_value_type (value, TYPE_TARGET_TYPE (original_type)); + + /* Add embedding info. */ + set_value_enclosing_type (value, enc_type); +@@ -3537,6 +3567,12 @@ coerce_ref (struct value *arg) + struct value *retval; + struct type *enc_type; + ++ if (current_language->la_language != language_fortran ++ && TYPE_DATA_LOCATION (value_type_arg_tmp) != NULL ++ && TYPE_DATA_LOCATION_KIND (value_type_arg_tmp) == PROP_CONST) ++ arg = value_at_lazy (value_type_arg_tmp, ++ TYPE_DATA_LOCATION_ADDR (value_type_arg_tmp)); ++ + retval = coerce_ref_if_computed (arg); + if (retval) + return retval; +@@ -3680,8 +3716,14 @@ value_fetch_lazy (struct value *val) + } + else if (VALUE_LVAL (val) == lval_memory) + { +- CORE_ADDR addr = value_address (val); + struct type *type = check_typedef (value_enclosing_type (val)); ++ CORE_ADDR addr; ++ ++ if (TYPE_DATA_LOCATION (type) != NULL ++ && TYPE_DATA_LOCATION_KIND (type) == PROP_CONST) ++ addr = TYPE_DATA_LOCATION_ADDR (type); ++ else ++ addr = value_address (val); + + if (TYPE_LENGTH (type)) + read_value_memory (val, 0, value_stack (val), diff --git a/gdb.changes b/gdb.changes index c854ec7..2951f0a 100644 --- a/gdb.changes +++ b/gdb.changes @@ -1,3 +1,69 @@ +------------------------------------------------------------------- +Fri Aug 8 12:22:24 UTC 2014 - rguenther@suse.com + +- Use patchlist.pl to merge with gdb-7.8-16.fc22, a rebase to FSF GDB 4.8. + The GDB 4.8 features are: + * Guile scripting support. + * Python scripting enhancements. + * New commands: + ** guile + ** guile-repl + ** info auto-load guile-scripts [REGEXP] + * New options: + ** maint ada set ignore-descriptive-types (on|off) + ** maint set target-async (on|off) + ** set|show auto-load guile-scripts (on|off) + ** set|show auto-connect-native-target + ** set|show guile print-stack (none|message|full) + ** set|show mi-async (on|off) + ** set|show print symbol-loading (off|brief|full) + ** set|show record btrace replay-memory-access (read-only|read-write) + * Remote Protocol: + ** The qXfer:btrace:read packet supports a new annex 'delta'. + * GDB/MI: + ** A new option "-gdb-set mi-async" replaces "-gdb-set target-async". + * New target configurations: + ** PowerPC64 GNU/Linux little-endian + * btrace enhancements: + ** The btrace record target now supports the 'record goto' command. + ** The btrace record target supports limited reverse execution and + replay. + * ISO C99 variable length automatic arrays support. + * It is no longer required to "set target-async on" in order to use + background execution commands (e.g., "c&", "s&", etc.). + * "catch syscall" now implemented on s390*-linux* targets. + * The "compare-sections" command now works on all targets. + * The "target native" command now connects to the native target, and + can be used to launch native programs, even if "set + auto-connect-native-target" is set to off. +- Obsoletes patch gdb-7.7-bnc877566.patch +- Obsoletes patch gdb-fix-s390-build.patch +- Obsoletes patch gdb-ppc64le.patch +- Drop gdb-ia64-tdep.patch, disable building the IA64 target +- Modifies gdb-6.3-test-pie-20050107.patch, + gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch, + gdb-6.6-buildid-locate-core-as-arg.patch, + gdb-6.6-buildid-locate-rpm.patch, gdb-6.6-buildid-locate.patch, + gdb-6.6-scheduler_locking-step-is-default.patch, + gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch, + gdb-6.8-attach-signalled-detach-stopped.patch, + gdb-6.8-quit-never-aborts.patch, + gdb-archer-pie-addons-keep-disabled.patch, gdb-archer-pie-addons.patch, + gdb-archer.patch, gdb-attach-fail-reasons-5of5.patch, + gdb-glibc-strstr-workaround.patch, gdb-rhbz795424-bitpos-20of25.patch, + gdb-rhbz795424-bitpos-21of25.patch, gdb-rhbz795424-bitpos-22of25.patch, + gdb-rhbz795424-bitpos-23of25.patch, gdb-rhbz795424-bitpos-25of25.patch, + gdb-upstream.patch +- Adds gdb-archer-vla-tests.patch, gdb-bz533176-fortran-omp-step.patch, + gdb-bz541866-rwatch-before-run.patch + gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch, + gdb-babeltrace-configure.patch, gdb-btrobust.patch, + gdb-dts-rhel6-python-compat.patch, gdb-fortran-frame-string.patch, + gdb-gnat-dwarf-crash-3of3.patch, gdb-python-completer-1of2.patch, + gdb-python-completer-2of2.patch, gdb-readline-6.3.5.patch, + gdb-vla-intel-04of23-fix.patch, gdb-vla-intel-stringbt-fix.patch, + gdb-vla-intel.patch + ------------------------------------------------------------------- Thu Jun 26 14:00:26 UTC 2014 - rguenther@suse.com diff --git a/gdb.spec b/gdb.spec index f0b323a..2d425fd 100644 --- a/gdb.spec +++ b/gdb.spec @@ -25,7 +25,7 @@ Name: gdb %global snap 20130731 # See timestamp of source gnulib installed into gdb/gnulib/ . %global snapgnulib 20121213 -Version: 7.7 +Version: 7.8 Release: 0 # The release always contains a leading reserved number, start it at 1. @@ -91,117 +91,122 @@ Source12: baselibs.conf Patch1: gdb-6.3-rh-testversion-20041202.patch Patch2: gdb-archer.patch Patch3: gdb-upstream.patch -Patch4: gdb-6.3-rh-dummykfail-20041202.patch -Patch5: gdb-6.3-ppc64syscall-20040622.patch -Patch6: gdb-6.3-ppc64displaysymbol-20041124.patch -Patch7: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch -Patch8: gdb-6.3-gstack-20050411.patch -Patch9: gdb-6.3-test-pie-20050107.patch -Patch10: gdb-6.3-test-self-20050110.patch -Patch11: gdb-6.3-test-dtorfix-20050121.patch -Patch12: gdb-6.3-test-movedir-20050125.patch -Patch13: gdb-6.3-threaded-watchpoints2-20050225.patch -Patch14: gdb-6.3-inferior-notification-20050721.patch -Patch15: gdb-6.3-inheritancetest-20050726.patch -Patch16: gdb-6.3-readnever-20050907.patch -Patch17: gdb-6.5-bz203661-emit-relocs.patch -Patch18: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch -Patch19: gdb-6.5-sharedlibrary-path.patch -Patch20: gdb-6.5-bz190810-gdbserver-arch-advice.patch -Patch21: gdb-6.5-BEA-testsuite.patch -Patch22: gdb-6.5-last-address-space-byte-test.patch -Patch23: gdb-6.5-readline-long-line-crash-test.patch -Patch24: gdb-6.5-bz216711-clone-is-outermost.patch -Patch25: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch -Patch26: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch -Patch27: gdb-6.5-bz109921-DW_AT_decl_file-test.patch -Patch28: gdb-6.3-bz140532-ppc-unwinding-test.patch -Patch29: gdb-6.3-bz202689-exec-from-pthread-test.patch -Patch30: gdb-6.6-bz230000-power6-disassembly-test.patch -Patch31: gdb-6.3-bz231832-obstack-2gb.patch -Patch32: gdb-6.6-bz229517-gcore-without-terminal.patch -Patch33: gdb-6.6-bz235197-fork-detach-info.patch -Patch34: gdb-6.6-testsuite-timeouts.patch -Patch35: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch -Patch36: gdb-6.6-scheduler_locking-step-is-default.patch -Patch37: gdb-6.3-attach-see-vdso-test.patch -Patch38: gdb-6.5-bz243845-stale-testing-zombie-test.patch -Patch39: gdb-6.6-buildid-locate.patch -Patch40: gdb-6.6-buildid-locate-solib-missing-ids.patch -Patch41: gdb-6.6-buildid-locate-rpm.patch -Patch42: gdb-6.6-bfd-vdso8k.patch -Patch43: gdb-6.7-charsign-test.patch -Patch44: gdb-6.7-ppc-clobbered-registers-O2-test.patch -Patch45: gdb-6.5-ia64-libunwind-leak-test.patch -Patch46: gdb-6.5-missed-trap-on-step-test.patch -Patch47: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch -Patch48: gdb-6.5-gcore-buffer-limit-test.patch -Patch49: gdb-6.6-threads-static-test.patch -Patch50: gdb-6.3-mapping-zero-inode-test.patch -Patch51: gdb-6.3-focus-cmd-prev-test.patch -Patch52: gdb-6.8-bz442765-threaded-exec-test.patch -Patch53: gdb-6.8-sparc64-silence-memcpy-check.patch -Patch54: gdb-6.5-section-num-fixup-test.patch -Patch55: gdb-6.8-bz436037-reg-no-longer-active.patch -Patch56: gdb-6.8-watchpoint-conditionals-test.patch -Patch57: gdb-6.8-bz466901-backtrace-full-prelinked.patch -Patch58: gdb-6.8-bz457187-largefile-test.patch -Patch59: gdb-simultaneous-step-resume-breakpoint-test.patch -Patch60: gdb-core-open-vdso-warning.patch -Patch61: gdb-x86_64-i386-syscall-restart.patch -Patch62: gdb-bz533176-fortran-omp-step.patch -Patch63: gdb-follow-child-stale-parent.patch -Patch64: gdb-ccache-workaround.patch -Patch65: gdb-archer-pie-addons.patch -Patch66: gdb-archer-pie-addons-keep-disabled.patch -Patch67: gdb-lineno-makeup-test.patch -Patch68: gdb-ppc-power7-test.patch -Patch69: gdb-bz541866-rwatch-before-run.patch -Patch70: gdb-moribund-utrace-workaround.patch -Patch71: gdb-archer-next-over-throw-cxx-exec.patch -Patch72: gdb-bz601887-dwarf4-rh-test.patch -Patch73: gdb-6.6-buildid-locate-core-as-arg.patch -Patch74: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch -Patch75: gdb-test-bt-cfi-without-die.patch -Patch76: gdb-gdb-add-index-script.patch -Patch77: gdb-bz568248-oom-is-error.patch -Patch78: gdb-bz634108-solib_address.patch -Patch79: gdb-test-pid0-core.patch -Patch80: gdb-test-dw2-aranges.patch -Patch81: gdb-test-expr-cumulative-archer.patch -Patch82: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch -Patch83: gdb-glibc-vdso-workaround.patch -Patch84: gdb-runtest-pie-override.patch -Patch85: gdb-attach-fail-reasons-5of5.patch -Patch86: gdb-stale-frame_info.patch -Patch87: gdb-glibc-strstr-workaround.patch -Patch88: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch -Patch89: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch -Patch90: gdb-rhbz795424-bitpos-20of25.patch -Patch91: gdb-rhbz795424-bitpos-21of25.patch -Patch92: gdb-rhbz795424-bitpos-22of25.patch -Patch93: gdb-rhbz795424-bitpos-23of25.patch -Patch94: gdb-rhbz795424-bitpos-25of25.patch -Patch95: gdb-rhbz795424-bitpos-25of25-test.patch -Patch96: gdb-rhbz795424-bitpos-lazyvalue.patch -Patch97: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch -Patch98: gdb-enable-count-crash.patch -Patch99: gdb-testsuite-nohostid.patch -Patch100: gdb-python-stacksmash.patch -Patch101: gdb-rhel5-gcc44.patch -Patch102: gdb-6.6-buildid-locate-rpm-scl.patch -Patch103: gdb-readline62-ask-more-rh.patch -Patch104: gdb-6.8-attach-signalled-detach-stopped.patch -Patch105: gdb-6.8-quit-never-aborts.patch -Patch106: gdb-rhel5-compat.patch +Patch4: gdb-vla-intel.patch +Patch5: gdb-vla-intel-04of23-fix.patch +Patch6: gdb-vla-intel-stringbt-fix.patch +Patch7: gdb-6.3-rh-dummykfail-20041202.patch +Patch8: gdb-6.3-ppc64syscall-20040622.patch +Patch9: gdb-6.3-ppc64displaysymbol-20041124.patch +Patch10: gdb-6.6-scheduler_locking-step-sw-watchpoints2.patch +Patch11: gdb-6.3-gstack-20050411.patch +Patch12: gdb-6.3-test-pie-20050107.patch +Patch13: gdb-6.3-test-self-20050110.patch +Patch14: gdb-6.3-test-dtorfix-20050121.patch +Patch15: gdb-6.3-test-movedir-20050125.patch +Patch16: gdb-6.3-threaded-watchpoints2-20050225.patch +Patch17: gdb-6.3-inferior-notification-20050721.patch +Patch18: gdb-6.3-inheritancetest-20050726.patch +Patch19: gdb-6.3-readnever-20050907.patch +Patch20: gdb-6.5-bz203661-emit-relocs.patch +Patch21: gdb-6.5-bz185337-resolve-tls-without-debuginfo-v2.patch +Patch22: gdb-6.5-sharedlibrary-path.patch +Patch23: gdb-6.5-bz190810-gdbserver-arch-advice.patch +Patch24: gdb-6.5-BEA-testsuite.patch +Patch25: gdb-6.5-last-address-space-byte-test.patch +Patch26: gdb-6.5-readline-long-line-crash-test.patch +Patch27: gdb-6.5-bz216711-clone-is-outermost.patch +Patch28: gdb-6.5-bz218379-ppc-solib-trampoline-test.patch +Patch29: gdb-6.5-bz218379-solib-trampoline-lookup-lock-fix.patch +Patch30: gdb-6.5-bz109921-DW_AT_decl_file-test.patch +Patch31: gdb-6.3-bz140532-ppc-unwinding-test.patch +Patch32: gdb-6.3-bz202689-exec-from-pthread-test.patch +Patch33: gdb-6.6-bz230000-power6-disassembly-test.patch +Patch34: gdb-6.3-bz231832-obstack-2gb.patch +Patch35: gdb-6.6-bz229517-gcore-without-terminal.patch +Patch36: gdb-6.6-bz235197-fork-detach-info.patch +Patch37: gdb-6.6-testsuite-timeouts.patch +Patch38: gdb-6.6-bz237572-ppc-atomic-sequence-test.patch +Patch39: gdb-6.6-scheduler_locking-step-is-default.patch +Patch40: gdb-6.3-attach-see-vdso-test.patch +Patch41: gdb-6.5-bz243845-stale-testing-zombie-test.patch +Patch42: gdb-6.6-buildid-locate.patch +Patch43: gdb-6.6-buildid-locate-solib-missing-ids.patch +Patch44: gdb-6.6-buildid-locate-rpm.patch +Patch45: gdb-6.7-charsign-test.patch +Patch46: gdb-6.7-ppc-clobbered-registers-O2-test.patch +Patch47: gdb-6.5-ia64-libunwind-leak-test.patch +Patch48: gdb-6.5-missed-trap-on-step-test.patch +Patch49: gdb-6.7-bz426600-DW_TAG_interface_type-test.patch +Patch50: gdb-6.5-gcore-buffer-limit-test.patch +Patch51: gdb-6.6-threads-static-test.patch +Patch52: gdb-6.3-mapping-zero-inode-test.patch +Patch53: gdb-6.3-focus-cmd-prev-test.patch +Patch54: gdb-6.8-bz442765-threaded-exec-test.patch +Patch55: gdb-6.8-sparc64-silence-memcpy-check.patch +Patch56: gdb-6.5-section-num-fixup-test.patch +Patch57: gdb-6.8-bz436037-reg-no-longer-active.patch +Patch58: gdb-6.8-watchpoint-conditionals-test.patch +Patch59: gdb-6.8-bz466901-backtrace-full-prelinked.patch +Patch60: gdb-6.8-bz457187-largefile-test.patch +Patch61: gdb-simultaneous-step-resume-breakpoint-test.patch +Patch62: gdb-core-open-vdso-warning.patch +Patch63: gdb-x86_64-i386-syscall-restart.patch +Patch64: gdb-bz533176-fortran-omp-step.patch +Patch65: gdb-follow-child-stale-parent.patch +Patch66: gdb-ccache-workaround.patch +Patch67: gdb-archer-pie-addons.patch +Patch68: gdb-archer-pie-addons-keep-disabled.patch +Patch69: gdb-lineno-makeup-test.patch +Patch70: gdb-ppc-power7-test.patch +Patch71: gdb-bz541866-rwatch-before-run.patch +Patch72: gdb-moribund-utrace-workaround.patch +Patch73: gdb-archer-next-over-throw-cxx-exec.patch +Patch74: gdb-bz601887-dwarf4-rh-test.patch +Patch75: gdb-6.6-buildid-locate-core-as-arg.patch +Patch76: gdb-6.6-buildid-locate-rpm-librpm-workaround.patch +Patch77: gdb-test-bt-cfi-without-die.patch +Patch78: gdb-gdb-add-index-script.patch +Patch79: gdb-bz568248-oom-is-error.patch +Patch80: gdb-bz634108-solib_address.patch +Patch81: gdb-test-pid0-core.patch +Patch82: gdb-test-dw2-aranges.patch +Patch83: gdb-test-expr-cumulative-archer.patch +Patch84: gdb-7.2.50-sparc-add-workaround-to-broken-debug-files.patch +Patch85: gdb-glibc-vdso-workaround.patch +Patch86: gdb-runtest-pie-override.patch +Patch87: gdb-attach-fail-reasons-5of5.patch +Patch88: gdb-stale-frame_info.patch +Patch89: gdb-glibc-strstr-workaround.patch +Patch90: gdb-rhel5.9-testcase-xlf-var-inside-mod.patch +Patch91: gdb-rhbz-818343-set-solib-absolute-prefix-testcase.patch +Patch92: gdb-rhbz795424-bitpos-20of25.patch +Patch93: gdb-rhbz795424-bitpos-21of25.patch +Patch94: gdb-rhbz795424-bitpos-22of25.patch +Patch95: gdb-rhbz795424-bitpos-23of25.patch +Patch96: gdb-rhbz795424-bitpos-25of25.patch +Patch97: gdb-rhbz795424-bitpos-25of25-test.patch +Patch98: gdb-rhbz795424-bitpos-lazyvalue.patch +Patch99: gdb-rhbz947564-findvar-assertion-frame-failed-testcase.patch +Patch100: gdb-enable-count-crash.patch +Patch101: gdb-gnat-dwarf-crash-3of3.patch +Patch102: gdb-6.6-buildid-locate-misleading-warning-missing-debuginfo-rhbz981154.patch +Patch103: gdb-archer-vla-tests.patch +Patch104: gdb-readline-6.3.5.patch +Patch105: gdb-btrobust.patch +Patch106: gdb-python-completer-1of2.patch +Patch107: gdb-python-completer-2of2.patch +Patch108: gdb-fortran-frame-string.patch +Patch109: gdb-babeltrace-configure.patch +Patch110: gdb-dts-rhel6-python-compat.patch +Patch111: gdb-6.6-buildid-locate-rpm-scl.patch +Patch112: gdb-readline62-ask-more-rh.patch +Patch113: gdb-6.8-attach-signalled-detach-stopped.patch +Patch114: gdb-6.8-quit-never-aborts.patch +Patch115: gdb-rhel5-compat.patch #Fedora Packages end # Upstream patch to fix gcc -Werror Patch1002: gdb-6.6-buildid-locate-rpm-suse.patch -Patch1004: gdb-ia64-tdep.patch -Patch1006: gdb-ppc64le.patch -Patch1007: gdb-fix-s390-build.patch -Patch1008: gdb-7.7-bnc877566.patch BuildRequires: bison BuildRequires: flex @@ -431,25 +436,30 @@ find -name "*.info*"|xargs rm -f %patch98 -p1 %patch99 -p1 %patch100 -p1 -#%%patch101 -p1 -#%%patch101 -p1 -R -#%%patch102 -p1 -#%%patch102 -p1 -R -#%%patch103 -p1 -#%%patch103 -p1 -R -#%%patch104 -p1 -#%%patch104 -p1 -R -#%%patch105 -p1 -#%%patch105 -p1 -R -#%%patch106 -p1 -#%%patch106 -p1 -R +%patch101 -p1 +%patch102 -p1 +%patch103 -p1 +%patch104 -p1 +%patch105 -p1 +%patch106 -p1 +%patch107 -p1 +%patch108 -p1 +%patch109 -p1 +%patch110 -p1 +%patch110 -p1 -R +%patch111 -p1 +%patch111 -p1 -R +%patch112 -p1 +%patch112 -p1 -R +%patch113 -p1 +%patch114 -p1 +%patch115 -p1 +%patch115 -p1 -R +%patch114 -p1 -R +%patch113 -p1 -R #Fedora patching end %patch1002 -p1 -%patch1004 -p1 -%patch1006 -p1 -%patch1007 -p1 -%patch1008 -p1 find -name "*.orig" | xargs rm -f ! find -name "*.rej" # Should not happen. @@ -492,7 +502,8 @@ fi %else %define build_multitarget 0 %endif -%define target_list i686 ia64 powerpc powerpc64 powerpc64le s390 s390x x86_64 arm aarch64 m68k +# For now disable ia64 until ia64-tdep.c is fixed +%define target_list i686 powerpc powerpc64 powerpc64le s390 s390x x86_64 arm aarch64 m68k %define DIST %(echo '%distribution' | sed 's, /.*,,') %if %build_multitarget EXTRA_TARGETS="%(printf ,%%s-suse-linux %target_list)"