Merged update from upstream sources

This is an automated DistroBaker update from upstream sources.
If you do not know what this is about or would like to opt out,
contact the OSCI team.

Source: https://src.fedoraproject.org/rpms/gdb.git#d824e7f658857c466b24beb3740fbdf29a27900f
This commit is contained in:
DistroBaker 2021-04-04 23:35:32 +00:00
parent e0c5ec26e5
commit 924c7cd4ea
56 changed files with 744 additions and 410 deletions

View File

@ -413,3 +413,14 @@ Patch101: gdb-rhbz1909902-frame_id_p-assert-1.patch
# Backport patch #2 which fixes a frame_id_p assertion failure (RH BZ 1909902).
Patch102: gdb-rhbz1909902-frame_id_p-assert-2.patch
# Backport change which fixes gdbserver testing hang on f34 and rawhide.
Patch103: gdb-rhbz1941080-fix-gdbserver-hang.patch
# Backport "Disable bracketed paste mode in GDB tests"
# (Tom Tromey)
Patch104: testing-custom-inputrc.patch
# Backport "Handle DW_TAG_type_unit in process_symtab_unit"
# (Tom de Vries)
Patch105: process_psymtab_comp_unit-type-unit.patch

View File

@ -100,3 +100,6 @@
%patch100 -p1
%patch101 -p1
%patch102 -p1
%patch103 -p1
%patch104 -p1
%patch105 -p1

View File

@ -100,3 +100,6 @@ gdb-rhbz1930528-fix-gnulib-build-error.patch
gdb-rhbz1932645-aarch64-ptrace-header-order.patch
gdb-rhbz1909902-frame_id_p-assert-1.patch
gdb-rhbz1909902-frame_id_p-assert-2.patch
gdb-rhbz1941080-fix-gdbserver-hang.patch
testing-custom-inputrc.patch
process_psymtab_comp_unit-type-unit.patch

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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. */
@ -40,19 +40,19 @@ diff --git a/gdb/testsuite/gdb.base/attach-see-vdso.exp b/gdb/testsuite/gdb.base
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-see-vdso.exp
@@ -0,0 +1,72 @@
@@ -0,0 +1,77 @@
+# Copyright 2007
+
+# 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.
@ -64,6 +64,11 @@ new file mode 100644
+ return 0
+}
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile "attach-see-vdso"
+set srcfile ${testfile}.c
+set binfile [standard_output_file ${testfile}]
@ -104,12 +109,12 @@ new file mode 100644
+gdb_test "bt" "#0 *0x\[0-9a-f\]* in \[^?\].*" "backtrace decodes VDSO"
+
+# Exit and detach the process.
+
+
+gdb_exit
+
+# Make sure we don't leave a process around to confuse
+# the next test run (and prevent the compile by keeping
+# the text file busy), in case the "set should_exit" didn't
+# work.
+
+
+remote_exec build "kill -9 ${testpid}"

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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. */
@ -107,7 +107,7 @@ new file mode 100644
+ 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. */
@ -210,7 +210,7 @@ new file mode 100644
+ 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. */
@ -237,15 +237,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test unwinding fixes of the PPC platform, specifically on the coping with BCL
+# jump of the PIE code.

View File

@ -73,15 +73,15 @@ new file mode 100644
+# 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. */
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu

View File

@ -67,7 +67,7 @@ diff --git a/gdb/Makefile.in b/gdb/Makefile.in
+ fi ; \
+ rm -f $(DESTDIR)$(bindir)/$$transformed_name$(EXEEXT) \
+ $(DESTDIR)$(man1dir)/$$transformed_name.1
+
+
# The C++ name parser can be built standalone for testing.
test-cp-name-parser.o: cp-name-parser.c
$(COMPILE) -DTEST_CPNAMES cp-name-parser.c
@ -109,7 +109,7 @@ new file mode 100644
+
+# Run GDB, strip out unwanted noise.
+# --readnever is no longer used since .gdb_index is now in use.
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
+$GDB --quiet -nx $GDBARGS /proc/$1/exe $1 <<EOF 2>&1 |
+set width 0
+set height 0
+set pagination no
@ -153,7 +153,7 @@ new file mode 100644
+ /* Use the most simple notification not to get caught by attach on exiting
+ the function. */
+ write (1, msg, strlen (msg));
+
+
+ for (;;);
+}
+

View File

@ -46,19 +46,19 @@ diff --git a/gdb/testsuite/gdb.base/attach-32.exp b/gdb/testsuite/gdb.base/attac
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/attach-32.exp
@@ -0,0 +1,245 @@
@@ -0,0 +1,246 @@
+# Copyright 2005 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.
@ -72,14 +72,15 @@ new file mode 100644
+#
+# Setting the magic bit in the target app should work. I added a
+# "kill", and also a test for the R3 register warning. JB
+if { ![istarget "x86_64*-*linux*"]
+if { ![istarget "x86_64*-*linux*"]
+ && ![istarget "powerpc64*-*linux*"]} {
+ return 0
+}
+
+# are we on a target board
+if [is_remote target] then {
+ return 0
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile "attach-32"
@ -121,10 +122,10 @@ new file mode 100644
+ global subdir
+ global timeout
+ global testpid
+
+
+ # Verify that we can "see" the variable "should_exit" in the
+ # program, and that it is zero.
+
+
+ gdb_test "print should_exit" " = 0" "after attach-32, print should_exit"
+
+ # Verify that we can modify the variable "should_exit" in the
@ -167,12 +168,12 @@ new file mode 100644
+ # the next test run (and prevent the compile by keeping
+ # the text file busy), in case the "set should_exit" didn't
+ # work.
+
+
+ remote_exec build "kill -9 ${testpid}"
+
+ # Start the program running and then wait for a bit, to be sure
+ # that it can be attached to.
+
+
+ set testpid [eval exec $binfile &]
+ exec sleep 2
+ if { [istarget "*-*-cygwin*"] } {
@ -184,7 +185,7 @@ new file mode 100644
+ # Verify that we can attach to the process, and find its a.out
+ # when we're cd'd to some directory that doesn't contain the
+ # a.out. (We use the source path set by the "dir" command.)
+
+
+ gdb_test "dir ${objdir}/${subdir}" "Source directories searched: .*" \
+ "set source path"
+
@ -217,7 +218,7 @@ new file mode 100644
+ gdb_test "y" "" "$test"
+ }
+ }
+
+
+ # Another "don't leave a process around"
+ remote_exec build "kill -9 ${testpid}"
+}
@ -226,9 +227,9 @@ new file mode 100644
+ global gdb_prompt
+ global binfile2
+ global testpid
+
+
+ # See if other registers are problems
+
+
+ set test "info other register"
+ gdb_test_multiple "i r r3" "$test" {
+ -re "warning: reading register.*$gdb_prompt $" {
@ -240,12 +241,12 @@ new file mode 100644
+ }
+
+ # Get rid of the process
+
+
+ gdb_test "p should_exit = 1"
+ gdb_test "c" {\[Inferior .* exited normally\]}
+
+
+ # Be paranoid
+
+
+ remote_exec build "kill -9 ${testpid}"
+}
+

View File

@ -17,7 +17,7 @@ diff --git a/gdb/testsuite/gdb.cp/b146835.cc b/gdb/testsuite/gdb.cp/b146835.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/b146835.cc
@@ -0,0 +1,32 @@
@@ -0,0 +1,31 @@
+#include "b146835.h"
+#include <iostream>
+
@ -49,7 +49,6 @@ new file mode 100644
+ F f;
+ f.foo();
+}
+
diff --git a/gdb/testsuite/gdb.cp/b146835.exp b/gdb/testsuite/gdb.cp/b146835.exp
new file mode 100644
--- /dev/null
@ -71,7 +70,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can properly print an inherited member variable
+# (Bugzilla 146835)

View File

@ -150,15 +150,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test GDB's handling of gcore for mapping with a name but zero inode.
+

View File

@ -131,7 +131,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can break at multiple forms of constructors.
+
@ -160,7 +160,7 @@ new file mode 100644
+# Break on the various forms of the A::A constructor.
+# " (2 locations)" is displayed depending on G++ version.
+gdb_test "break A\:\:A" "Breakpoint 2 at .*" "breaking on A::A"
+
+
+# Verify that we break for the A constructor two times
+# Once for new A and once for new B
+gdb_continue_to_breakpoint "First line A"

View File

@ -16,7 +16,7 @@ diff --git a/gdb/testsuite/gdb.base/move-dir.c b/gdb/testsuite/gdb.base/move-dir
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.c
@@ -0,0 +1,10 @@
@@ -0,0 +1,9 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include "move-dir.h"
@ -26,7 +26,6 @@ new file mode 100644
+ printf ("%s\n", hw);;
+ other();
+}
+
diff --git a/gdb/testsuite/gdb.base/move-dir.exp b/gdb/testsuite/gdb.base/move-dir.exp
new file mode 100644
--- /dev/null
@ -39,15 +38,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "move-dir"
+set srcfile ${testfile}.c
@ -93,11 +92,10 @@ diff --git a/gdb/testsuite/gdb.base/move-dir.h b/gdb/testsuite/gdb.base/move-dir
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/move-dir.h
@@ -0,0 +1,7 @@
@@ -0,0 +1,6 @@
+#include <stdlib.h>
+
+void other() {
+ const char* ostring = "other";
+ printf ("%s\n", ostring);;
+}
+

View File

