This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Fix PR gdb/17016: Expect for probe "map_complete" instead of "rtld_map_complete"


This commit fixes PR gdb/17016.  It could be considered to be obvious,
but I am sending to the mailing list for approval either way...

The problem, described by Pedro, is that a specific test on
gdb.threads/dlopen-libpthread.exp is XFAILing.  The test is:

  XFAIL: gdb.threads/dlopen-libpthread.exp: info probes all rtld rtld_map_complete

According to Pedro, he was not seeing this failure on Fedora 17, but
is now seeing it on Fedora 20.  This has been caused by a difference
between a Fedora-local glibc patch and an upstream glibc patch,
submitted by Gary in 2012.

Back then, Gary submitted this patch to glibc upstream:

  <https://sourceware.org/ml/libc-alpha/2012-06/msg00690.html>

Which implemented the SDT probes on the runtime linker.  Note that the
initial patch included the "rtld_" prefix on the probes' names.
Roland McGrath asked him to remove this prefix, and this is what was
pushed to the repo:

  <https://sourceware.org/ml/libc-alpha/2012-06/msg00723.html>

  commit 815e6fa3e010628f77838abec18692cbfeb60809
  Author: Gary Benson <gbenson@redhat.com>
  Date:   Thu Jul 26 11:03:35 2012 +0100

      Add SystemTap static probes to the runtime linker.  [BZ #14298]

Gary and Jan also added the gdb.threads/dlopen-libpthread.exp file later on GDB:

  commit a29a3fb7a350b70ec755b1964d2830094314dba8
  Author: Gary Benson <gary@redhat.com>
  Date:   Tue Jun 4 13:23:32 2013 +0000

      2013-06-04  Jan Kratochvil  <jan.kratochvil@redhat.com>
	      Gary Benson  <gbenson@redhat.com>

	  * lib/gdb.exp (build_executable_from_specs): Use gdb_compile_pthread,
	  gdb_compile_shlib or gdb_compile_shlib_pthreads where appropriate.
	  * lib/prelink-support.exp (build_executable_own_libs): Allow INTERP
	  to be set to "no" to indicate that no ld.so copy should be made.
	  * gdb.base/break-interp.exp (solib_bp): New constant.
	  (reach_1): Use the above instead of "_dl_debug_state".
	  (test_attach): Likewise.
	  (test_ld): Likewise.
	  * gdb.threads/dlopen-libpthread.exp: New file.
	  * gdb.threads/dlopen-libpthread.c: Likewise.
	  * gdb.threads/dlopen-libpthread-lib.c: Likewise.
	  * gdb.base/solib-corrupted.exp: Disable test if GDB is using probes.

And this file is also using the "rtld_" prefix when trying to match
the glibc probe (probably because they were using a Fedora glibc with
the first patch applied, see below).

However, on the Fedora land, we included Gary's first patch on the
glibc package for Fedora 17:

  <http://pkgs.fedoraproject.org/cgit/glibc.git/tree/glibc-rh179072.patch?h=f17>

And now, 2 years later, this local patch is obviously not needed
anymore, because upstream glibc already has the necessary patch in
it.  But we forgot to update our local testcase, so that is what this
patch does.

OK to apply?

gdb/testsuite/ChangeLog:
2014-09-24  Sergio Durigan Junior  <sergiodj@redhat.com>

	PR gdb/17016
	* gdb.threads/dlopen-libpthread.exp: Adjust match to probe
	"map_complete" instead of "rtld_map_complete.
---
 gdb/testsuite/gdb.threads/dlopen-libpthread.exp | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
index f0e3358..eaff8ca 100644
--- a/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
+++ b/gdb/testsuite/gdb.threads/dlopen-libpthread.exp
@@ -41,9 +41,9 @@ if { ![runto_main] } {
     return -1
 }
 
-set test "info probes all rtld rtld_map_complete"
+set test "info probes all rtld map_complete"
 gdb_test_multiple $test $test {
-    -re "\[ \t\]rtld_map_complete\[ \t\]+0x\[0-9a-f\]+.*\r\n$gdb_prompt $" {
+    -re "\[ \t\]map_complete\[ \t\]+0x\[0-9a-f\]+.*\r\n$gdb_prompt $" {
 	pass $test
     }
     -re "No probes matched\\.\r\n$gdb_prompt $" {
-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]