public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-jankratochvil-bpstat_what: Test for PR 9436.
@ 2010-05-17 19:49 jkratoch
0 siblings, 0 replies; only message in thread
From: jkratoch @ 2010-05-17 19:49 UTC (permalink / raw)
To: archer-commits
The branch, archer-jankratochvil-bpstat_what has been updated
via e13e1840ffb1e8dd5a7241d3ccda446ca3a4def0 (commit)
from a2983924d612285a63628ec8ad26d41243caca67 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit e13e1840ffb1e8dd5a7241d3ccda446ca3a4def0
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Mon May 17 21:48:34 2010 +0200
Test for PR 9436.
-----------------------------------------------------------------------
Summary of changes:
gdb/testsuite/gdb.base/break-solib-event.exp | 90 --------------------------
gdb/testsuite/gdb.base/nostdlib.c | 29 ++++++++
gdb/testsuite/gdb.base/nostdlib.exp | 54 +++++++++++++++
3 files changed, 83 insertions(+), 90 deletions(-)
delete mode 100644 gdb/testsuite/gdb.base/break-solib-event.exp
create mode 100644 gdb/testsuite/gdb.base/nostdlib.c
create mode 100644 gdb/testsuite/gdb.base/nostdlib.exp
First 500 lines of diff:
diff --git a/gdb/testsuite/gdb.base/break-solib-event.exp b/gdb/testsuite/gdb.base/break-solib-event.exp
deleted file mode 100644
index 3fa5f69..0000000
--- a/gdb/testsuite/gdb.base/break-solib-event.exp
+++ /dev/null
@@ -1,90 +0,0 @@
-# Copyright 2010 Free Software Foundation, Inc.
-
-# This program is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
-# (at your option) any later version.
-#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-if {[skip_shlib_tests]} {
- return 0
-}
-
-set testfile "break-solib-event"
-set libfile "unloadshr"
-set libfile2 "unloadshr2"
-set libname "${testfile}-${libfile}.sl"
-set libname2 "${testfile}-${libfile2}.sl"
-set libsrcfile ${libfile}.c
-set libsrcfile2 ${libfile2}.c
-set srcfile $srcdir/$subdir/unload.c
-set executable $testfile
-set binfile $objdir/$subdir/$executable
-set shlibdir ${objdir}/${subdir}
-set libsrc $srcdir/$subdir/$libfile.c
-set libsrc2 $srcdir/$subdir/$libfile2.c
-set lib_sl $objdir/$subdir/$libname
-set lib_sl2 $objdir/$subdir/$libname2
-set lib_dlopen [shlib_target_file ${libname}]
-set lib_dlopen2 [shlib_target_file ${libname2}]
-set lib_syms [shlib_symbol_file ${libname}]
-set lib_syms2 [shlib_symbol_file ${libname2}]
-
-if [get_compiler_info ${binfile}] {
- return -1
-}
-
-set lib_opts debug
-set exec_opts [list debug shlib_load additional_flags=-DSHLIB_NAME\=\"${lib_dlopen}\" additional_flags=-DSHLIB_NAME2\=\"${lib_dlopen2}\"]
-
-if { [gdb_compile_shlib $libsrc $lib_sl $lib_opts] != ""
- || [gdb_compile_shlib $libsrc2 $lib_sl2 $lib_opts] != ""
- || [gdb_compile $srcfile $binfile executable $exec_opts] != ""} {
- untested "Couldn't compile $libsrc or $libsrc2 or $srcfile."
- return -1
-}
-
-clean_restart $executable
-gdb_load_shlibs $lib_sl $lib_sl2
-
-gdb_test "set stop-on-solib-events 1"
-
-set event_msg "Stopped due to shared library event"
-
-gdb_run_cmd
-gdb_test "" "${event_msg}.*" "stop at event"
-
-# gdb_breakpoint {*$pc} or {*$} creates a "floating" breakpoint - changing its
-# position on breakpoint_re_set (which happens on bp_shlib_event).
-set test {p/x $pc}
-set event ""
-gdb_test_multiple $test $test {
- -re " = (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
- set event $expect_out(1,string)
- pass $test
- }
-}
-gdb_breakpoint "*$event"
-
-set test {commands $bpnum}
-gdb_test_multiple $test $test {
- -re "\r\n>$" {
- pass $test
- }
-}
-set test {echo event-hit\n}
-gdb_test_multiple $test $test {
- -re "\r\n>$" {
- pass $test
- }
-}
-gdb_test "end"
-
-gdb_test "continue" "${event_msg}.*event-hit.*"
diff --git a/gdb/testsuite/gdb.base/nostdlib.c b/gdb/testsuite/gdb.base/nostdlib.c
new file mode 100644
index 0000000..9604680
--- /dev/null
+++ b/gdb/testsuite/gdb.base/nostdlib.c
@@ -0,0 +1,29 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ Copyright 2010 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 3 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program. If not, see <http://www.gnu.org/licenses/>. */
+
+void
+_start (void)
+{
+ extern void marker (void);
+
+ marker ();
+}
+
+void
+marker (void)
+{
+}
diff --git a/gdb/testsuite/gdb.base/nostdlib.exp b/gdb/testsuite/gdb.base/nostdlib.exp
new file mode 100644
index 0000000..59350d3
--- /dev/null
+++ b/gdb/testsuite/gdb.base/nostdlib.exp
@@ -0,0 +1,54 @@
+# Copyright 2010 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+set testfile "nostdlib"
+set srcfile ${testfile}.c
+set executable ${testfile}
+set binfile ${objdir}/${subdir}/${executable}
+
+# default_target_compile would otherwise add "-lm" making the testcase
+# dependent on whether the system libraries are already prelinked.
+# prelink: Could not set /lib64/libm-2.11.1.so owner or mode: Operation not permitted
+set compile {
+ gdb_compile "${srcdir}/${subdir}/${srcfile}" "${binfile}" executable {debug additional_flags=-nostdlib}
+}
+set board [target_info name]
+if [board_info $board exists mathlib] {
+ set mathlib [board_info $dest mathlib]
+ set_board_info mathlib ""
+ set err [eval $compile]
+ set_board_info mathlib $mathlib
+} else {
+ set_board_info mathlib ""
+ set err [eval $compile]
+ unset_board_info mathlib
+}
+if {$err != ""} {
+ untested ${testfile}.exp
+ return -1
+}
+
+clean_restart $executable
+
+gdb_breakpoint "*marker"
+gdb_breakpoint "*_start"
+
+gdb_run_cmd
+
+# Breakpoint 2, Stopped due to shared library event
+# _start () at ./gdb.base/nostdlib.c:20
+gdb_test "" {Breakpoint [0-9]+, .*_start .*} "stop at run"
+
+gdb_test "continue" {Breakpoint [0-9]+, marker .*} "continue to marker"
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2010-05-17 19:49 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-17 19:49 [SCM] archer-jankratochvil-bpstat_what: Test for PR 9436 jkratoch
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).