Rebase to FSF GDB 7.8.

- Display Fortran strings in backtraces.
This commit is contained in:
Jan Kratochvil 2014-08-02 12:58:20 +02:00
parent 902c8e5abc
commit 191ccfbccd
11 changed files with 493 additions and 787 deletions

2
.gitignore vendored
View File

@ -1,2 +1,2 @@
/gdb-libstdc++-v3-python-r155978.tar.bz2
/gdb-7.7.91.20140724.tar.bz2
/gdb-7.8.tar.gz

View File

@ -1880,118 +1880,6 @@ Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dwarf-stride.f90
+ print *, c40pt ! break-here
+
+end program repro
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame-stub.f90 2014-06-16 23:30:30.113940488 +0200
@@ -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.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.exp 2014-06-16 23:30:30.113940488 +0200
@@ -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'.*}
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000
+++ gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic-other-frame.f90 2014-06-16 23:30:30.113940488 +0200
@@ -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
Index: gdb-7.7.90.20140613/gdb/testsuite/gdb.fortran/dynamic.exp
===================================================================
--- /dev/null 1970-01-01 00:00:00.000000000 +0000

View File

@ -7,19 +7,18 @@ commit b88230edf4e2da948d633c283ba0893bf22bd7ae
tromey/python
diff --git a/README.archer b/README.archer
new file mode 100644
index 0000000..173b8ea
--- /dev/null
+++ b/README.archer
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.
diff --git a/gdb/Makefile.in b/gdb/Makefile.in
index ea27cf5..bc04024 100644
--- a/gdb/Makefile.in
+++ b/gdb/Makefile.in
@@ -1476,6 +1476,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
@ -32,11 +31,11 @@ index ea27cf5..bc04024 100644
config.status: $(srcdir)/configure configure.tgt configure.host ../bfd/development.sh
$(SHELL) config.status --recheck
diff --git a/gdb/data-directory/Makefile.in b/gdb/data-directory/Makefile.in
index b9fcc03..3c2afe2 100644
--- a/gdb/data-directory/Makefile.in
+++ b/gdb/data-directory/Makefile.in
@@ -66,6 +66,8 @@ PYTHON_FILES = \
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 \
@ -45,7 +44,7 @@ index b9fcc03..3c2afe2 100644
gdb/command/xmethods.py \
gdb/command/frame_filters.py \
gdb/command/type_printers.py \
@@ -73,7 +75,10 @@ PYTHON_FILES = \
@@ -73,7 +75,10 @@ PYTHON_FILE_LIST = \
gdb/command/prompt.py \
gdb/command/explore.py \
gdb/function/__init__.py \
@ -55,12 +54,12 @@ index b9fcc03..3c2afe2 100644
+ gdb/function/in_scope.py \
+ gdb/types.py
GUILE_DIR = guile
GUILE_INSTALL_DIR = $(DESTDIR)$(GDB_DATADIR)/$(GUILE_DIR)
diff --git a/gdb/doc/gdb.texinfo b/gdb/doc/gdb.texinfo
index a0fb66d..3fae61e 100644
--- a/gdb/doc/gdb.texinfo
+++ b/gdb/doc/gdb.texinfo
@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.
@ -78,10 +77,10 @@ index a0fb66d..3fae61e 100644
@c resolve the situation of these eventually
@item -tui
@cindex @code{--tui}
diff --git a/gdb/doc/python.texi b/gdb/doc/python.texi
index 4688783..a32133a 100644
--- a/gdb/doc/python.texi
+++ b/gdb/doc/python.texi
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
@ -91,10 +90,10 @@ index 4688783..a32133a 100644
>print 23
>end
23
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
@ -111,10 +110,10 @@ index 05a38b2..9801fdf 100644
if !$gdb_init_done
set variable $gdb_init_done = 1
diff --git a/gdb/main.c b/gdb/main.c
index 108759d..a624c1b 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"
@ -123,7 +122,7 @@ index 108759d..a624c1b 100644
#include "source.h"
#include "cli/cli-cmds.h"
#include "objfiles.h"
@@ -359,6 +360,8 @@ captured_main (void *data)
@@ -417,6 +418,8 @@ captured_main (void *data)
char *cdarg = NULL;
char *ttyarg = NULL;
@ -132,7 +131,7 @@ index 108759d..a624c1b 100644
/* These are static so that we can take their address in an
initializer. */
static int print_help;
@@ -566,10 +569,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},
@ -148,7 +147,7 @@ index 108759d..a624c1b 100644
{
int option_index;
@@ -587,6 +594,9 @@ captured_main (void *data)
@@ -645,6 +652,9 @@ captured_main (void *data)
case 0:
/* Long option that just sets a flag. */
break;
@ -158,7 +157,7 @@ index 108759d..a624c1b 100644
case OPT_SE:
symarg = optarg;
execarg = optarg;
@@ -791,7 +801,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. */
@ -191,7 +190,7 @@ index 108759d..a624c1b 100644
{
/* The remaining options are the command-line options for the
inferior. The first one is the sym/exec file, and the rest
@@ -1077,7 +1111,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. */
@ -201,7 +200,7 @@ index 108759d..a624c1b 100644
if (batch_flag)
{
@@ -1088,13 +1123,25 @@ captured_main (void *data)
@@ -1146,13 +1181,25 @@ captured_main (void *data)
/* Show time and/or space usage. */
do_cleanups (pre_stat_chain);
@ -233,7 +232,7 @@ index 108759d..a624c1b 100644
}
/* No exit -- exit is through quit_command. */
}
@@ -1128,6 +1175,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\
@ -246,7 +245,7 @@ index 108759d..a624c1b 100644
gdb [options] --args executable-file [inferior-arguments ...]\n\n\
"), stream);
fputs_unfiltered (_("\
@@ -1173,6 +1226,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\
@ -260,11 +259,10 @@ index 108759d..a624c1b 100644
-q, --quiet, --silent\n\
Do not print version number on startup.\n\n\
"), stream);
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.
+
@ -303,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
+
@ -390,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.
+
@ -454,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.
+
@ -507,11 +502,11 @@ index 0000000..debb3bb
+ return wanted == found
+
+InScope ()
diff --git a/gdb/python/python.c b/gdb/python/python.c
index 369a249..0f136a8 100644
--- a/gdb/python/python.c
+++ b/gdb/python/python.c
@@ -95,6 +95,8 @@ const struct extension_language_defn extension_language_python =
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"
@ -586,10 +581,10 @@ index 369a249..0f136a8 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 9e99992..c776e59 100644
--- a/gdb/python/python.h
+++ b/gdb/python/python.h
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;
@ -597,10 +592,10 @@ index 9e99992..c776e59 100644
+extern void run_python_script (int argc, char **argv);
+
#endif /* GDB_PYTHON_H */
diff --git a/gdb/testsuite/gdb.gdb/selftest.exp b/gdb/testsuite/gdb.gdb/selftest.exp
index 91142fe..724679f 100644
--- a/gdb/testsuite/gdb.gdb/selftest.exp
+++ b/gdb/testsuite/gdb.gdb/selftest.exp
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"
@ -612,20 +607,20 @@ index 91142fe..724679f 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.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 ()))" "<gdb.Block object at 0x\[\[:xdigit:\]\]+>" "test Frame.block"
diff --git a/gdb/testsuite/gdb.python/py-value.exp b/gdb/testsuite/gdb.python/py-value.exp
index 13433fd..b146165 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"
}

