Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Alexandre Oliva <aoliva@redhat.com>
To: gdb-patches@sourceware.org
Subject: Re: Prelink.exp troubles
Date: Tue, 07 Mar 2006 08:38:00 -0000	[thread overview]
Message-ID: <orirqqrgnj.fsf@free.oliva.athome.lsd.ic.unicamp.br> (raw)
In-Reply-To: <20060304151105.GE20187@nevyn.them.org> (Daniel Jacobowitz's message of "Sat, 4 Mar 2006 10:11:05 -0500")

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

On Mar  4, 2006, Daniel Jacobowitz <drow@false.org> wrote:

> Hmm, two things: I don't think a WARNING is appropriate (there's
> nothing wrong), how about just an UNTESTED?

Sure.

> And, when matching
> patterns in gdb_test_multiple (the same was true in gdb_expect)
> it's important to anchor the end of the pattern to the GDB prompt.
> Otherwise that prompt might not be consumed by expect, causing
> new tests added at the end of the file to fail.

Oh?  I thought gdb_test_multiple would only exit when it got to a
prompt or something, so it would be consumed automatically.  Is that
not so?

> If you agree about the UNTESTED, with those changes it's fine to check
> in.  My test runs thank you.

Here's what I'm checking in, in the hopes that the archoring you
suggested above is not needed, otherwise I'll take care of it in a
subsequent patch.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: gdb-prelink-test-tweak.patch --]
[-- Type: text/x-patch, Size: 4734 bytes --]

for gdb/testsuite/ChangeLog
from  Alexandre Oliva  <aoliva@redhat.com>

	* gdb.base/prelink.c, gdb.base/prelink-lib.c: Update FSF address.
	* gdb.base/prelink.exp: Likewise.  Add -q to prelink runs.
	Rename executable to prelinkt.  Don't re-prelink if we didn't
	get a core file.  Test prelink -u exit status to tell whether
	prelinking failed.  Use gdb_test_multiple.

Index: gdb/testsuite/gdb.base/prelink.exp
===================================================================
--- gdb/testsuite/gdb.base/prelink.exp.orig	2006-03-07 01:41:02.000000000 -0300
+++ gdb/testsuite/gdb.base/prelink.exp	2006-03-07 01:51:07.000000000 -0300
@@ -12,10 +12,10 @@
 #
 # 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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 
 # Please email any bugs, comments, and/or additions to this file to:
-# bug-gdb@prep.ai.mit.edu
+# bug-gdb@gnu.org
 
 # This file was written by Alexandre Oliva <aoliva@redhat.com>
 
@@ -40,8 +40,6 @@ if {$gcc_compiled == 0} {
 }
 
 set testfile "prelink"
-set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
 
 set libsrcfile ${testfile}-lib.c
 set libfile ${objdir}/${subdir}/${testfile}.so
@@ -50,13 +48,13 @@ if { [gdb_compile "${srcdir}/${subdir}/$
     return -1
 }
 
-if {[catch "system \"prelink -NR ${libfile}\""] != 0} {
+if {[catch "system \"prelink -qNR ${libfile}\""] != 0} {
     # Maybe we don't have prelink.
     return -1
 }
 
 set srcfile ${testfile}.c
-set binfile ${objdir}/${subdir}/${testfile}
+set binfile ${objdir}/${subdir}/${testfile}t
 if { [gdb_compile "${srcdir}/${subdir}/${srcfile} ${libfile}" "${binfile}" executable [list debug "additional_flags=-Wl,-rpath,${objdir}/${subdir}"]] != ""} {
     return -1;
 }
@@ -82,9 +80,6 @@ if { $found == 0 } {
     }
 }
 
-catch "system \"prelink -u ${libfile}\""
-catch "system \"prelink -NR ${libfile}\""
-
 # Try to clean up after ourselves.
 remote_file build delete [file join $coredir coremmap.data]
 remote_exec build "rmdir $coredir"
@@ -94,6 +89,12 @@ if { $found == 0  } {
     return 0
 }
 
+if {[catch "system \"prelink -uN ${libfile}\""] != 0} {
+    untested "${libfile} was not prelinked, maybe system libraries are not prelinked?"
+    return 0
+}
+catch "system \"prelink -qNR ${libfile}\""
+
 # Start with a fresh gdb
 
 gdb_exit
@@ -101,26 +102,12 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
-set oldtimeout $timeout
-set timeout [expr "$timeout + 60"]
-verbose "Timeout is now $timeout seconds" 2
-send_gdb "core-file $objdir/$subdir/prelink.core\n"
-gdb_expect {
-    -re "warning: \.dynamic section.*not at the expected address" {
-	pass "changed base address"
-    }
-    -re ".*$gdb_prompt $"	{ fail "changed base address" }
-    timeout 		{ fail "(timeout) changed base address" }
-}
-gdb_expect {
-    -re "warning: difference.*caused by prelink, adjusting" {
-	pass "prelink adjustment"
+set test "prelink"
+gdb_test_multiple "core-file $objdir/$subdir/prelink.core" "$test" {
+    -re "warning: \.dynamic section.*not at the expected address.*warning: difference.*caused by prelink, adjusting expectations." {
+	pass "$test"
     }
-    -re ".*$gdb_prompt $"	{ fail "prelink adjustment" }
-    timeout 		{ fail "(timeout) prelink adjustment" }
 }
-set timeout $oldtimeout
-verbose "Timeout is now $timeout seconds" 2
 
 gdb_exit
 
Index: gdb/testsuite/gdb.base/prelink-lib.c
===================================================================
--- gdb/testsuite/gdb.base/prelink-lib.c.orig	2006-03-07 01:41:02.000000000 -0300
+++ gdb/testsuite/gdb.base/prelink-lib.c	2006-03-07 01:41:48.000000000 -0300
@@ -14,7 +14,7 @@
 
    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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 */
 
 int
Index: gdb/testsuite/gdb.base/prelink.c
===================================================================
--- gdb/testsuite/gdb.base/prelink.c.orig	2006-03-07 01:41:02.000000000 -0300
+++ gdb/testsuite/gdb.base/prelink.c	2006-03-07 01:41:48.000000000 -0300
@@ -14,7 +14,7 @@
 
    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., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA.
 */
 
 #include <stdio.h>

[-- Attachment #3: Type: text/plain, Size: 249 bytes --]


-- 
Alexandre Oliva         http://www.lsd.ic.unicamp.br/~oliva/
Secretary for FSF Latin America        http://www.fsfla.org/
Red Hat Compiler Engineer   aoliva@{redhat.com, gcc.gnu.org}
Free Software Evangelist  oliva@{lsd.ic.unicamp.br, gnu.org}

  reply	other threads:[~2006-03-07  5:02 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-01 20:05 Daniel Jacobowitz
2006-03-03 14:49 ` Alexandre Oliva
2006-03-06 18:38   ` Daniel Jacobowitz
2006-03-07  8:38     ` Alexandre Oliva [this message]
2006-03-07 19:34       ` Daniel Jacobowitz
2006-03-09  4:40         ` Alexandre Oliva
2006-03-25  7:02           ` Daniel Jacobowitz

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=orirqqrgnj.fsf@free.oliva.athome.lsd.ic.unicamp.br \
    --to=aoliva@redhat.com \
    --cc=gdb-patches@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