Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>, gdb-patches@sourceware.org
Subject: Re: [patch] Sanity check PIE displacement (like the PIC one)
Date: Thu, 11 Feb 2010 23:16:00 -0000	[thread overview]
Message-ID: <20100211225722.GA6179@host0.dyn.jankratochvil.net> (raw)
In-Reply-To: <20100211222604.GA1465@caradoc.them.org>

On Thu, 11 Feb 2010 23:26:07 +0100, Daniel Jacobowitz wrote:
> On Thu, Feb 11, 2010 at 11:21:13PM +0100, Jan Kratochvil wrote:
> > The life-saver message is IMO "B" but the message(s) being discussed to be
> > removed is A1+A2.
> > 
> > Is the attached patch what everone agrees upon or have I not understood it?
> 
> Fine with me.  Or you could just use verbose.

OK, verbose may be more appropriate.

Made some additional text content changes, therefore asking for new approval.

.dynamic section for ".../gdb.base/prelink.so" at 0x38b38006c0 is not at the expected address 0x39bb6006c0, difference appears to be caused by prelink, adjusting expectations.

No regressions on {x86_64,x86_64-m32,i686}-fedora12-linux-gnu.


Thanks,
Jan


gdb/
2010-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* solib-svr4.c: (LM_ADDR_CHECK): Print successful prelink adjustment
	only if INFO_VERBOSE.  Use printf_unfiltered for it.  Add trailing dot.
	Print twice paddress for both successful and unsuccessful adjustment.

Gdb/testsuite/
2010-02-11  Jan Kratochvil  <jan.kratochvil@redhat.com>

	* gdb.base/prelink.exp (set verbose on): New.
	(prelink): Remove expected "warning: " prefixes.

--- a/gdb/solib-svr4.c
+++ b/gdb/solib-svr4.c
@@ -222,15 +222,21 @@ LM_ADDR_CHECK (struct so_list *so, bfd *abfd)
 	    {
 	      l_addr = l_dynaddr - dynaddr;
 
-	      warning (_(".dynamic section for \"%s\" "
-		     "is not at the expected address"), so->so_name);
-	      warning (_("difference appears to be caused by prelink, "
-			 "adjusting expectations"));
+	      if (info_verbose)
+		printf_unfiltered (_(".dynamic section for \"%s\" at %s "
+				     "is not at the expected address %s, "
+				     "difference appears to be caused "
+				     "by prelink, adjusting expectations.\n"),
+				 so->so_name,
+				 paddress (target_gdbarch, dynaddr),
+				 paddress (target_gdbarch, l_dynaddr));
 	    }
 	  else
-	    warning (_(".dynamic section for \"%s\" "
-		       "is not at the expected address "
-		       "(wrong library or version mismatch?)"), so->so_name);
+	    warning (_(".dynamic section for \"%s\" at %s "
+		       "is not at the expected address %s "
+		       "(wrong library or version mismatch?)"), so->so_name,
+		     paddress (target_gdbarch, dynaddr),
+		     paddress (target_gdbarch, l_dynaddr));
 	}
 
     set_addr:
--- a/gdb/testsuite/gdb.base/prelink.exp
+++ b/gdb/testsuite/gdb.base/prelink.exp
@@ -109,10 +109,13 @@ gdb_start
 gdb_reinitialize_dir $srcdir/$subdir
 gdb_load ${binfile}
 
+# Print the "adjusting expectations" message.
+gdb_test "set verbose on"
+
 set test "prelink"
 global gdb_prompt
 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.*$gdb_prompt $" {
+    -re "\.dynamic section.*not at the expected address.*difference.*caused by prelink, adjusting expectations.*$gdb_prompt $" {
 	pass "$test"
     }
 }


  reply	other threads:[~2010-02-11 23:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-02-01  1:20 Jan Kratochvil
2010-02-11 16:37 ` [ping] " Jan Kratochvil
2010-02-11 19:43 ` Tom Tromey
2010-02-11 20:05   ` Daniel Jacobowitz
2010-02-11 21:47     ` Tom Tromey
2010-02-11 22:21     ` Jan Kratochvil
2010-02-11 22:26       ` Daniel Jacobowitz
2010-02-11 23:16         ` Jan Kratochvil [this message]
2010-02-13 12:05         ` Jan Kratochvil
2010-02-13 20:14 ` [cancelled] " Jan Kratochvil

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=20100211225722.GA6179@host0.dyn.jankratochvil.net \
    --to=jan.kratochvil@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=tromey@redhat.com \
    /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