public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
* [SCM] archer-jankratochvil-misc: New testcase for:
@ 2009-01-25 21:38 jkratoch
0 siblings, 0 replies; only message in thread
From: jkratoch @ 2009-01-25 21:38 UTC (permalink / raw)
To: archer-commits
The branch, archer-jankratochvil-misc has been updated
via a6ed408bab2c039e7056f9f961d60baaafed4895 (commit)
from 30af9b0f969a57100396e918f5013d402a158cbb (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email.
- Log -----------------------------------------------------------------
commit a6ed408bab2c039e7056f9f961d60baaafed4895
Author: Jan Kratochvil <jan.kratochvil@redhat.com>
Date: Sun Jan 25 22:36:55 2009 +0100
New testcase for:
https://bugzilla.redhat.com/show_bug.cgi?id=466222
(for the first / customer recommended fix)
and the upstream fix:
http://sourceware.org/ml/gdb-patches/2006-11/msg00253.html
[rfc] Do not make up line information
http://sourceware.org/ml/gdb-cvs/2006-11/msg00127.html
-----------------------------------------------------------------------
Summary of changes:
gdb/testsuite/gdb.base/lineno-makeup.c | 32 ++++++++++++++++
gdb/testsuite/gdb.base/lineno-makeup.exp | 58 ++++++++++++++++++++++++++++++
2 files changed, 90 insertions(+), 0 deletions(-)
create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.c
create mode 100644 gdb/testsuite/gdb.base/lineno-makeup.exp
First 500 lines of diff:
diff --git a/gdb/testsuite/gdb.base/lineno-makeup.c b/gdb/testsuite/gdb.base/lineno-makeup.c
new file mode 100644
index 0000000..1e7a501
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineno-makeup.c
@@ -0,0 +1,32 @@
+/* This testcase is part of GDB, the GNU debugger.
+
+ 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 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/>. */
+
+/* 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 a stub byte must be placed there. */
+
+extern void func (void);
+asm ("func: .quad 0");
+
+int
+main (void)
+{
+ func ();
+ return 0;
+}
diff --git a/gdb/testsuite/gdb.base/lineno-makeup.exp b/gdb/testsuite/gdb.base/lineno-makeup.exp
new file mode 100644
index 0000000..c85c680
--- /dev/null
+++ b/gdb/testsuite/gdb.base/lineno-makeup.exp
@@ -0,0 +1,58 @@
+# 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 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 "lineno-makeup"
+set srcfile ${testfile}.c
+set binfile ${objdir}/${subdir}/${testfile}
+
+if { [prepare_for_testing ${testfile}.exp "${testfile}" "${testfile}.c" {debug}] } {
+ return -1
+}
+
+gdb_exit
+gdb_start
+gdb_reinitialize_dir $srcdir/$subdir
+gdb_load ${binfile}
+
+set b_addr ""
+set test "break func"
+gdb_test_multiple $test $test {
+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+)\r\n$gdb_prompt $" {
+ set b_addr $expect_out(1,string)
+ pass $test
+ }
+ -re "Breakpoint \[0-9\]+ at (0x\[0-9a-f\]+): .*\r\n$gdb_prompt $" {
+ set b_addr $expect_out(1,string)
+ fail $test
+ }
+}
+verbose -log "b_addr=<$b_addr>"
+
+set p_addr ""
+set test "print func"
+gdb_test_multiple $test $test {
+ -re "\\$\[0-9\]+ = {<text variable, no debug info>} (0x\[0-9a-f\]+) <func>\r\n$gdb_prompt $" {
+ set p_addr $expect_out(1,string)
+ pass $test
+ }
+}
+verbose -log "p_addr=<$p_addr>"
+
+set test "break and print addresses match"
+if {$b_addr == $p_addr} {
+ pass $test
+} else {
+ fail $test
+}
hooks/post-receive
--
Repository for Project Archer.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-01-25 21:38 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-01-25 21:38 [SCM] archer-jankratochvil-misc: New testcase for: 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).