View File

@ -37,10 +37,10 @@ gdb/gdbserver/
(linux_create_inferior, linux_tracefork_child): Call it instead of
direct ptrace.
Index: gdb-7.7.50.20140609/gdb/common/linux-ptrace.c
Index: gdb-7.8/gdb/common/linux-ptrace.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/common/linux-ptrace.c 2014-06-13 20:28:04.375884828 +0200
+++ gdb-7.7.50.20140609/gdb/common/linux-ptrace.c 2014-06-13 20:28:57.514940079 +0200
--- 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 <stdint.h>
@ -81,10 +81,10 @@ Index: gdb-7.7.50.20140609/gdb/common/linux-ptrace.c
+ "(gdb) shell sudo setsebool deny_ptrace=0"));
+#endif /* HAVE_LIBSELINUX */
+}
Index: gdb-7.7.50.20140609/gdb/common/linux-ptrace.h
Index: gdb-7.8/gdb/common/linux-ptrace.h
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/common/linux-ptrace.h 2014-06-13 20:28:14.375895202 +0200
+++ gdb-7.7.50.20140609/gdb/common/linux-ptrace.h 2014-06-13 20:28:33.298914047 +0200
--- 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_fail_reason (pid_t pid, struct buffer *buffer);
@ -93,11 +93,11 @@ Index: gdb-7.7.50.20140609/gdb/common/linux-ptrace.h
extern void linux_enable_event_reporting (pid_t pid);
extern void linux_disable_event_reporting (pid_t pid);
extern int linux_supports_tracefork (void);
Index: gdb-7.7.50.20140609/gdb/configure.ac
Index: gdb-7.8/gdb/configure.ac
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/configure.ac 2014-06-13 20:28:04.377884830 +0200
+++ gdb-7.7.50.20140609/gdb/configure.ac 2014-06-13 20:28:14.376895203 +0200
@@ -2138,6 +2138,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.7.50.20140609/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.7.50.20140609/gdb/gdbserver/configure.ac
Index: gdb-7.8/gdb/gdbserver/configure.ac
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/gdbserver/configure.ac 2014-06-13 20:28:04.377884830 +0200
+++ gdb-7.7.50.20140609/gdb/gdbserver/configure.ac 2014-06-13 20:28:14.376895203 +0200
--- 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,10 +123,10 @@ Index: gdb-7.7.50.20140609/gdb/gdbserver/configure.ac
AC_SUBST(GDBSERVER_DEPFILES)
AC_SUBST(GDBSERVER_LIBS)
AC_SUBST(srv_xmlbuiltin)
Index: gdb-7.7.50.20140609/gdb/gdbserver/linux-low.c
Index: gdb-7.8/gdb/gdbserver/linux-low.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/gdbserver/linux-low.c 2014-06-13 20:28:04.379884832 +0200
+++ gdb-7.7.50.20140609/gdb/gdbserver/linux-low.c 2014-06-13 20:28:14.377895204 +0200
--- 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;
}
@ -166,10 +166,10 @@ Index: gdb-7.7.50.20140609/gdb/gdbserver/linux-low.c
#ifndef __ANDROID__ /* Bionic doesn't use SIGRTMIN the way glibc does. */
signal (__SIGRTMIN + 1, SIG_DFL);
Index: gdb-7.7.50.20140609/gdb/inf-ptrace.c
Index: gdb-7.8/gdb/inf-ptrace.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/inf-ptrace.c 2014-06-13 20:28:04.380884833 +0200
+++ gdb-7.7.50.20140609/gdb/inf-ptrace.c 2014-06-13 20:28:14.377895204 +0200
--- 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.7.50.20140609/gdb/inf-ptrace.c
}
/* Start a new inferior Unix child process. EXEC_FILE is the file to
Index: gdb-7.7.50.20140609/gdb/linux-nat.c
Index: gdb-7.8/gdb/linux-nat.c
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/linux-nat.c 2014-06-13 20:28:04.382884835 +0200
+++ gdb-7.7.50.20140609/gdb/linux-nat.c 2014-06-13 20:29:34.554977995 +0200
@@ -1285,6 +1285,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,7 +198,7 @@ Index: gdb-7.7.50.20140609/gdb/linux-nat.c
/* The fork_child mechanism is synchronous and calls target_wait, so
we have to mask the async mode. */
@@ -1309,7 +1310,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 (ops, 0, NULL);
@ -210,7 +210,7 @@ Index: gdb-7.7.50.20140609/gdb/linux-nat.c
#ifdef HAVE_PERSONALITY
if (personality_set)
@@ -1321,6 +1325,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.7.50.20140609/gdb/linux-nat.c
}
static void
Index: gdb-7.7.50.20140609/gdb/config.in
Index: gdb-7.8/gdb/config.in
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/config.in 2014-06-13 20:28:04.383884836 +0200
+++ gdb-7.7.50.20140609/gdb/config.in 2014-06-13 20:29:57.378002067 +0200
@@ -216,6 +216,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.7.50.20140609/gdb/config.in
/* Define to 1 if you have the <libunwind-ia64.h> header file. */
#undef HAVE_LIBUNWIND_IA64_H
@@ -351,6 +354,9 @@
@@ -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 <selinux/selinux.h> 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.7.50.20140609/gdb/configure
Index: gdb-7.8/gdb/configure
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/configure 2014-06-13 20:28:04.387884840 +0200
+++ gdb-7.7.50.20140609/gdb/configure 2014-06-13 20:28:14.383895210 +0200
@@ -13282,6 +13282,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,10 +328,10 @@ Index: gdb-7.7.50.20140609/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.7.50.20140609/gdb/gdbserver/config.in
Index: gdb-7.8/gdb/gdbserver/config.in
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/gdbserver/config.in 2014-06-13 20:28:04.389884842 +0200
+++ gdb-7.7.50.20140609/gdb/gdbserver/config.in 2014-06-13 20:28:14.383895210 +0200
--- 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
@ -352,10 +352,10 @@ Index: gdb-7.7.50.20140609/gdb/gdbserver/config.in
/* Define to 1 if you have the <sgtty.h> header file. */
#undef HAVE_SGTTY_H
Index: gdb-7.7.50.20140609/gdb/gdbserver/configure
Index: gdb-7.8/gdb/gdbserver/configure
===================================================================
--- gdb-7.7.50.20140609.orig/gdb/gdbserver/configure 2014-06-13 20:28:04.390884844 +0200
+++ gdb-7.7.50.20140609/gdb/gdbserver/configure 2014-06-13 20:28:14.384895211 +0200
--- 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

