public inbox for archer-commits@sourceware.org
help / color / mirror / Atom feed
From: jkratoch@sourceware.org
To: archer-commits@sourceware.org
Subject: [SCM]  archer-jankratochvil-misc: New testcase for:
Date: Sun, 25 Jan 2009 21:38:00 -0000	[thread overview]
Message-ID: <20090125213845.18967.qmail@sourceware.org> (raw)

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.


                 reply	other threads:[~2009-01-25 21:38 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090125213845.18967.qmail@sourceware.org \
    --to=jkratoch@sourceware.org \
    --cc=archer-commits@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).