@ -42,12 +42,12 @@ new file mode 100644
+# 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. */
@ -126,7 +126,7 @@ new file mode 100644
+ -re "Attaching to.*, process .*couldn't open /proc file.*$gdb_prompt $"\
+ {
+ # Response expected from /proc-based systems.
+ pass "attach to nonsense is prohibited"
+ pass "attach to nonsense is prohibited"
+ }
+ -re "Attaching to.*$gdb_prompt $"\
+ {fail "attach to nonsense is prohibited (bogus pid allowed)"}
@ -186,13 +186,13 @@ new file mode 100644
+ -re "Load new symbol table from.*y or n.*$" {
+ send_gdb "y\n"
+ gdb_expect {
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $"\
+ {pass "(re)set file, before attach1"}
+ -re "$gdb_prompt $" {fail "(re)set file, before attach1"}
+ timeout {fail "(timeout) (re)set file, before attach1"}
+ }
+ }
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $"\
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $"\
+ {pass "set file, before attach1"}
+ -re "$gdb_prompt $" {fail "set file, before attach1"}
+ timeout {fail "(timeout) set file, before attach1"}
@ -236,11 +236,11 @@ new file mode 100644
+ # is really getting the executable file without our help.)
+ #
+ set old_timeout $timeout
+ set timeout 15
+ set timeout 15
+ send_gdb "file\n"
+ gdb_expect {
+ -re ".*gdb internal error.*$" {
+ fail "Internal error, prob. Memory corruption"
+ -re ".*gdb internal error.*$" {
+ fail "Internal error, prob. Memory corruption"
+ }
+ -re "No executable file now.*Discard symbol table.*y or n.*$" {
+ send_gdb "y\n"
@ -424,7 +424,7 @@ new file mode 100644
+ #
+ gdb_test "p should_exit = 1" ".*"
+ gdb_test "c" {\[Inferior .* exited normally\]}
+
+
+ # Be paranoid
+ #
+ remote_exec build "kill -9 ${testpid}"
@ -500,7 +500,7 @@ new file mode 100644
+ 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.
@ -645,15 +645,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
@ -958,7 +958,7 @@ new file mode 100644
+
+send_gdb "catch\n"
+gdb_expect {
+ -re "Catch requires an event name.*$gdb_prompt $"\
+ -re "List of catch subcommands:.*$gdb_prompt $"\
+ {pass "catch requires an event name"}
+ -re "$gdb_prompt $"\
+ {fail "catch requires an event name"}
@ -1291,7 +1291,7 @@ new file mode 100644
+
+# Verify that GDB responds gracefully to a request to "finish" from
+# the outermost frame. On a stub that never exits, this will just
+# run to the stubs routine, so we don't get this error... Thus the
+# run to the stubs routine, so we don't get this error... Thus the
+# second condition.
+#
+
@ -1377,7 +1377,7 @@ new file mode 100644
+# Test "next" over recursive function call.
+#
+
+proc test_next_with_recursion {} {
+proc test_next_with_recursion {} {
+ global gdb_prompt
+ global decimal
+ global binfile
@ -1555,7 +1555,7 @@ new file mode 100644
+#
+# Add a second pass pattern. The behavior differs here between stabs
+# and dwarf for one-line functions. Stabs preserves two line symbols
+# (one before the prologue and one after) with the same line number,
+# (one before the prologue and one after) with the same line number,
+# but dwarf regards these as duplicates and discards one of them.
+# Therefore the address after the prologue (where the breakpoint is)
+# has no exactly matching line symbol, and GDB reports the breakpoint
@ -1610,7 +1610,7 @@ new file mode 100644
+ 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.
@ -1625,7 +1625,7 @@ new file mode 100644
+ simply as places to try setting breakpoints at. They are
+ explicitly "one-line functions" to verify that this case works
+ (some versions of gcc have or have had problems with this).
+
+
+ These functions are in a separate source file to prevent an
+ optimizing compiler from inlining them and optimizing them away. */
+
@ -1644,7 +1644,7 @@ diff --git a/gdb/testsuite/gdb.pie/corefile.exp b/gdb/testsuite/gdb.pie/corefile
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/corefile.exp
@@ -0,0 +1,233 @@
@@ -0,0 +1,232 @@
+# Copyright 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000
+# Free Software Foundation, Inc.
+
@ -1652,15 +1652,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Fred Fish. (fnf@cygnus.com)
+
@ -1730,11 +1730,10 @@ new file mode 100644
+ }
+}
+
+# Try to clean up after ourselves.
+remote_file build delete [file join $coredir coremmap.data]
+remote_exec build "rmdir $coredir"
+
+if { $found == 0 } {
+ # Try to clean up after ourselves.
+ remote_file build delete [file join $coredir coremmap.data]
+ remote_exec build "rmdir $coredir"
+ warning "can't generate a core file - core tests suppressed - check ulimit -c"
+ return 0
+}
@ -1751,19 +1750,19 @@ new file mode 100644
+# **FIXME**
+#
+# Another problem is that on some systems (solaris for example), there
+# is apparently a limit on the length of a fully specified path to
+# is apparently a limit on the length of a fully specified path to
+# the coremaker executable, at about 80 chars. For this case, consider
+# it a pass, but note that the program name is bad.
+
+gdb_exit
+if $verbose>1 then {
+ send_user "Spawning $GDB -nw $GDBFLAGS -core=[standard_output_file corefile]\n"
+ send_user "Spawning $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS -core=[standard_output_file corefile]\n"
+}
+
+set oldtimeout $timeout
+set timeout [expr "$timeout + 60"]
+verbose "Timeout is now $timeout seconds" 2
+eval "spawn $GDB -nw $GDBFLAGS -core=[standard_output_file corefile]"
+eval "spawn $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS -core=[standard_output_file corefile]"
+expect {
+ -re "Couldn't find .* registers in core file.*$gdb_prompt $" {
+ fail "args: -core=corefile (couldn't find regs)"
@ -1790,11 +1789,11 @@ new file mode 100644
+close;
+
+if $verbose>1 then {
+ send_user "Spawning $GDB -nw $GDBFLAGS $binfile -core=[standard_output_file corefile]\n"
+ send_user "Spawning $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=[standard_output_file corefile]\n"
+}
+
+
+eval "spawn $GDB -nw $GDBFLAGS $binfile -core=[standard_output_file corefile]";
+eval "spawn $GDB -nw $INTERNAL_GDBFLAGS $GDBFLAGS $binfile -core=[standard_output_file corefile]";
+expect {
+ -re "Core was generated by .*coremaker.*\r\n\#0 .*\(\).*\r\n$gdb_prompt $" {
+ pass "args: execfile -core=corefile"
@ -1882,7 +1881,7 @@ diff --git a/gdb/testsuite/gdb.pie/coremaker.c b/gdb/testsuite/gdb.pie/coremaker
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pie/coremaker.c
@@ -0,0 +1,142 @@
@@ -0,0 +1,141 @@
+/* Copyright 1992, 1993, 1994, 1995, 1996, 1999
+ Free Software Foundation, Inc.
+
@ -2024,4 +2023,3 @@ new file mode 100644
+ func1 ();
+ return 0;
+}
+

View File

@ -54,7 +54,7 @@ diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.c b/gdb/testsuite/g
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/watchthreads-threaded.c
@@ -0,0 +1,66 @@
@@ -0,0 +1,65 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2002, 2003, 2004, 2005 Free Software Foundation, Inc.
@ -72,8 +72,8 @@ new file mode 100644
+ 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.
+
+ Boston, MA 02111-1307, USA.
+
+ This file is copied from schedlock.c. */
+
+#include <stdio.h>
@ -120,7 +120,6 @@ new file mode 100644
+
+ pthread_exit(NULL);
+}
+
diff --git a/gdb/testsuite/gdb.threads/watchthreads-threaded.exp b/gdb/testsuite/gdb.threads/watchthreads-threaded.exp
new file mode 100644
--- /dev/null
@ -142,7 +141,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Check that GDB can support multiple watchpoints across threads.
+
@ -213,9 +212,9 @@ new file mode 100644
+ { set args_2 1; set test_flag 1 }
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = 0.*New value = 1.*main \\\(\\\) at .*watchthreads-threaded.c:$init_line.*$gdb_prompt $"
+ { set args_3 1; set test_flag 1 }
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*in thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ -re "Hardware watchpoint 3: args\\\[2\\\].*Old value = $args_2.*New value = [expr $args_2+1].*thread_function \\\(arg=0x2\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ { set args_2 [expr $args_2+1]; set test_flag 1 }
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*in thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ -re "Hardware watchpoint 4: args\\\[3\\\].*Old value = $args_3.*New value = [expr $args_3+1].*thread_function \\\(arg=0x3\\\) at .*watchthreads-threaded.c:$inc_line.*$gdb_prompt $"
+ { set args_3 [expr $args_3+1]; set test_flag 1 }
+ }
+ # If we fail above, don't bother continuing loop
@ -232,7 +231,7 @@ new file mode 100644
+# Verify that we hit first watchpoint in child thread.
+set message "watchpoint on args\[2\] hit in thread"
+if { $args_2 > 1 } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+}
@ -240,15 +239,15 @@ new file mode 100644
+# Verify that we hit second watchpoint in child thread.
+set message "watchpoint on args\[3\] hit in thread"
+if { $args_3 > 1 } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+ fail $message
+}
+
+# Verify that all watchpoint hits are accounted for.
+set message "combination of threaded watchpoints = 30 + initial values"
+if { [expr $args_2+$args_3] == [expr [expr 30+$init_args_2]+$init_args_3] } {
+ pass $message
+ pass $message
+} else {
+ fail $message
+ fail $message
+}

View File

@ -30,14 +30,14 @@ new file mode 100644
+ * gdb. Inside gdb, you should be able to do something like this:
+ *
+ * (gdb) t a a bt
+ *
+ *
+ * Thread 7 (process 4352):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
+ * #2 0x080488a2 in makeSyscall (ignored=0x0) at threadcrash.c:118
+ * #3 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #4 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 6 (process 4353):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
@ -48,7 +48,7 @@ new file mode 100644
+ * #5 0x08048a51 in makeSyscallFromSighandler (ignored=0x0) at threadcrash.c:204
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 5 (process 4354):
+ * #0 0x001ba7dc in __nanosleep_nocancel () from /lib/tls/libc.so.6
+ * #1 0x001ba5ff in sleep () from /lib/tls/libc.so.6
@ -59,12 +59,12 @@ new file mode 100644
+ * #5 0x080489e2 in makeSyscallFromAltSighandler (ignored=0x0) at threadcrash.c:190
+ * #6 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #7 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 4 (process 4355):
+ * #0 spin (ignored=0x0) at threadcrash.c:242
+ * #1 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #2 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 3 (process 4356):
+ * #0 spinningSighandler (signo=12, info=0xb4de46f0, context=0xb4de4770) at threadcrash.c:180
+ * #1 <signal handler called>
@ -72,7 +72,7 @@ new file mode 100644
+ * #3 0x08048b2f in spinFromSighandler (ignored=0x0) at threadcrash.c:232
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 2 (process 4357):
+ * #0 spinningAltSighandler (signo=14, info=0x959ee50, context=0x959eed0) at threadcrash.c:156
+ * #1 <signal handler called>
@ -80,7 +80,7 @@ new file mode 100644
+ * #3 0x08048ac0 in spinFromAltSighandler (ignored=0x0) at threadcrash.c:218
+ * #4 0x006aadec in start_thread () from /lib/tls/libpthread.so.0
+ * #5 0x001ed19a in clone () from /lib/tls/libc.so.6
+ *
+ *
+ * Thread 1 (process 4351):
+ * #0 0x08048cf3 in main (argc=1, argv=0xbfff9d74) at threadcrash.c:273
+ * (gdb)
@ -107,11 +107,11 @@ new file mode 100644
+ int result;
+ stack_t altstack;
+ stack_t oldaltstack;
+
+
+ memset(&action, 0, sizeof(action));
+ memset(&altstack, 0, sizeof(altstack));
+ memset(&oldaltstack, 0, sizeof(oldaltstack));
+
+
+ if (onAltstack) {
+ altstack.ss_sp = malloc(SIGSTKSZ);
+ assert(altstack.ss_sp != NULL);
@ -121,9 +121,9 @@ new file mode 100644
+ assert(result == 0);
+ assert(oldaltstack.ss_flags == SS_DISABLE);
+ }
+
+
+ sigemptyset(&sigset);
+
+
+ action.sa_handler = NULL;
+ action.sa_sigaction = handler;
+ action.sa_mask = sigset;
@ -131,7 +131,7 @@ new file mode 100644
+ if (onAltstack) {
+ action.sa_flags |= SA_ONSTACK;
+ }
+
+
+ result = sigaction(signo, &action, NULL);
+ assert(result == 0);
+}
@ -157,10 +157,10 @@ new file mode 100644
+static int onAltstack(void) {
+ stack_t stack;
+ int result;
+
+
+ result = sigaltstack(NULL, &stack);
+ assert(result == 0);
+
+
+ return stack.ss_flags & SS_ONSTACK;
+}
+
@ -168,11 +168,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (!onAltstack()) {
+ printf("%s() not running on altstack!\n", __FUNCTION__);
+ }
+
+
+ sleep(42);
+}
+
@ -180,11 +180,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (!onAltstack()) {
+ printf("%s() not running on altstack!\n", __FUNCTION__);
+ }
+
+
+ while (1);
+}
+
@ -192,11 +192,11 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (onAltstack()) {
+ printf("%s() running on altstack!\n", __FUNCTION__);
+ }
+
+
+ sleep(42);
+}
+
@ -204,73 +204,73 @@ new file mode 100644
+ (void)signo;
+ (void)info;
+ (void)context;
+
+
+ if (onAltstack()) {
+ printf("%s() running on altstack!\n", __FUNCTION__);
+ }
+
+
+ while (1);
+}
+
+static void *makeSyscallFromAltSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installAlthandler(SIGSYSCALL_ALT, syscallingAltSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSYSCALL_ALT);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *makeSyscallFromSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installNormalHandler(SIGSYSCALL, syscallingSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSYSCALL);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spinFromAltSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installAlthandler(SIGSPIN_ALT, spinningAltSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSPIN_ALT);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spinFromSighandler(void *ignored) {
+ (void)ignored;
+
+
+ int result;
+
+
+ installNormalHandler(SIGSPIN, spinningSighandler);
+
+
+ result = pthread_kill(pthread_self(), SIGSPIN);
+ assert(result == 0);
+
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
+ return NULL;
+}
+
+static void *spin(void *ignored) {
+ (void)ignored;
+
+
+ while (1);
+
+ fprintf(stderr, "%s: returning\n", __FUNCTION__);
@ -281,7 +281,7 @@ new file mode 100644
+ int result;
+ pthread_t thread;
+ volatile int bad;
+
+
+ result = pthread_create(&thread, NULL, makeSyscall, NULL);
+ assert(result == 0);
+ result = pthread_create(&thread, NULL, makeSyscallFromSighandler, NULL);
@ -294,10 +294,10 @@ new file mode 100644
+ assert(result == 0);
+ result = pthread_create(&thread, NULL, spinFromAltSighandler, NULL);
+ assert(result == 0);
+
+
+ // Give threads some time to get going
+ sleep(3);
+
+
+ // Crash
+ bad = *(int*)7;
+
@ -309,7 +309,7 @@ new file mode 100644
+ Keep it late to ensure persistency in the registers. */
+ bad = (int) argc;
+ bad = (unsigned long) argv;
+
+
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.threads/threadcrash.exp b/gdb/testsuite/gdb.threads/threadcrash.exp
@ -480,27 +480,27 @@ new file mode 100644
+# Verify that $LOG contains all information we want
+function verifyLog() {
+ local FAILURES=0
+
+
+ mustNotHave '??' || ((FAILURES++))
+ mustHaveCorrectAmount 11 threadcrash.c: || ((FAILURES++))
+
+
+ mustHaveSevenThreads || ((FAILURES++))
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
+
+ return $FAILURES
@ -577,7 +577,7 @@ new file mode 100644
+ fail
+ fi
+ pass
+
+
+ # Verify that we got a core file from gcore
+ set_test gdb gcore did not create a core file
+ if [ ! -r core* ] ; then
@ -762,27 +762,27 @@ new file mode 100644
+# Verify that $LOG contains all information we want
+function verifyLog() {
+ local FAILURES=0
+
+
+ mustNotHave '??' || ((FAILURES++))
+ mustHaveCorrectAmount 12 threadcrash.c: || ((FAILURES++))
+
+
+ mustHaveSevenThreads || ((FAILURES++))
+ mustHaveSequence sleep "makeSyscall (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence sleep "syscallingAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "makeSyscallFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "spin (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence "spinningAltSighandler (signo=" "signal handler called" 0x || ((FAILURES++))
+ mustHaveSequence pthread_kill "spinFromAltSighandler (ignored=" || ((FAILURES++))
+
+
+ mustHaveSequence Thread "main (argc=1, argv=" || ((FAILURES++))
+
+ return $FAILURES
@ -844,7 +844,7 @@ new file mode 100644
+ ((FAILURES++))
+ echo >> /dev/stderr WARNING: gdb exited with error code $EXITCODE when creating gcore file
+ fi
+
+
+ # Verify that we got a core file from gcore
+ if [ ! -r core* ] ; then
+ echo >> /dev/stderr ERROR: gdb gcore did not create a core file

View File

@ -42,7 +42,7 @@ new file mode 100644
+ 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,
@ -66,12 +66,12 @@ new file mode 100644
+# 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.
@ -86,7 +86,7 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-included"
@ -125,7 +125,7 @@ new file mode 100644
+ 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,

View File

@ -26,7 +26,7 @@ new file mode 100644
+ 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.
@ -45,22 +45,27 @@ diff --git a/gdb/testsuite/gdb.base/step-over-trampoline.exp b/gdb/testsuite/gdb
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/step-over-trampoline.exp
@@ -0,0 +1,54 @@
@@ -0,0 +1,59 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+if $tracelevel then {
+ strace $tracelevel

View File

@ -10,26 +10,27 @@ diff --git a/gdb/testsuite/gdb.base/tracefork-zombie.exp b/gdb/testsuite/gdb.bas
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/tracefork-zombie.exp
@@ -0,0 +1,75 @@
@@ -0,0 +1,76 @@
+# 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. */
+
+# are we on a target board
+if [is_remote target] then {
+ return 0
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+# Start the program running and then wait for a bit, to be sure

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -40,7 +40,7 @@ new file mode 100644
+int main()
+{
+ void *mem;
+
+
+ mem = malloc (MEGS * 1024ULL * 1024ULL);
+
+ for (;;)
@ -52,22 +52,27 @@ diff --git a/gdb/testsuite/gdb.base/gcore-excessive-memory.exp b/gdb/testsuite/g
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gcore-excessive-memory.exp
@@ -0,0 +1,94 @@
@@ -0,0 +1,99 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile gcore-excessive-memory
+set srcfile ${testfile}.c

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -44,22 +44,27 @@ diff --git a/gdb/testsuite/gdb.base/unwind-leak.exp b/gdb/testsuite/gdb.base/unw
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/unwind-leak.exp
@@ -0,0 +1,83 @@
@@ -0,0 +1,88 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile unwind-leak
+set srcfile ${testfile}.c
@ -104,7 +109,7 @@ new file mode 100644
+verbose -log "cycles = $cycles, permit_kb = $permit_kb"
+
+set fail 0
+set test "breakpoint stop/continue cycles"
+set test "breakpoint stop/continue cycles"
+for {set i $cycles} {$i > 0} {set i [expr {$i - 1}]} {
+ gdb_test_multiple "continue" $test {
+ -re "Breakpoint 2, main .*alarm .*.*${gdb_prompt} $" {

View File

@ -17,15 +17,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if $tracelevel then {
+ strace $tracelevel

View File

@ -27,7 +27,7 @@ new file mode 100644
+ 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.
@ -55,15 +55,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile watchpoint-during-step
+set srcfile ${testfile}.c

View File

@ -12,22 +12,22 @@ diff --git a/gdb/testsuite/gdb.base/readline-overflow.exp b/gdb/testsuite/gdb.ba
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/readline-overflow.exp
@@ -0,0 +1,104 @@
@@ -0,0 +1,96 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu
@ -46,20 +46,12 @@ new file mode 100644
+
+global env
+
+save_vars { env(INPUTRC) env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
+save_vars { env(GDBHISTFILE) env(HISTSIZE) TERM timeout } {
+ # The arrow key test relies on the standard VT100 bindings, so
+ # make sure that an appropriate terminal is selected. The same
+ # bug doesn't show up if we use ^P / ^N instead.
+ setenv TERM vt100
+
+ # Don't let a .inputrc file or an existing setting of INPUTRC mess up
+ # the test results. Even if /dev/null doesn't exist on the particular
+ # platform, the readline library will use the default setting just by
+ # failing to open the file. OTOH, opening /dev/null successfully will
+ # also result in the default settings being used since nothing will be
+ # read from this file.
+ set env(INPUTRC) "/dev/null"
+
+ set timeout 600
+
+ set env(GDBHISTFILE) "${srcdir}/${subdir}/gdb_history"

View File

@ -24,7 +24,7 @@ new file mode 100644
+ 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.
@ -51,7 +51,7 @@ new file mode 100644
+ 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.
@ -68,22 +68,27 @@ diff --git a/gdb/testsuite/gdb.base/datalib.exp b/gdb/testsuite/gdb.base/datalib
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/datalib.exp
@@ -0,0 +1,51 @@
@@ -0,0 +1,56 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile datalib
+set srcfilemain ${testfile}-main.c

View File

@ -33,7 +33,7 @@ diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-main.c b/gdb/testsuite/gdb.t
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug-main.c
@@ -0,0 +1,25 @@
@@ -0,0 +1,31 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2006 Free Software Foundation, Inc.
@ -47,7 +47,7 @@ new file mode 100644
+ 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.
@ -55,9 +55,15 @@ new file mode 100644
+ Please email any bugs, comments, and/or additions to this file to:
+ bug-gdb@prep.ai.mit.edu */
+
+#include <pthread.h>
+
+extern __thread int var;
+
+int main()
+{
+ return 0;
+ /* Ensure we link against pthreads even with --as-needed. */
+ pthread_testcancel();
+ return var;
+}
diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c b/gdb/testsuite/gdb.threads/tls-sepdebug-shared.c
new file mode 100644
@ -77,7 +83,7 @@ new file mode 100644
+ 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.
@ -90,22 +96,29 @@ diff --git a/gdb/testsuite/gdb.threads/tls-sepdebug.exp b/gdb/testsuite/gdb.thre
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.threads/tls-sepdebug.exp
@@ -0,0 +1,87 @@
@@ -0,0 +1,94 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This test uses gdb_exit and gdb_start, which are not supported
+# on non-extended-remote sessions.
+if {[use_gdb_stub]} {
+ untested "skipping test because of stub"
+ return 0
+}
+
+if $tracelevel then {
+ strace $tracelevel
@ -158,22 +171,22 @@ new file mode 100644
+ gdb_exit
+ gdb_start
+ ###gdb_reinitialize_dir $srcdir/$subdir
+
+
+ gdb_test "set env LD_LIBRARY_PATH=$ld_library_path" \
+ "" \
+ "set env LD_LIBRARY_PATH is $name"
+
+
+ gdb_load ${binmainfile}
+
+
+ # For C programs, "start" should stop in main().
+
+
+ gdb_test "start" \
+ "main \\(\\) at .*${srcmainfile}.*" \
+ "start"
+
+
+ # Check for: Cannot find shared library `/usr/lib/debug/lib/libc-2.4.90.so.debug' in dynamic linker's load module list
+ # as happens with TLS variables and `separate_debug_objfile_backlink'.
+
+
+ gdb_test "print var" \
+ "\\\$1 = \[0-9\].*" \
+ "print TLS variable from a shared library with $name-directory separate debug info file"

View File

@ -14,7 +14,7 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*-
+# serial 1 (pkg-config-0.24)
+#
+#
+# Copyright © 2004 Scott James Remnant <scott@netsplit.com>.
+#
+# This program is free software; you can redistribute it and/or modify
@ -133,11 +133,11 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+See the pkg-config man page for more details.])
+
+if test $pkg_failed = yes; then
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
+ _PKG_SHORT_ERRORS_SUPPORTED
+ if test $_pkg_short_errors_supported = yes; then
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --short-errors --print-errors --cflags --libs "$2" 2>&1`
+ else
+ else
+ $1[]_PKG_ERRORS=`$PKG_CONFIG --print-errors --cflags --libs "$2" 2>&1`
+ fi
+ # Put the nasty error message in config.log where it belongs
@ -154,7 +154,7 @@ diff --git a/gdb/aclocal.m4 b/gdb/aclocal.m4
+_PKG_TEXT])[]dnl
+ ])
+elif test $pkg_failed = untried; then
+ AC_MSG_RESULT([no])
+ AC_MSG_RESULT([no])
+ m4_default([$4], [AC_MSG_FAILURE(
+[The pkg-config script could not be found or is too old. Make sure it
+is in your PATH or set the PKG_CONFIG environment variable to the full
@ -336,7 +336,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ /* Already failed the initialization before? */
+ if (init_tried)
+ return 0;
+ return 0;
+ init_tried = 1;
+
+#ifdef DLOPEN_LIBRPM
@ -1148,7 +1148,7 @@ diff --git a/gdb/configure b/gdb/configure
+
+
+if test $pkg_failed = yes; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+
+if $PKG_CONFIG --atleast-pkgconfig-version 0.20; then
@ -1166,7 +1166,7 @@ diff --git a/gdb/configure b/gdb/configure
+
+ HAVE_LIBRPM=false
+elif test $pkg_failed = untried; then
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+ HAVE_LIBRPM=false
+else
@ -1450,7 +1450,7 @@ diff --git a/gdb/configure.ac b/gdb/configure.ac
+ fi
+ fi
+fi
+
+
AC_CONFIG_SUBDIRS(testsuite)
# Check whether to support alternative target configurations

View File

@ -540,18 +540,18 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+ /* There can be multiple build-id symlinks pointing to real files
+ with the same build-id (such as hard links). Some of the real
+ files may not be installed. */
+
+ string_appendf (link, ".%u", seqno);
+ }
- /* We expect to be silent on the non-existing files. */
- gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget);
+ string_appendf (link, ".%u", seqno);
+ }
+ ret_link = link;
- if (debug_bfd == NULL)
- {
- if (separate_debug_file_debug)
- printf_unfiltered (_(" no, unable to open.\n"));
+ ret_link = link;
+
+ struct stat statbuf_trash;
+
+ /* `access' automatically dereferences LINK. */
@ -574,11 +574,11 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+
+ continue;
+ }
- return {};
+
+ /* We expect to be silent on the non-existing files. */
+ gdb_bfd_ref_ptr debug_bfd = gdb_bfd_open (filename.get (), gnutarget, -1);
+
- return {};
+ if (debug_bfd == NULL)
+ {
+ if (separate_debug_file_debug)
@ -699,7 +699,7 @@ diff --git a/gdb/build-id.c b/gdb/build-id.c
+{
+ gdb_bfd_ref_ptr abfd;
+ char *result;
+
+
+ abfd = build_id_to_exec_bfd (build_id->size, build_id->data, link_return);
+ if (abfd == NULL)
+ return NULL;
@ -1361,6 +1361,19 @@ diff --git a/gdb/testsuite/gdb.base/corefile.exp b/gdb/testsuite/gdb.base/corefi
+ gdb_test "info files" "Local exec file:\r\n\[ \t\]*`[string_to_regexp $debugdir/$buildid]', file type .*"
+ pass $wholetest
+}
diff --git a/gdb/testsuite/gdb.base/gdbinit-history.exp b/gdb/testsuite/gdb.base/gdbinit-history.exp
--- a/gdb/testsuite/gdb.base/gdbinit-history.exp
+++ b/gdb/testsuite/gdb.base/gdbinit-history.exp
@@ -181,7 +181,8 @@ proc test_empty_history_filename { } {
global env
global gdb_prompt
- set common_history [list "set height 0" "set width 0"]
+ set common_history [list "set height 0" "set width 0" \
+ "set build-id-verbose 0"]
set test_dir [standard_output_file history_test]
remote_exec host "mkdir -p $test_dir"
diff --git a/gdb/testsuite/gdb.base/new-ui-pending-input.exp b/gdb/testsuite/gdb.base/new-ui-pending-input.exp
--- a/gdb/testsuite/gdb.base/new-ui-pending-input.exp
+++ b/gdb/testsuite/gdb.base/new-ui-pending-input.exp

View File

@ -79,15 +79,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Please email any bugs, comments, and/or additions to this file to:
+# bug-gdb@prep.ai.mit.edu

View File

@ -31,7 +31,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test PowerPC Power6 instructions disassembly.
+

View File

@ -29,7 +29,7 @@ new file mode 100644
+ 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., 51 Franklin Street, Fifth Floor, Boston,
@ -202,12 +202,12 @@ new file mode 100644
+# 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. */

View File

@ -36,7 +36,7 @@ new file mode 100644
+ 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.
@ -71,15 +71,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile charsign
+set srcfile ${testfile}.c

View File

@ -175,7 +175,7 @@ diff --git a/gdb/testsuite/gdb.threads/threaded-exec.exp b/gdb/testsuite/gdb.thr
+gdb_load ${binfile_nothreads}
-gdb_run_cmd
+gdb_run_cmd ${binfile_nothreads} ${binfile_threads} 0
+gdb_run_cmd [list ${binfile_nothreads} ${binfile_threads} 0]
gdb_test_multiple {} "Program exited" {
-re "\r\n\\\[Inferior .* exited normally\\\]\r\n$gdb_prompt $" {

View File

@ -383,12 +383,12 @@ new file mode 100644
+# 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.
@ -402,7 +402,7 @@ new file mode 100644
+ && ![istarget *-*-elf*]
+ && ![istarget *-*-openbsd*])
+ || (![istarget "i?86-*-*"] && ![istarget "x86_64-*-*"])} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-loclist-prelinked"

View File

@ -80,7 +80,7 @@ new file mode 100644
+ # gdb.arch/x86_64-vla-pointer.c:27
+ .loc 1 27 0
+ movl $0, -20(%rbp)
+# SUCC: 4 [100.0%]
+# SUCC: 4 [100.0%]
+ jmp .L2
+# BLOCK 3 seq:1
+# PRED: 4
@ -98,7 +98,7 @@ new file mode 100644
+ .loc 1 27 0 discriminator 3
+ addl $1, -20(%rbp)
+# BLOCK 4 seq:2
+# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%]
+# PRED: 3 (FALLTHRU,DFS_BACK) 2 [100.0%]
+.L2:
+ # gdb.arch/x86_64-vla-pointer.c:27
+ .loc 1 27 0 is_stmt 0 discriminator 1
@ -119,7 +119,7 @@ new file mode 100644
+ movq -8(%rbp), %rbx
+ leave
+ .cfi_def_cfa 7, 8
+# SUCC: EXIT [100.0%]
+# SUCC: EXIT [100.0%]
+ ret
+ .cfi_endproc
+.LFE0:
@ -1531,7 +1531,7 @@ diff --git a/gdb/testsuite/gdb.cp/gdb9593.cc b/gdb/testsuite/gdb.cp/gdb9593.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/gdb9593.cc
@@ -0,0 +1,180 @@
@@ -0,0 +1,179 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2008, 2009 Free Software Foundation, Inc.
@ -1560,27 +1560,27 @@ new file mode 100644
+
+
+ // Single throw an exception in this function.
+ void function1()
+ void function1()
+ {
+ throw 20;
+ }
+
+ // Throw an exception in another function.
+ void function2()
+ void function2()
+ {
+ function1();
+ }
+
+ // Throw an exception in another function, but handle it
+ // locally.
+ void function3 ()
+ void function3 ()
+ {
+ {
+ try
+ {
+ function1 ();
+ }
+ catch (...)
+ catch (...)
+ {
+ cout << "Caught and handled function1 exception" << endl;
+ }
@ -1623,8 +1623,8 @@ new file mode 100644
+NextOverThrowDerivates next_cases;
+
+
+int main ()
+{
+int main ()
+{
+ try
+ {
+ next_cases.function1 ();
@ -1711,12 +1711,11 @@ new file mode 100644
+ {
+ }
+}
+
diff --git a/gdb/testsuite/gdb.cp/gdb9593.exp b/gdb/testsuite/gdb.cp/gdb9593.exp
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/gdb9593.exp
@@ -0,0 +1,182 @@
@@ -0,0 +1,189 @@
+# Copyright 2008, 2009 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -1771,7 +1770,7 @@ new file mode 100644
+if ![runto_main] then {
+ perror "couldn't run to main"
+ continue
+}
+}
+
+# See whether we have the needed unwinder hooks.
+set ok 1
@ -1860,9 +1859,16 @@ new file mode 100644
+ ".*function1 ().*" \
+ "step into finish, for until"
+
+gdb_test "until" \
+ ".*function1 ().*" \
+ "until with no argument 1"
+gdb_test_multiple "until" "until with no argument 1" {
+ -re -wrap ".*function1 ().*" {
+ pass $gdb_test_name
+ }
+ -re -wrap ".*$hex\t80\t \}" {
+ # PR gcc/97774 - "Incorrect line info for try/catch"
+ # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=97774
+ xfail $gdb_test_name
+ }
+}
+
+set line [gdb_get_line_number "marker for until" $testfile.cc]
+
@ -2239,7 +2245,7 @@ new file mode 100644
+ 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,
@ -2272,19 +2278,19 @@ diff --git a/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp b/gdb/testsuite/gdb.dwarf
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.dwarf2/dw2-stripped.exp
@@ -0,0 +1,79 @@
@@ -0,0 +1,84 @@
+# 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.
@ -2299,7 +2305,12 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+if {[use_gdb_stub]} {
+ untested "skipping test because of use_gdb_stub"
+ return -1
+}
+
+set testfile "dw2-stripped"
@ -2468,7 +2479,7 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-struct-member-data-location"
@ -2636,7 +2647,7 @@ new file mode 100644
+
+# This test can only be run on targets which support DWARF-2 and use gas.
+if {![dwarf2_support]} {
+ return 0
+ return 0
+}
+
+set testfile dw2-subrange-no-type
@ -2663,15 +2674,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
@ -2755,15 +2766,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
@ -3017,15 +3028,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
@ -3212,12 +3223,12 @@ new file mode 100644
+! 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 <http://www.gnu.org/licenses/>.
+
@ -3429,22 +3440,22 @@ diff --git a/gdb/testsuite/gdb.opt/fortran-string.exp b/gdb/testsuite/gdb.opt/fo
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.opt/fortran-string.exp
@@ -0,0 +1,39 @@
@@ -0,0 +1,46 @@
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# This file was written by Jan Kratochvil <jan.kratochvil@redhat.com>.
+
@ -3466,14 +3477,21 @@ new file mode 100644
+ continue
+}
+
+gdb_test "frame" ".*s='foo'.*"
+gdb_test "ptype s" "type = character\\*3"
+gdb_test "info args" ".*s = 'foo'.*"
+gdb_test_multiple "ptype s" "" {
+ -re -wrap "type = character \\(3\\)" {
+ pass $gdb_test_name
+ }
+ -re -wrap "type = character\\*3" {
+ pass $gdb_test_name
+ }
+}
+gdb_test "p s" "\\$\[0-9\]* = 'foo'"
diff --git a/gdb/testsuite/gdb.opt/fortran-string.f90 b/gdb/testsuite/gdb.opt/fortran-string.f90
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.opt/fortran-string.f90
@@ -0,0 +1,28 @@
@@ -0,0 +1,29 @@
+! Copyright 2009 Free Software Foundation, Inc.
+!
+! This program is free software; you can redistribute it and/or modify
@ -3497,6 +3515,7 @@ new file mode 100644
+ subroutine f(s)
+ character*(*) s
+ s = s
+ print *, s
+ end
+
+ program main
@ -3506,7 +3525,7 @@ diff --git a/gdb/testsuite/gdb.pascal/arrays.exp b/gdb/testsuite/gdb.pascal/arra
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.pascal/arrays.exp
@@ -0,0 +1,104 @@
@@ -0,0 +1,107 @@
+# Copyright 2008, 2009 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
@ -3598,11 +3617,15 @@ new file mode 100644
+
+if { $fpc_generates_dwarf_for_dynamic_arrays == 0} {
+ setup_xfail "*-*-*"
+} else {
+ setup_kfail "*-*-*" pascal/26106
+}
+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 "*-*-*"
+} else {
+ setup_kfail "*-*-*" pascal/26855
+}
+gdb_test "print StatArrStr" ".* = \\{'str0', 'str1', 'str2', 'str3', 'str4', 'str5', 'str6', 'str7', 'str8', 'str9', 'str10', 'str11', 'str12'\\}" "Print static array of string"
+
@ -3610,7 +3633,6 @@ new file mode 100644
+ 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
--- /dev/null
@ -3660,7 +3682,7 @@ new file mode 100644
+ Stat2dArrInt: TStat2dArrInt;
+
+ s: string;
+
+
+ i,j : integer;
+
+begin
@ -3690,8 +3712,8 @@ new file mode 100644
+ DynArrStr[i]:='dstr'+inttostr(i);
+ end;
+ writeln(DynArrInt_[1]);
+ writeln(DynArrInt[1]);
+ writeln(DynArrStr[1]);
+ writeln(DynArrInt[1]);
+ writeln(DynArrStr[1]);
+ writeln(StatArrStr[1]);
+ writeln(DynArrChar[1]);
+
@ -3736,7 +3758,7 @@ diff --git a/gdb/testsuite/lib/pascal.exp b/gdb/testsuite/lib/pascal.exp
+ set fpcversion_major 1
+ set fpcversion_minor 0
+ set fpcversion_release 0
+ set fpcversion [ remote_exec host $fpc_compiler "-iV" ]
+ 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

View File

@ -43,3 +43,30 @@ diff --git a/gdb/python/py-framefilter.c b/gdb/python/py-framefilter.c
}
return success;
diff --git a/gdb/testsuite/gdb.python/py-framefilter.exp b/gdb/testsuite/gdb.python/py-framefilter.exp
--- a/gdb/testsuite/gdb.python/py-framefilter.exp
+++ b/gdb/testsuite/gdb.python/py-framefilter.exp
@@ -277,9 +277,20 @@ gdb_test_multiple "bt 1" $test {
# Now verify that we can see a quit.
gdb_test_no_output "python name_error = KeyboardInterrupt" \
"Change ErrorFilter to throw KeyboardInterrupt"
-gdb_test "bt 1" "Quit" "bt 1 with KeyboardInterrupt"
-
-
+set re1 [multi_line \
+ "Python Exception <class 'KeyboardInterrupt'> whoops: " \
+ "\\(More stack frames follow\.\.\.\\)"]
+set re2 [multi_line \
+ "Python Exception <type 'exceptions.KeyboardInterrupt'> whoops: " \
+ "\\(More stack frames follow\.\.\.\\)"]
+gdb_test_multiple "bt 1" "" {
+ -re -wrap $re1 {
+ pass $gdb_test_name
+ }
+ -re -wrap $re2 {
+ pass $gdb_test_name
+ }
+}
# Test with no debuginfo
# We cannot use prepare_for_testing as we have to set the safe-patch

View File

@ -233,11 +233,11 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+if {![istarget x86_64-*]} {
+ return 0
+ return 0
+}
+
+set testfile "rh-dwarf4-x86_64"

View File

@ -38,4 +38,4 @@ new file mode 100644
+# Skip all tests if Python scripting is not enabled.
+if { [skip_python_tests] } { continue }
+
+gdb_test "python print gdb.solib_name(-1)" "None" "gdb.solib_name exists"
+gdb_test "python print (gdb.solib_name(-1))" "None" "gdb.solib_name exists"

View File

@ -159,7 +159,7 @@ diff --git a/gdb/python/lib/gdb/backtrace.py b/gdb/python/lib/gdb/backtrace.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/backtrace.py
@@ -0,0 +1,42 @@
@@ -0,0 +1,41 @@
+# Filtering backtrace.
+
+# Copyright (C) 2008, 2011 Free Software Foundation, Inc.
@ -201,12 +201,11 @@ new file mode 100644
+ if old_frame_filter is None:
+ return iter
+ return old_frame_filter (iter)
+
diff --git a/gdb/python/lib/gdb/command/backtrace.py b/gdb/python/lib/gdb/command/backtrace.py
new file mode 100644
--- /dev/null
+++ b/gdb/python/lib/gdb/command/backtrace.py
@@ -0,0 +1,106 @@
@@ -0,0 +1,112 @@
+# New backtrace command.
+
+# Copyright (C) 2008, 2009, 2011 Free Software Foundation, Inc.
@ -290,13 +289,19 @@ new file mode 100644
+ # 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 sys.version_info.major >= 3:
+ iter = map (FrameWrapper, FrameIterator (newest_frame))
+ else:
+ 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)
+ if sys.version_info.major >= 3:
+ iter = zip (itertools.count (0), iter)
+ else:
+ iter = itertools.izip (itertools.count (0), iter)
+
+ # Reverse if the user wanted that.
+ if self.reverse.value:
@ -313,3 +318,17 @@ new file mode 100644
+ pair[1].describe (sys.stdout, full)
+
+FilteringBacktrace()
diff --git a/gdb/testsuite/gdb.base/help.exp b/gdb/testsuite/gdb.base/help.exp
--- a/gdb/testsuite/gdb.base/help.exp
+++ b/gdb/testsuite/gdb.base/help.exp
@@ -129,7 +129,9 @@ gdb_test "apropos apropos" "apropos -- Search for commands matching a REGEXP.*"
# Test apropos for commands having aliases.
gdb_test "apropos Print backtrace of all stack frames, or innermost COUNT frames\." \
- "backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\."
+ [multi_line \
+ "backtrace, where, bt -- Print backtrace of all stack frames, or innermost COUNT frames\." \
+ "new-backtrace -- Print backtrace of all stack frames, or innermost COUNT frames\."]
# Test help for commands having aliases.
gdb_test "help bt" "backtrace, where, bt\[\r\n\]+Print backtrace of all stack frames, or innermost COUNT frames\..*"

View File

@ -39,15 +39,15 @@ new file mode 100644
+# 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.
+# 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}] } {
@ -67,7 +67,7 @@ new file mode 100644
+
+# Fix rejected upstream:
+# https://sourceware.org/ml/gdb-patches/2014-07/msg00768.html
+setup_kfail "rejected" *-*-*
+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

View File

@ -10,7 +10,7 @@ diff --git a/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp b/gdb/testsu
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gnu-ifunc-strstr-workaround.exp
@@ -0,0 +1,115 @@
@@ -0,0 +1,119 @@
+# Copyright (C) 2012 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
@ -56,6 +56,10 @@ new file mode 100644
+ untested "$test (no DWARF)"
+ return 0
+ }
+ -re "type = <unknown return type> \\(\\)\r\n$gdb_prompt $" {
+ untested "$test (no DWARF)"
+ return 0
+ }
+}
+
+set addr ""
@ -124,5 +128,5 @@ new file mode 100644
+ }
+}
+
+gdb_test {print strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print strstr("def","e")} { = 0x[0-9a-f]+ "ef"}
+gdb_test {print (char *)strstr("abc","b")} { = 0x[0-9a-f]+ "bc"}
+gdb_test {print (char *)strstr("def","e")} { = 0x[0-9a-f]+ "ef"}

View File

@ -150,7 +150,7 @@ diff --git a/gdb/linux-nat.c b/gdb/linux-nat.c
diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.threads/attach-stopped.exp
--- a/gdb/testsuite/gdb.threads/attach-stopped.exp
+++ b/gdb/testsuite/gdb.threads/attach-stopped.exp
@@ -56,7 +56,65 @@ proc corefunc { threadtype } {
@@ -56,7 +56,73 @@ proc corefunc { threadtype } {
gdb_reinitialize_dir $srcdir/$subdir
gdb_load ${binfile}
@ -162,10 +162,10 @@ diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.th
+ set test "$threadtype: set file, before attach1 to stopped process"
+ gdb_test_multiple "file $binfile" "$test" {
+ -re "Load new symbol table from.*y or n. $" {
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*done." \
+ gdb_test "y" "Reading symbols from $escapedbinfile\.\.\.*" \
+ "$test (re-read)"
+ }
+ -re "Reading symbols from $escapedbinfile\.\.\.*done.*$gdb_prompt $" {
+ -re "Reading symbols from $escapedbinfile\.\.\.*$gdb_prompt $" {
+ pass "$test"
+ }
+ }
@ -185,22 +185,30 @@ diff --git a/gdb/testsuite/gdb.threads/attach-stopped.exp b/gdb/testsuite/gdb.th
+ }
+
+ # Exit and detach the process.
+
+
+ gdb_exit
+
+ # Avoid some race:
+ sleep 2
+
+ if [catch {open /proc/${testpid}/status r} fileid] {
+ set line2 "NOTFOUND"
+ set line "NOTFOUND"
+ } else {
+ gets $fileid line1;
+ gets $fileid line2;
+ while { 1 } {
+ if { [gets $fileid line] < 0 } {
+ set line "EOF"
+ break
+ }
+ if {[string match "State:*" $line]} {
+ break
+ }
+ }
+ close $fileid;
+ }
+
+ set test "$threadtype: attach1, exit leaves process stopped"
+ if {[string match "*(stopped)*" $line2]} {
+ verbose -log "line: $line"
+ if {[string match "*(stopped)*" $line]} {
+ pass $test
+ } else {
+ fail $test

View File

@ -64,10 +64,10 @@ new file mode 100644
+
+/* DW_AT_low_pc-DW_AT_high_pc should cover the function without line number
+ information (.debug_line) so we cannot use an external object file.
+
+
+ It must not be just a label as it would alias on the next function even for
+ correct GDB. Therefore some stub data must be placed there.
+
+
+ We need to provide a real stub function body as at least s390
+ (s390_analyze_prologue) would skip the whole body till reaching `main'. */
+

View File

@ -12,7 +12,7 @@ diff --git a/gdb/testsuite/gdb.cp/pr11734-1.cc b/gdb/testsuite/gdb.cp/pr11734-1.
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-1.cc
@@ -0,0 +1,30 @@
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -42,12 +42,11 @@ new file mode 100644
+ p->foo ();
+ return 0;
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-2.cc b/gdb/testsuite/gdb.cp/pr11734-2.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-2.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -74,12 +73,11 @@ new file mode 100644
+pr11734::foo(void)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-3.cc b/gdb/testsuite/gdb.cp/pr11734-3.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-3.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -106,12 +104,11 @@ new file mode 100644
+pr11734::foo (int a)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734-4.cc b/gdb/testsuite/gdb.cp/pr11734-4.cc
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734-4.cc
@@ -0,0 +1,27 @@
@@ -0,0 +1,26 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -138,7 +135,6 @@ new file mode 100644
+pr11734::foo (char *a)
+{
+}
+
diff --git a/gdb/testsuite/gdb.cp/pr11734.exp b/gdb/testsuite/gdb.cp/pr11734.exp
new file mode 100644
--- /dev/null
@ -203,7 +199,7 @@ diff --git a/gdb/testsuite/gdb.cp/pr11734.h b/gdb/testsuite/gdb.cp/pr11734.h
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.cp/pr11734.h
@@ -0,0 +1,28 @@
@@ -0,0 +1,27 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
@ -231,4 +227,3 @@ new file mode 100644
+ void foo (int);
+ void foo (char *);
+};
+

View File

@ -25,7 +25,7 @@ new file mode 100644
+#
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Test PowerPC Power7 instructions disassembly.
+
@ -48,7 +48,7 @@ new file mode 100644
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${objfile}
+
+
+
+# Disassemble the function.
+

View File

@ -81,7 +81,7 @@ diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c b/gdb/tes
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.c
@@ -0,0 +1,124 @@
@@ -0,0 +1,125 @@
+/* Testcase for recursive dlopen calls.
+
+ Copyright (C) 2014 Free Software Foundation, Inc.
@ -178,6 +178,7 @@ new file mode 100644
+ /* Called recursively. */
+ result = malloc (size);
+ /* Restore new hooks. */
+ old_malloc_hook = __malloc_hook;
+ __malloc_hook = custom_malloc_hook;
+ return result;
+}
@ -210,7 +211,7 @@ diff --git a/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp b/gdb/t
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.base/gdb-rhbz1156192-recursive-dlopen.exp
@@ -0,0 +1,137 @@
@@ -0,0 +1,157 @@
+# Copyright 2014 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
@ -226,8 +227,12 @@ new file mode 100644
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+if { [skip_shlib_tests] } {
+ return 0
+if {[skip_shlib_tests]} {
+ untested "skipping shlib tests"
+ return 0
+} elseif {[use_gdb_stub]} {
+ untested "skipping tests because of stub"
+ return 0
+}
+
+# Library foo
@ -262,6 +267,21 @@ new file mode 100644
+ return -1
+}
+
+set supported 0
+gdb_test_multiple "run" "initial trial run" {
+ -re -wrap "exited normally.*" {
+ set supported 1
+ pass $gdb_test_name
+ }
+ -re -wrap "exited with code.*" {
+ untested "failed at $gdb_test_name"
+ }
+}
+
+if { $supported == 0 } {
+ return -1
+}
+
+proc do_test { has_libfoo has_libbar } {
+ global hex binfile_lib2 binfile_lib1 gdb_prompt
+ set libbar_match "[string_to_regexp $binfile_lib2]"
@ -314,6 +334,7 @@ new file mode 100644
+ gdb_test_no_output "set stop-on-solib-events 1" "setting stop-on-solib-events"
+
+ gdb_run_cmd
+ gdb_test "" "Wait for first prompt"
+ foreach l $solib_event_order {
+ incr pass
+ with_test_prefix "pass #$pass" {

View File

@ -73,7 +73,7 @@ new file mode 100644
+set test "rwatch aligned.var4"
+if [istarget "s390*-*-*"] {
+ gdb_test $test {Target does not support this type of hardware watchpoint\.}
+ untested "s390* does not support hw read watchpoint"
+ untested "s390* does not support hw read watchpoint"
+ return
+}
+gdb_test $test "Hardware read watchpoint \[0-9\]+: aligned.var4"

View File

@ -428,7 +428,7 @@ new file mode 100644
+
+if { ![istarget x86_64-*-* ] || ![is_lp64_target] } {
+ return
+}
+}
+
+standard_testfile
+

View File

@ -0,0 +1,58 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Kevin Buettner <kevinb@redhat.com>
Date: Fri, 19 Mar 2021 11:07:11 -0700
Subject: gdb-rhbz1941080-fix-gdbserver-hang.patch
;; Backport change which fixes gdbserver testing hang on f34 and rawhide.
Fix potential hang during gdbserver testing
We're currently seeing testing of native-extended-gdbserver hang while
testing the x86_64 architecture on both Fedora 34 and Fedora Rawhide.
The test responsible for the hang is gdb.threads/fork-plus-threads.exp.
While there is clearly a problem/bug with this test on F34 and
Rawhide, it's also the case that testing should not hang. This commit
prevents the hang by waiting with the "-nowait" flag in
close_gdbserver.
The -nowait flag is also used in the kill_wait_spawned_process proc in
gdb/testsuite/lib/gdb.exp, so there is precedent for doing this.
There are also 15 other uses of "wait -i" scattered throughout the
test suite. While it's tempting to change these to also use the
-nowait flag, I think it might be safer to defer doing so until we
actually see a problem.
I've tested this patch on Fedora 32, 33, 34, and Rawhide. Results are
comparable on Fedora 32 and 33. On Fedora 34 and Rawhide, with this
commit in place, testing completes when the target_board is
native-extended-gdbserver. On those OSes, when not using this commit,
testing usually hangs due to a problem with
gdb.threads/fork-plus-threads.exp. I've also tested on all of the
mentioned OSes with target_board=native-gdbserver; for that testing,
I achieved comparable results over a number of runs. (Unfortunately
results are rarely identical due to racy tests.)
gdb/testsuite/ChangeLog:
* lib/gdbserver-support.exp (gdbserver_exit): Use the
"-nowait" flag when waiting for gdbserver to exit.
diff --git a/gdb/testsuite/lib/gdbserver-support.exp b/gdb/testsuite/lib/gdbserver-support.exp
--- a/gdb/testsuite/lib/gdbserver-support.exp
+++ b/gdb/testsuite/lib/gdbserver-support.exp
@@ -418,7 +418,12 @@ proc close_gdbserver {} {
verbose "Quitting GDBserver"
catch "close -i $server_spawn_id"
- catch "wait -i $server_spawn_id"
+
+ # If gdbserver misbehaves, and ignores the close, waiting for it
+ # without the -nowait flag will cause testing to hang. Passing
+ # -nowait makes expect tell Tcl to wait for the process in the
+ # background.
+ catch "wait -nowait -i $server_spawn_id"
unset server_spawn_id
}

View File

@ -203,7 +203,7 @@ new file mode 100644
+ && ![istarget *-*-openbsd*]
+ && ![istarget arm-*-eabi*]
+ && ![istarget powerpc-*-eabi*]} {
+ return 0
+ return 0
+}
+
+set testfile "dw2-aranges"

View File

@ -57,21 +57,21 @@ new file mode 100644
+ vcvtps2ph $0x2,%ymm4,%xmm4
+ vcvtps2ph $0x2,%ymm8,(%r8)
+ vcvtps2ph $0x2,%xmm4,%xmm4
+ vcvtps2ph $0x2,%xmm4,(%rcx)
+ vcvtps2ph $0x2,%xmm4,(%rcx)
+
+ .intel_syntax noprefix
+ vcvtph2ps ymm4,xmm4
+ vcvtph2ps ymm8,XMMWORD PTR [r8]
+ vcvtph2ps ymm4,[rcx]
+ vcvtph2ps xmm6,xmm4
+ vcvtph2ps xmm4,QWORD PTR [rcx]
+ vcvtph2ps xmm4,QWORD PTR [rcx]
+ vcvtph2ps xmm4,[rcx]
+ vcvtps2ph xmm4,ymm4,0x2
+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2
+ vcvtps2ph [rcx],ymm4,0x2
+ vcvtps2ph XMMWORD PTR [rcx],ymm4,0x2
+ vcvtps2ph [rcx],ymm4,0x2
+ vcvtps2ph xmm4,xmm4,0x2
+ vcvtps2ph QWORD PTR [r8],xmm8,0x2
+ vcvtps2ph [rcx],xmm4,0x2
+ vcvtps2ph QWORD PTR [r8],xmm8,0x2
+ vcvtps2ph [rcx],xmm4,0x2
+
+/* gas/i386/x86-64-fsgs.s */
+ .att_syntax prefix
@ -80,34 +80,34 @@ new file mode 100644
+ rdfsbase %r8d
+ rdfsbase %r8
+ rdgsbase %ebx
+ rdgsbase %rbx
+ rdgsbase %r8d
+ rdgsbase %r8
+ wrfsbase %ebx
+ wrfsbase %rbx
+ wrfsbase %r8d
+ wrfsbase %r8
+ wrgsbase %ebx
+ wrgsbase %rbx
+ wrgsbase %r8d
+ wrgsbase %r8
+ rdgsbase %rbx
+ rdgsbase %r8d
+ rdgsbase %r8
+ wrfsbase %ebx
+ wrfsbase %rbx
+ wrfsbase %r8d
+ wrfsbase %r8
+ wrgsbase %ebx
+ wrgsbase %rbx
+ wrgsbase %r8d
+ wrgsbase %r8
+
+ .intel_syntax noprefix
+ rdfsbase ebx
+ rdfsbase rbx
+ rdfsbase r8d
+ rdfsbase ebx
+ rdfsbase rbx
+ rdfsbase r8d
+ rdfsbase r8
+ rdgsbase ebx
+ rdgsbase rbx
+ rdgsbase r8d
+ rdgsbase ebx
+ rdgsbase rbx
+ rdgsbase r8d
+ rdgsbase r8
+ wrfsbase ebx
+ wrfsbase rbx
+ wrfsbase r8d
+ wrfsbase ebx
+ wrfsbase rbx
+ wrfsbase r8d
+ wrfsbase r8
+ wrgsbase ebx
+ wrgsbase rbx
+ wrgsbase r8d
+ wrgsbase ebx
+ wrgsbase rbx
+ wrgsbase r8d
+ wrgsbase r8
diff --git a/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp b/gdb/testsuite/gdb.arch/amd64-ivy-bridge.exp
new file mode 100644
@ -136,7 +136,7 @@ new file mode 100644
+set testfile amd64-ivy-bridge
+set test compilation
+if [prepare_for_testing ${testfile}.exp ${testfile}.x ${testfile}.S [list debug "additional_flags=-m64 -nostdlib"]] {
+ fail $test
+ unsupported $test
+ return -1
+}
+pass $test
@ -288,7 +288,7 @@ diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.S b/gdb/testsuite/gdb.arch/i
new file mode 100644
--- /dev/null
+++ b/gdb/testsuite/gdb.arch/i386-ivy-bridge.S
@@ -0,0 +1,67 @@
@@ -0,0 +1,66 @@
+/* Copyright 2011 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
@ -325,23 +325,23 @@ new file mode 100644
+ vcvtph2ps %xmm4,%xmm6
+ vcvtph2ps (%ecx),%xmm4
+ vcvtps2ph $0x2,%ymm4,%xmm4
+ vcvtps2ph $0x2,%ymm4,(%ecx)
+ vcvtps2ph $0x2,%ymm4,(%ecx)
+ vcvtps2ph $0x2,%xmm4,%xmm4
+ vcvtps2ph $0x2,%xmm4,(%ecx)
+ vcvtps2ph $0x2,%xmm4,(%ecx)
+
+ .intel_syntax noprefix
+ vcvtph2ps ymm4,xmm4
+ vcvtph2ps ymm4,XMMWORD PTR [ecx]
+ vcvtph2ps ymm4,[ecx]
+ vcvtph2ps xmm6,xmm4
+ vcvtph2ps xmm4,QWORD PTR [ecx]
+ vcvtph2ps xmm4,QWORD PTR [ecx]
+ vcvtph2ps xmm4,[ecx]
+ vcvtps2ph xmm4,ymm4,0x2
+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2
+ vcvtps2ph [ecx],ymm4,0x2
+ vcvtps2ph XMMWORD PTR [ecx],ymm4,0x2
+ vcvtps2ph [ecx],ymm4,0x2
+ vcvtps2ph xmm4,xmm4,0x2
+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2
+ vcvtps2ph [ecx],xmm4,0x2
+ vcvtps2ph QWORD PTR [ecx],xmm4,0x2
+ vcvtps2ph [ecx],xmm4,0x2
+
+/* gas/i386/fsgs.s */
+ .att_syntax prefix
@ -351,11 +351,10 @@ new file mode 100644
+ wrgsbase %ebx
+
+ .intel_syntax noprefix
+ rdfsbase ebx
+ rdgsbase ebx
+ wrfsbase ebx
+ wrgsbase ebx
+
+ rdfsbase ebx
+ rdgsbase ebx
+ wrfsbase ebx
+ wrgsbase ebx
diff --git a/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp b/gdb/testsuite/gdb.arch/i386-ivy-bridge.exp
new file mode 100644
--- /dev/null

View File

@ -45,22 +45,22 @@ new file mode 100644
+++ b/gdb/testsuite/gdb.arch/x86_64-pid0-core.exp
@@ -0,0 +1,46 @@
+# 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 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+# Some kernel core files have PID 0 - for the idle task.
+

View File

@ -91,15 +91,15 @@ new file mode 100644
+# 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.
+# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
+
+set testfile "dynamic-other-frame"
+set srcfile1 ${testfile}.f90

View File

@ -37,7 +37,7 @@ Version: 10.1
# 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: 10%{?dist}
Release: 13%{?dist}
License: GPLv3+ and GPLv3+ with exceptions and GPLv2+ and GPLv2+ with exceptions and GPL+ and LGPLv2+ and LGPLv3+ and BSD and Public Domain and GFDL
# Do not provide URL for snapshots as the file lasts there only for 2 days.
@ -588,8 +588,11 @@ COMMON_GDB_CONFIGURE_FLAGS="\
--with-lzma \
%else
--without-lzma \
%endif \
--with-debuginfod
%endif
--with-debuginfod \
%if 0%{?rhel:1}
--disable-libctf
%endif
"
# Identify the build directory with the version of gdb as well as the
@ -620,10 +623,6 @@ GDB_MINIMAL_CONFIGURE_FLAGS="\
export CFLAGS="$RPM_OPT_FLAGS %{?_with_asan:-fsanitize=address}"
export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}"
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1912913
# Take this out when fixed in gcc/g++.
CFLAGS="$CFLAGS -Wno-stringop-overread"
export CXXFLAGS="$CFLAGS"
# --htmldir and --pdfdir are not used as they are used from %{gdb_build}.
@ -655,10 +654,6 @@ cd %{gdb_build}$fprofile
export CFLAGS="$RPM_OPT_FLAGS %{?_with_asan:-fsanitize=address}"
export LDFLAGS="%{?__global_ldflags} %{?_with_asan:-fsanitize=address}"
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1912913
# Take this out when fixed in gcc/g++.
CFLAGS="$CFLAGS -Wno-stringop-overread"
%if 0%{!?rhel:1} || 0%{?rhel} > 7
CFLAGS="$CFLAGS -DDNF_DEBUGINFO_INSTALL"
%endif
@ -1195,6 +1190,18 @@ fi
%endif
%changelog
* Tue Mar 30 2021 Jonathan Wakely <jwakely@redhat.com>
- Rebuilt for removed libstdc++ symbol (#1937698)
* Tue Mar 23 2021 Kevin Buettner <kevinb@redhat.com>
- Remove spec file workaround for RHBZ 1912913.
* Fri Mar 19 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-12
- Fix potential hang during gdbserver testing (RHBZ 1941080, Kevin Buettner).
* Thu Mar 18 2021 Keith Seitz <keiths@redhat.com> - 10.1-11
- Disable libctf on RHEL (RHBZ 1935517).
* Thu Mar 11 2021 Kevin Buettner <kevinb@redhat.com> - 10.1-10
- Update libipt to version 2.0.4.

View File

@ -34,6 +34,8 @@ test "$1" = "-h" && usage
uncommit=0
if [ "$1" = "-u" ]; then
command -v stg > /dev/null 2>&1 \
|| die "Cannot find stg. Is stgit installed?"
uncommit=1
shift
fi
@ -46,7 +48,6 @@ fi
test -f _git_upstream_commit || die "Cannot find _git_upstream_commit file."
test -f _patch_order || die "Cannot find _patch_order file."
command -v stg > /dev/null 2>&1 || die "Cannot find stg. Is stgit installed?"
last_ancestor_commit=`cat _git_upstream_commit`

View File

@ -0,0 +1,65 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Keith Seitz <keiths@redhat.com>
Date: Tue, 23 Mar 2021 11:17:28 -0700
Subject: process_psymtab_comp_unit-type-unit.patch
;; Backport "Handle DW_TAG_type_unit in process_symtab_unit"
;; (Tom de Vries)
commit e77b0004dd114d6ddf3bb92b521b2854341f3f85
Author: Tom de Vries <tdevries@suse.de>
Date: Fri Feb 5 17:47:07 2021 +0100
[gdb/symtab] Handle DW_TAG_type_unit in process_psymtab_comp_unit
When running test-case gdb.cp/cpexprs-debug-types.exp with target board
unix/gdb:debug_flags=-gdwarf-5, I run into:
...
(gdb) file cpexprs-debug-types^M
Reading symbols from cpexprs-debug-types...^M
ERROR: Couldn't load cpexprs-debug-types into GDB (eof).
ERROR: Couldn't send delete breakpoints to GDB.
ERROR: GDB process no longer exists
GDB process exited with wait status 23054 exp9 0 0 CHILDKILLED SIGABRT SIGABRT
...
We're running into this abort in process_psymtab_comp_unit:
...
switch (reader.comp_unit_die->tag)
{
case DW_TAG_compile_unit:
this_cu->unit_type = DW_UT_compile;
break;
case DW_TAG_partial_unit:
this_cu->unit_type = DW_UT_partial;
break;
default:
abort ();
}
...
because reader.comp_unit_die->tag == DW_TAG_type_unit.
Fix this by adding a DW_TAG_type_unit case.
Tested on x86_64-linux.
gdb/ChangeLog:
2021-02-05 Tom de Vries <tdevries@suse.de>
PR symtab/27333
* dwarf2/read.c (process_psymtab_comp_unit): Handle DW_TAG_type_unit.
diff --git a/gdb/dwarf2/read.c b/gdb/dwarf2/read.c
--- a/gdb/dwarf2/read.c
+++ b/gdb/dwarf2/read.c
@@ -7715,6 +7715,9 @@ process_psymtab_comp_unit (dwarf2_per_cu_data *this_cu,
case DW_TAG_partial_unit:
this_cu->unit_type = DW_UT_partial;
break;
+ case DW_TAG_type_unit:
+ this_cu->unit_type = DW_UT_type;
+ break;
default:
abort ();
}

View File

@ -0,0 +1,52 @@
From FEDORA_PATCHES Mon Sep 17 00:00:00 2001
From: Keith Seitz <keiths@redhat.com>
Date: Tue, 23 Mar 2021 09:32:37 -0700
Subject: testing-custom-inputrc.patch
;; Backport "Disable bracketed paste mode in GDB tests"
;; (Tom Tromey)
commit 1af4c9c4209c3478224f18dfb79dc09567b96705
Author: Tom Tromey <tom@tromey.com>
Date: Sat Jan 23 08:52:45 2021 -0700
Disable bracketed paste mode in GDB tests
I have a patch to import GNU readline 8.1 into GDB. However, when
running the tests, there were a number of failures due to "bracketed
paste mode". This is a terminal feature that readline 8.1 enables by
default.
The simplest way to work around this was to always make a ".inputrc"
for GDB tests that will tell readline to disable brackted paste mode.
gdb/testsuite/ChangeLog
2021-01-23 Tom Tromey <tom@tromey.com>
* lib/gdb.exp (default_gdb_init): Set INPUTRC to a cached file.
diff --git a/gdb/testsuite/lib/gdb.exp b/gdb/testsuite/lib/gdb.exp
--- a/gdb/testsuite/lib/gdb.exp
+++ b/gdb/testsuite/lib/gdb.exp
@@ -5084,13 +5084,14 @@ proc default_gdb_init { test_file_name } {
setenv LC_CTYPE C
setenv LANG C
- # Don't let a .inputrc file or an existing setting of INPUTRC mess up
- # the test results. Even if /dev/null doesn't exist on the particular
- # platform, the readline library will use the default setting just by
- # failing to open the file. OTOH, opening /dev/null successfully will
- # also result in the default settings being used since nothing will be
- # read from this file.
- setenv INPUTRC "/dev/null"
+ # Don't let a .inputrc file or an existing setting of INPUTRC mess
+ # up the test results. Certain tests (style tests and TUI tests)
+ # want to set the terminal to a non-"dumb" value, and for those we
+ # want to disable bracketed paste mode. Versions of Readline
+ # before 8.0 will not understand this and will issue a warning.
+ # We tried using a $if to guard it, but Readline 8.1 had a bug in
+ # its version-comparison code that prevented this for working.
+ setenv INPUTRC [cached_file inputrc "set enable-bracketed-paste off"]
# This disables style output, which would interfere with many
# tests.