Skip to content

Commit 7d4dfa9

Browse files
ivanivanov884jeffmahoney
authored andcommitted
gdb-archer-next-over-throw-cxx-exec.patch
;; Fix follow-exec for C++ programs (bugreported by Martin Stransky). ;;=fedoratest Archer-upstreamed: http://sourceware.org/ml/archer/2010-q2/msg00031.html
1 parent cfff6ea commit 7d4dfa9

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

gdb/testsuite/gdb.cp/cxxexec.cc

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
/* This test script is part of GDB, the GNU debugger.
2+
3+
Copyright 2010 Free Software Foundation, Inc.
4+
5+
This program is free software; you can redistribute it and/or modify
6+
it under the terms of the GNU General Public License as published by
7+
the Free Software Foundation; either version 3 of the License, or
8+
(at your option) any later version.
9+
10+
This program is distributed in the hope that it will be useful,
11+
but WITHOUT ANY WARRANTY; without even the implied warranty of
12+
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+
GNU General Public License for more details.
14+
15+
You should have received a copy of the GNU General Public License
16+
along with this program. If not, see <http://www.gnu.org/licenses/>. */
17+
18+
#include <unistd.h>
19+
20+
int
21+
main()
22+
{
23+
execlp ("true", "true", NULL);
24+
return 1;
25+
}

gdb/testsuite/gdb.cp/cxxexec.exp

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Copyright 2010 Free Software Foundation, Inc.
2+
3+
# This program is free software; you can redistribute it and/or modify
4+
# it under the terms of the GNU General Public License as published by
5+
# the Free Software Foundation; either version 3 of the License, or
6+
# (at your option) any later version.
7+
#
8+
# This program is distributed in the hope that it will be useful,
9+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
10+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+
# GNU General Public License for more details.
12+
#
13+
# You should have received a copy of the GNU General Public License
14+
# along with this program. If not, see <http://www.gnu.org/licenses/>.
15+
16+
if { [skip_cplus_tests] } { continue }
17+
18+
set testfile cxxexec
19+
if { [prepare_for_testing ${testfile}.exp ${testfile} ${testfile}.cc {c++ debug}] } {
20+
return -1
21+
}
22+
23+
runto_main
24+
25+
# We could stop after `continue' again at `main'.
26+
delete_breakpoints
27+
28+
set test "p _Unwind_DebugHook"
29+
gdb_test_multiple $test $test {
30+
-re " = .* 0x\[0-9a-f\].*\r\n$gdb_prompt $" {
31+
pass $test
32+
}
33+
-re "\r\nNo symbol .*\r\n$gdb_prompt $" {
34+
xfail $test
35+
untested ${testfile}.exp
36+
return -1
37+
}
38+
}
39+
40+
set test continue
41+
gdb_test_multiple $test $test {
42+
-re "Cannot access memory at address 0x\[0-9a-f\]+\r\n$gdb_prompt $" {
43+
fail $test
44+
}
45+
-re "\r\n$gdb_prompt $" {
46+
pass $test
47+
}
48+
}
49+
50+
# `info inferiors' can show <null> on older GDBs.
51+
gdb_test "info threads" "info threads" "program finished"

0 commit comments

Comments
 (0)