gdb/gdb-vla-intel-stringbt-fix.patch
Richard Biener 355c8053f0 - Use patchlist.pl to merge with gdb-7.9-10.fc22, a rebase to FSF GDB 7.9.
The GDB 7.8 features are:
  * Python Scripting
   - You can now access frame registers from Python scripts.
   - New attribute 'producer' for gdb.Symtab objects.
  * New Python-based convenience functions:
   - $_caller_is(name [, number_of_frames])
   - $_caller_matches(regexp [, number_of_frames])
   - $_any_caller_is(name [, number_of_frames])
   - $_any_caller_matches(regexp [, number_of_frames])
  * New commands
   - queue-signal signal-name-or-number
     Queue a signal to be delivered to the thread when it is resumed.
  * On resume, GDB now always passes the signal the program had stopped
    for to the thread the signal was sent to, even if the user changed
    threads before resuming.  Previously GDB would often (but not
    always) deliver the signal to the thread that happens to be current
    at resume time.
  * Conversely, the "signal" command now consistently delivers the
    requested signal to the current thread.  GDB now asks for
    confirmation if the program had stopped for a signal and the user
    switched threads meanwhile.
  * "breakpoint always-inserted" modes "off" and "auto" merged.
    Now, when 'breakpoint always-inserted mode' is set to "off", GDB
    won't remove breakpoints from the target until all threads stop,
    even in non-stop mode.  The "auto" mode has been removed, and "off"
    is now the default mode.
  * MI changes
   - The -list-thread-groups command outputs an exit-code field for
     inferiors that have exited.

OBS-URL: https://build.opensuse.org/package/show/devel:gcc/gdb?expand=0&rev=115
2015-02-25 13:45:10 +00:00

168 lines
6.5 KiB
Diff

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"
Index: gdb-7.8.50.20141228/gdb/gdbtypes.c
===================================================================
--- gdb-7.8.50.20141228.orig/gdb/gdbtypes.c 2015-01-08 18:15:18.475682523 +0100
+++ gdb-7.8.50.20141228/gdb/gdbtypes.c 2015-01-08 18:39:01.423134700 +0100
@@ -1684,6 +1684,7 @@ is_dynamic_type_internal (struct type *t
return !has_static_range (TYPE_RANGE_DATA (type));
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
{
gdb_assert (TYPE_NFIELDS (type) == 1);
@@ -1992,6 +1993,7 @@ resolve_dynamic_type_internal (struct ty
}
case TYPE_CODE_ARRAY:
+ case TYPE_CODE_STRING:
resolved_type = resolve_dynamic_array (type, addr);
break;
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2015-01-08 18:15:18.897684435 +0100
@@ -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 <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+subroutine bar
+ real :: dummy
+ dummy = 1
+end subroutine bar
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2015-01-08 18:15:18.897684435 +0100
@@ -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'.*}
Index: gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.8.50.20141228/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2015-01-08 18:15:18.897684435 +0100
@@ -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 <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+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