View File

@ -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 <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+ subroutine f(s)
+ character*3 s
+ s = s
+ end
+
+ program main
+ call f ('foo')
+ end

View File

@ -96,10 +96,10 @@ Content-Type: text/x-patch
Content-Transfer-Encoding: 7bit
Content-Disposition: attachment; filename=bitpos-wp.patch
Index: gdb-7.7.90.20140613/gdb/arm-linux-nat.c
Index: gdb-7.8/gdb/arm-linux-nat.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/arm-linux-nat.c 2014-06-13 22:23:09.630440699 +0200
+++ gdb-7.7.90.20140613/gdb/arm-linux-nat.c 2014-06-13 22:23:54.666492199 +0200
--- 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,
@ -109,11 +109,11 @@ Index: gdb-7.7.90.20140613/gdb/arm-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c
Index: gdb-7.8/gdb/ppc-linux-nat.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/ppc-linux-nat.c 2014-06-13 22:23:09.635440704 +0200
+++ gdb-7.7.90.20140613/gdb/ppc-linux-nat.c 2014-06-13 22:23:54.672492206 +0200
@@ -1857,11 +1857,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
@ -128,7 +128,7 @@ Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c
CORE_ADDR addr_end_data, addr_end_dvc;
/* The DVC register compares bytes within fixed-length windows which
@@ -1948,7 +1948,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,
@ -137,7 +137,16 @@ Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c
{
int pc = 1, num_accesses_left, num_accesses_right;
struct value *left_val, *right_val, *left_chain, *right_chain;
@@ -2033,7 +2033,7 @@ ppc_linux_can_accel_watchpoint_condition
@@ -2021,7 +2021,7 @@ check_condition (CORE_ADDR watch_addr, s
true. */
static int
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;
@@ -2038,7 +2038,7 @@ ppc_linux_can_accel_watchpoint_condition
static void
create_watchpoint_request (struct ppc_hw_breakpoint *p, CORE_ADDR addr,
@ -146,7 +155,7 @@ Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c
int insert)
{
if (len == 1
@@ -2299,7 +2299,7 @@ ppc_linux_stopped_by_watchpoint (struct
@@ -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,
@ -155,10 +164,10 @@ Index: gdb-7.7.90.20140613/gdb/ppc-linux-nat.c
{
int mask;
Index: gdb-7.7.90.20140613/gdb/procfs.c
Index: gdb-7.8/gdb/procfs.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/procfs.c 2014-06-13 22:23:09.638440708 +0200
+++ gdb-7.7.90.20140613/gdb/procfs.c 2014-06-13 22:23:54.673492207 +0200
--- 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
@ -177,11 +186,11 @@ Index: gdb-7.7.90.20140613/gdb/procfs.c
int after)
{
#ifndef AIX5
Index: gdb-7.7.90.20140613/gdb/remote.c
Index: gdb-7.8/gdb/remote.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/remote.c 2014-06-13 22:23:09.643440713 +0200
+++ gdb-7.7.90.20140613/gdb/remote.c 2014-06-13 22:23:54.680492215 +0200
@@ -8199,7 +8199,7 @@ remote_insert_watchpoint (struct target_
--- 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);
@ -190,7 +199,7 @@ Index: gdb-7.7.90.20140613/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
@@ -8219,7 +8219,7 @@ remote_insert_watchpoint (struct target_
@@ -8226,7 +8226,7 @@ remote_insert_watchpoint (struct target_
static int
remote_watchpoint_addr_within_range (struct target_ops *target, CORE_ADDR addr,
@ -199,7 +208,7 @@ Index: gdb-7.7.90.20140613/gdb/remote.c
{
CORE_ADDR diff = remote_address_masked (addr - start);
@@ -8249,7 +8249,7 @@ remote_remove_watchpoint (struct target_
@@ -8256,7 +8256,7 @@ remote_remove_watchpoint (struct target_
p = strchr (rs->buf, '\0');
addr = remote_address_masked (addr);
p += hexnumstr (p, (ULONGEST) addr);
@ -208,10 +217,10 @@ Index: gdb-7.7.90.20140613/gdb/remote.c
putpkt (rs->buf);
getpkt (&rs->buf, &rs->buf_size, 0);
Index: gdb-7.7.90.20140613/gdb/target.c
Index: gdb-7.8/gdb/target.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/target.c 2014-06-13 22:23:09.645440716 +0200
+++ gdb-7.7.90.20140613/gdb/target.c 2014-06-13 22:26:24.077661601 +0200
--- 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);
@ -221,7 +230,7 @@ Index: gdb-7.7.90.20140613/gdb/target.c
static int default_region_ok_for_hw_watchpoint (struct target_ops *,
CORE_ADDR, LONGEST);
@@ -150,7 +150,7 @@ static int debug_to_remove_watchpoint (s
@@ -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 *,
@ -230,7 +239,14 @@ Index: gdb-7.7.90.20140613/gdb/target.c
static int debug_to_region_ok_for_hw_watchpoint (struct target_ops *self,
CORE_ADDR, LONGEST);
@@ -2959,7 +2959,7 @@ default_region_ok_for_hw_watchpoint (str
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 (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,
@ -239,7 +255,16 @@ Index: gdb-7.7.90.20140613/gdb/target.c
{
return addr >= start && addr < start + length;
}
@@ -3691,8 +3691,8 @@ debug_to_can_accel_watchpoint_condition
@@ -3681,7 +3681,7 @@ debug_to_region_ok_for_hw_watchpoint (st
static int
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;
@@ -3692,8 +3692,8 @@ debug_to_can_accel_watchpoint_condition
fprintf_unfiltered (gdb_stdlog,
"target_can_accel_watchpoint_condition "
@ -250,7 +275,7 @@ Index: gdb-7.7.90.20140613/gdb/target.c
host_address_to_string (cond), (unsigned long) retval);
return retval;
}
@@ -3727,7 +3727,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,
@ -259,7 +284,7 @@ Index: gdb-7.7.90.20140613/gdb/target.c
{
int retval;
@@ -3735,9 +3735,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,
@ -271,10 +296,10 @@ Index: gdb-7.7.90.20140613/gdb/target.c
return retval;
}
Index: gdb-7.7.90.20140613/gdb/target.h
Index: gdb-7.8/gdb/target.h
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/target.h 2014-06-13 22:23:54.683492219 +0200
+++ gdb-7.7.90.20140613/gdb/target.h 2014-06-13 22:25:41.372613039 +0200
--- 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);
@ -284,10 +309,19 @@ Index: gdb-7.7.90.20140613/gdb/target.h
TARGET_DEFAULT_FUNC (default_watchpoint_addr_within_range);
/* Documentation of this routine is provided with the corresponding
Index: gdb-7.7.90.20140613/gdb/aarch64-linux-nat.c
@@ -479,7 +479,7 @@ struct target_ops
TARGET_DEFAULT_FUNC (default_region_ok_for_hw_watchpoint);
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 *,
Index: gdb-7.8/gdb/aarch64-linux-nat.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/aarch64-linux-nat.c 2014-06-13 22:23:09.647440718 +0200
+++ gdb-7.7.90.20140613/gdb/aarch64-linux-nat.c 2014-06-13 22:23:54.683492219 +0200
--- 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,
@ -366,10 +400,10 @@ Index: gdb-7.7.90.20140613/gdb/aarch64-linux-nat.c
{
return start <= addr && start + length - 1 >= addr;
}
Index: gdb-7.7.90.20140613/gdb/target-delegates.c
Index: gdb-7.8/gdb/target-delegates.c
===================================================================
--- gdb-7.7.90.20140613.orig/gdb/target-delegates.c 2014-06-13 22:22:37.917404611 +0200
+++ gdb-7.7.90.20140613/gdb/target-delegates.c 2014-06-13 22:26:06.092640924 +0200
--- 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
}
@ -379,3 +413,20 @@ Index: gdb-7.7.90.20140613/gdb/target-delegates.c
{
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;
}

View File

@ -1,415 +0,0 @@
http://sourceware.org/ml/gdb-patches/2014-07/msg00593.html
Subject: Re: [testsuite patch] Fix paginate-*.exp race for "read1"
Hi Jan,
Thanks for noticing this. It'd be very nice IMO to put that read1
trick in the sources somewhere, to make it easy (easier) to use. Ideally
we'd have a simple Makefile flag to activate it, like 'make check READ1="1"'
or some such, but really just putting the files as attached to the PR, as
is, with absolutely no other glue at all, not even a Makefile, under
gdb/contrib/read1 or some such would already be great. We can always
improve and integrate things more incrementally. WDYT?
On 07/22/2014 06:36 PM, Jan Kratochvil wrote:
> + global saw_continuing
> set saw_continuing 0
> set test "continue to pagination"
> - gdb_test_multiple "$command" $test {
> - -re "$pagination_prompt$" {
> - if {$saw_continuing} {
> - pass $test
> - } else {
> - send_gdb "\n"
> - exp_continue
> - }
> + gdb_test_pagination $command $test {
> + global saw_continuing
> + if {$saw_continuing} {
> + pass $test
> + } else {
> + send_gdb "\n"
> + exp_continue
> }
> + } {
> -re "Continuing" {
> + global saw_continuing
> set saw_continuing 1
The need for these "global"s indicates an issue
with uplevel/upvar in the new procedure.
> exp_continue
> }
> - -notransfer -re "<return>" {
> - # Otherwise gdb_test_multiple considers this an error.
> - exp_continue
> - }
> }
>
> # We're now stopped in a pagination query while handling a
> +proc gdb_test_pagination { command test { code_prompt3 {} } { code_append {} } } {
...
> + append code_append {
...
> + -re "${pagination_prompt3}$" {
> + if { $saw_pagination_prompt != 2 } {
> + fail "$test (3)"
> + }
> + set saw_pagination_prompt 3
> + eval $code_prompt3
The issue is that $code_prompt3 and $code_append should really be
evaluated in this function's caller ...
> + }
> + }
> +
> + set saw_pagination_prompt 0
> + gdb_test_multiple $command $test $code_append
... but gdb_test_multiple evaluates the passed in $code_append
in the context of "uplevel 1" (and likewise it does a couple
upvar's with level one. To make that work, you'd need to
rename gdb_test_multiple to gdb_test_multiple_with_level or
some such, add a 'level' parameter, and pass that as level to
the existing uplevel/upvar calls. Then in gdb_test_pagination
you'd pass in "two levels up", like:
gdb_test_multiple_with_level 2 $command $test $code_append
instead, and likewise gdb_test_multiple would be reimplemented in
terms of gdb_test_multiple_with_level.
But... We don't really need ...
> +# Prevent gdb_test_multiple considering an error -re "<return>" match.
> +# For unknown reason -notransfer -re "<return>" { exp_continue } does not
> +# prevent it.
> +
> +proc gdb_test_pagination { command test { code_prompt3 {} } { code_append {} } } {
> + global pagination_prompt1 pagination_prompt2 pagination_prompt3
> + global gdb_prompt
> +
> + # A regexp that matches the pagination prompt.
> + set pagination_prompt1 "---Type <return"
> + set pagination_prompt2 "> to continue, or q <return"
> + set pagination_prompt3 "> to quit---"
> +
... this, if we instead tackle what IMO is the root of the
issue, and make gdb_test_multiple match the whole pagination
prompt, like in the patch below. I should really have done
this in the first place. :-/
This fixes the races for me, even when stressing them in
parallel mode, as mentioned in the commit log.
Does this fix them for you too?
----------
>From 0c6260e734bdb28272119d50b0150fb777a458ab Mon Sep 17 00:00:00 2001
From: Pedro Alves <palves@redhat.com>
Date: Wed, 23 Jul 2014 17:00:21 +0100
Subject: [PATCH] Fix paginate-*.exp races
Subject: [PATCH] Fix paginate-*.exp races
These testcases have racy results:
gdb.base/double-prompt-target-event-error.exp
gdb.base/paginate-after-ctrl-c-running.exp
gdb.base/paginate-bg-execution.exp
gdb.base/paginate-execution-startup.exp
gdb.base/paginate-inferior-exit.exp
This is easily reproducible with "read1" from:
[reproducer for races of expect incomplete reads]
http://sourceware.org/bugzilla/show_bug.cgi?id=12649
The '-notransfer -re "<return>" { exp_continue }' trick in the current
tests doesn't actually work.
The issue that led to the -notransfer trick was that
"---Type <return> to continue, or q <return> to quit---"
has two "<return>"s. If one wants gdb_test_multiple to not hit the
built-in "<return>" match that results in FAIL, one has to expect the
pagination prompt in chunks, first up to the first "<return>", then
again, up to the second. Something around these lines:
gdb_test_multiple "" $test {
-re "<return>" {
exp_continue
}
-re "to quit ---" {
pass $test
}
}
The intent was for -notransfer+exp_continue to make expect fetch more
input, and rerun the matches against the now potentially fuller
buffer, and then eventually the -re that includes the full pagination
prompt regex would match instead (because it's listed higher up, it
would match first). But, once that "<return>" -notransfer -re
matches, it keeps re-matching forever. It seems like with
exp_continue, expect immediately retries matching, instead of first
reading in more data into the buffer, if available.
Fix this like I should have done in the first place. There's actually
no good reason for gdb_test_multiple to only match "<return>". We can
make gdb_test_multiple expect the whole pagination prompt text
instead, which is store in the 'pagination_prompt' global (similar to
'gdb_prompt'). Then a gdb_test_multiple caller that doesn't want the
default match to trigger, because it wants to see one pagination
prompt, does simply:
gdb_test_multiple "" $test {
-re "$pagination_prompt$" {
pass $test
}
}
which is just like when we don't want the default $gdb_prompt match
within gdb_test_multiple to trigger, like:
gdb_test_multiple "" $test {
-re "$gdb_prompt $" {
pass $test
}
}
Tested on x86_64 Fedora 20. In addition, I've let the racy tests run
all in parallel in a loop for 30 minutes, and they never failed.
gdb/testsuite/
2014-07-24 Pedro Alves <palves@redhat.com>
* gdb.base/double-prompt-target-event-error.exp
(cancel_pagination_in_target_event): Remove '-notransfer <return>'
match.
(cancel_pagination_in_target_event): Rework double prompt
detection.
* gdb.base/paginate-after-ctrl-c-running.exp
(test_ctrlc_while_target_running_paginates): Remove '-notransfer
<return>' match.
* gdb.base/paginate-bg-execution.exp
(test_bg_execution_pagination_return)
(test_bg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-execution-startup.exp
(test_fg_execution_pagination_return)
(test_fg_execution_pagination_cancel): Remove '-notransfer
<return>' matches.
* gdb.base/paginate-inferior-exit.exp
(test_paginate_inferior_exited): Remove '-notransfer <return>'
match.
* lib/gdb-utils.exp (string_to_regexp): Move here from lib/gdb.exp.
* lib/gdb.exp (pagination_prompt): Run text through
string_to_regexp.
(gdb_test_multiple): Match $pagination_prompt instead of
"<return>".
(string_to_regexp): Move to lib/gdb-utils.exp.
---
.../gdb.base/double-prompt-target-event-error.exp | 26 +++++++++++++---------
.../gdb.base/paginate-after-ctrl-c-running.exp | 4 ----
gdb/testsuite/gdb.base/paginate-bg-execution.exp | 9 --------
.../gdb.base/paginate-execution-startup.exp | 8 -------
gdb/testsuite/gdb.base/paginate-inferior-exit.exp | 4 ----
gdb/testsuite/lib/gdb-utils.exp | 9 ++++++++
gdb/testsuite/lib/gdb.exp | 14 +++---------
7 files changed, 28 insertions(+), 46 deletions(-)
diff --git a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
index 5571cdf..84c6c45 100644
--- a/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
+++ b/gdb/testsuite/gdb.base/double-prompt-target-event-error.exp
@@ -75,10 +75,6 @@ proc cancel_pagination_in_target_event { command } {
set saw_continuing 1
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# We're now stopped in a pagination query while handling a
@@ -87,18 +83,28 @@ proc cancel_pagination_in_target_event { command } {
# output.
send_gdb "\003p 1\n"
+ # Note gdb_test_multiple has a default match for the prompt,
+ # which issues a FAIL. Consume the first prompt.
+ set test "first prompt"
+ gdb_test_multiple "" $test {
+ -re "$gdb_prompt" {
+ pass "first prompt"
+ }
+ }
+
+ # We should only see one prompt more, and it should be
+ # preceeded by print's output.
set test "no double prompt"
gdb_test_multiple "" $test {
- -re "$gdb_prompt.*$gdb_prompt.*$gdb_prompt $" {
+ -re "$gdb_prompt.*$gdb_prompt $" {
+ # The bug is present, and expect managed to read
+ # enough characters into the buffer to fill it with
+ # both prompts.
fail $test
}
- -re "$gdb_prompt .* = 1\r\n$gdb_prompt $" {
+ -re " = 1\r\n$gdb_prompt $" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# In case the board file wants to send further commands.
diff --git a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
index 0ed8c92..5898d5b 100644
--- a/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
+++ b/gdb/testsuite/gdb.base/paginate-after-ctrl-c-running.exp
@@ -70,10 +70,6 @@ proc test_ctrlc_while_target_running_paginates {} {
-re "$gdb_prompt $" {
gdb_assert $saw_pagination_prompt $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# Confirm GDB can still process input.
diff --git a/gdb/testsuite/gdb.base/paginate-bg-execution.exp b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
index dcff8ad..116cc2b 100644
--- a/gdb/testsuite/gdb.base/paginate-bg-execution.exp
+++ b/gdb/testsuite/gdb.base/paginate-bg-execution.exp
@@ -51,11 +51,6 @@ proc test_bg_execution_pagination_return {} {
send_gdb "\n"
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an
- # error.
- exp_continue
- }
-re "after sleep\[^\r\n\]+\r\n$" {
gdb_assert $saw_pagination_prompt $test
}
@@ -96,10 +91,6 @@ proc test_bg_execution_pagination_cancel { how } {
-re "$pagination_prompt$" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
set test "cancel pagination"
diff --git a/gdb/testsuite/gdb.base/paginate-execution-startup.exp b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
index dc713ec..1628a0f 100644
--- a/gdb/testsuite/gdb.base/paginate-execution-startup.exp
+++ b/gdb/testsuite/gdb.base/paginate-execution-startup.exp
@@ -111,10 +111,6 @@ proc test_fg_execution_pagination_return {} {
send_gdb "\n"
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
-re "$gdb_prompt $" {
gdb_assert $saw_pagination_prompt $test
}
@@ -154,10 +150,6 @@ proc test_fg_execution_pagination_cancel { how } {
-re "$pagination_prompt$" {
pass $test
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
set test "cancel pagination"
diff --git a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
index 0e37be9..7c63289 100644
--- a/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
+++ b/gdb/testsuite/gdb.base/paginate-inferior-exit.exp
@@ -58,10 +58,6 @@ proc test_paginate_inferior_exited {} {
set saw_starting 1
exp_continue
}
- -notransfer -re "<return>" {
- # Otherwise gdb_test_multiple considers this an error.
- exp_continue
- }
}
# We're now stopped in a pagination output while handling a
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
index 7a00efb..8cb98ae 100644
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -71,7 +71,15 @@ if ![info exists gdb_prompt] then {
}
# A regexp that matches the pagination prompt.
+# Given an input string, adds backslashes as needed to create a
+# regexp that will match the string.
+
+proc string_to_regexp {str} {
+ set result $str
+ regsub -all {[]*+.|()^$\[\\]} $str {\\&} result
+ return $result
+}
-set pagination_prompt "---Type <return> to continue, or q <return> to quit---"
+set pagination_prompt [string_to_regexp "---Type <return> to continue, or q <return> to quit---"]
# The variable fullname_syntax_POSIX is a regexp which matches a POSIX
# absolute path ie. /foo/
@@ -649,7 +649,7 @@ proc gdb_internal_error_resync {} {
#
proc gdb_test_multiple { command message user_code } {
global verbose use_gdb_stub
- global gdb_prompt
+ global gdb_prompt pagination_prompt
global GDB
global inferior_exited_re
upvar timeout timeout
@@ -873,7 +873,7 @@ proc gdb_test_multiple { command message user_code } {
}
set result 1
}
- "<return>" {
+ -re "$pagination_prompt" {
send_gdb "\n"
perror "Window too small."
fail "$message"
@@ -1109,14 +1109,6 @@ proc test_print_reject { args } {
}
}
-# Given an input string, adds backslashes as needed to create a
-# regexp that will match the string.
-
-proc string_to_regexp {str} {
- set result $str
- regsub -all {[]*+.|()^$\[\\]} $str {\\&} result
- return $result
-}
# Same as gdb_test, but the second parameter is not a regexp,
# but a string that must match exactly.
--
1.9.3

View File

@ -65,91 +65,3 @@ index 0e0202d..d849b4c 100644
# gdbserver does not have this issue.
if ![is_remote target] {
setup_kfail "*-*-*" gdb/15934
commit c46269f24eccce534b3cababbf47c6b6b290ed03
Author: Pedro Alves <palves@redhat.com>
Date: Thu Jul 24 16:00:37 2014 +0100
Fix pagination crash when the TUI is active
The TUI currently crashes when the user types <return> in response to
a pagination prompt:
$ gdb --tui ...
*the TUI is now active*
(gdb) set height 2
(gdb) help
List of classes of commands:
Program received signal SIGSEGV, Segmentation fault.
strlen () at ../sysdeps/x86_64/strlen.S:106
106 movdqu (%rax), %xmm12
(top-gdb) bt
#0 strlen () at ../sysdeps/x86_64/strlen.S:106
#1 0x000000000086be5f in xstrdup (s=0x0) at ../src/libiberty/xstrdup.c:33
#2 0x00000000005163f9 in tui_prep_terminal (notused1=1) at ../src/gdb/tui/tui-io.c:296
#3 0x000000000077a7ee in _rl_callback_newline () at ../src/readline/callback.c:82
#4 0x000000000077a853 in rl_callback_handler_install (prompt=0x0, linefunc=0x618b60 <command_line_handler>) at ../src/readline/callback.c:102
#5 0x0000000000718a5c in gdb_readline_wrapper_cleanup (arg=0xfd14d0) at ../src/gdb/top.c:788
#6 0x0000000000596d08 in do_my_cleanups (pmy_chain=0xcf0b38 <cleanup_chain>, old_chain=0x1043d10) at ../src/gdb/cleanups.c:155
#7 0x0000000000596d75 in do_cleanups (old_chain=0x1043d10) at ../src/gdb/cleanups.c:177
#8 0x0000000000718bd9 in gdb_readline_wrapper (prompt=0x7fffffffcfa0 "---Type <return> to continue, or q <return> to quit---")
at ../src/gdb/top.c:835
#9 0x000000000071cf74 in prompt_for_continue () at ../src/gdb/utils.c:1894
#10 0x000000000071d434 in fputs_maybe_filtered (linebuffer=0x1043db0 "List of classes of commands:\n\n", stream=0xf72e20, filter=1)
at ../src/gdb/utils.c:2111
#11 0x000000000071da0f in vfprintf_maybe_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n", args=0x7fffffffd118, filter=1)
at ../src/gdb/utils.c:2339
#12 0x000000000071da4a in vfprintf_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n", args=0x7fffffffd118)
at ../src/gdb/utils.c:2347
#13 0x000000000071dc72 in fprintf_filtered (stream=0xf72e20, format=0x89aef8 "List of classes of %scommands:\n\n") at ../src/gdb/utils.c:2399
#14 0x00000000004f90ab in help_list (list=0xe6d100, cmdtype=0x89ad8c "", class=all_classes, stream=0xf72e20)
at ../src/gdb/cli/cli-decode.c:1038
#15 0x00000000004f8dba in help_cmd (arg=0x0, stream=0xf72e20) at ../src/gdb/cli/cli-decode.c:946
Git 0017922 added:
@@ -776,6 +777,12 @@ gdb_readline_wrapper_cleanup (void *arg)
gdb_assert (input_handler == gdb_readline_wrapper_line);
input_handler = cleanup->handler_orig;
+
+ /* Reinstall INPUT_HANDLER in readline, without displaying a
+ prompt. */
+ if (async_command_editing_p)
+ rl_callback_handler_install (NULL, input_handler);
and tui_prep_terminal simply misses handling the case of a NULL
rl_prompt.
I also checked that readline's sources do similar checks.
gdb/
2014-07-24 Pedro Alves <palves@redhat.com>
* tui/tui-io.c (tui_prep_terminal): Handle NULL rl_prompt.
### a/gdb/ChangeLog
### b/gdb/ChangeLog
## -1,3 +1,7 @@
+2014-07-24 Pedro Alves <palves@redhat.com>
+
+ * tui/tui-io.c (tui_prep_terminal): Handle NULL rl_prompt.
+
2014-07-22 Jan Kratochvil <jan.kratochvil@redhat.com>
* stack.c (read_frame_arg): Verify value_optimized_out before calling
--- a/gdb/tui/tui-io.c
+++ b/gdb/tui/tui-io.c
@@ -293,7 +293,7 @@ tui_prep_terminal (int notused1)
(we can't use gdb_prompt() due to secondary prompts and can't use
rl_prompt because it points to an alloca buffer). */
xfree (tui_rl_saved_prompt);
- tui_rl_saved_prompt = xstrdup (rl_prompt);
+ tui_rl_saved_prompt = rl_prompt != NULL ? xstrdup (rl_prompt) : NULL;
}
/* Readline callback to restore the terminal. It is called once each

View File

@ -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 <jakub@redhat.com>.
+! Modified for the GDB testcase by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
+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 <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
--FCuugMFkClbJLl1L--

View File

@ -18,21 +18,21 @@ Summary: A GNU source-level debugger for C, C++, Fortran, Go and other languages
Name: %{?scl_prefix}gdb
# Freeze it when GDB gets branched
%global snapsrc 20140724
%global snapsrc 20140611
# See timestamp of source gnulib installed into gdb/gnulib/ .
%global snapgnulib 20121213
%global tarname gdb-7.7.91.%{snapsrc}
%global tarname gdb-%{version}
Version: 7.8
# The release always contains a leading reserved number, start it at 1.
# `upstream' is not a part of `name' to stay fully rpm dependencies compatible for the testing.
Release: 14%{?dist}
Release: 15%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and BSD and Public Domain and GFDL
Group: Development/Debuggers
# Do not provide URL for snapshots as the file lasts there only for 2 days.
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.bz2
Source: %{tarname}.tar.bz2
# ftp://sourceware.org/pub/gdb/releases/gdb-%{version}.tar.gz
Source: %{tarname}.tar.gz
Buildroot: %(mktemp -ud %{_tmppath}/%{name}-%{version}-%{release}-XXXXXX)
URL: http://gnu.org/software/gdb/
@ -509,6 +509,7 @@ Patch852: gdb-gnat-dwarf-crash-3of3.patch
Patch887: gdb-archer-vla-tests.patch
Patch888: gdb-vla-intel.patch
Patch912: gdb-vla-intel-04of23-fix.patch
Patch889: gdb-vla-intel-stringbt-fix.patch
# Fix --with-system-readline with readline-6.3 patch 5.
Patch914: gdb-readline-6.3.5.patch
@ -520,8 +521,8 @@ Patch918: gdb-btrobust.patch
Patch920: gdb-python-completer-1of2.patch
Patch921: gdb-python-completer-2of2.patch
# [testsuite] Fix paginate-*.exp race for "read1".
Patch924: gdb-testsuite-pagination-read1.patch
# Display Fortran strings in backtraces.
Patch925: gdb-fortran-frame-string.patch
%if 0%{!?rhel:1} || 0%{?rhel} > 6
# RL_STATE_FEDORA_GDB would not be found for:
@ -699,6 +700,7 @@ find -name "*.info*"|xargs rm -f
%patch232 -p1
%patch888 -p1
%patch912 -p1
%patch889 -p1
%patch1 -p1
%patch105 -p1
@ -801,7 +803,7 @@ find -name "*.info*"|xargs rm -f
%patch918 -p1
%patch920 -p1
%patch921 -p1
%patch924 -p1
%patch925 -p1
%patch848 -p1
%if 0%{!?el6:1}
@ -1292,6 +1294,10 @@ then
fi
%changelog
* Sat Aug 2 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.8-15.fc21
- Rebase to FSF GDB 7.8.
- Display Fortran strings in backtraces.
* Thu Jul 24 2014 Jan Kratochvil <jan.kratochvil@redhat.com> - 7.8-14.fc21
- Rebase to FSF GDB 7.7.91.20140724 (pre-7.8 snapshot).
- Import TUI regression fix (Pedro Alves, BZ 1123003).

View File

@ -1,2 +1,2 @@
4981307aa9619bbec5b73261e4e41c8d gdb-libstdc++-v3-python-r155978.tar.bz2
8d19580f8559ada4e6a3380a822a1451 gdb-7.7.91.20140724.tar.bz2
38d816d641093db2e13ba284e26090b4 gdb-7.8.tar.gz