Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Jim Blandy <jimb@redhat.com>
To: gdb-patches@sources.redhat.com
Subject: RFA: adapt gdb.threads/linux-dp.exp to remote protocol and NPTL
Date: Fri, 29 Oct 2004 20:54:00 -0000	[thread overview]
Message-ID: <vt2sm7xfdu3.fsf@zenia.home> (raw)


The remote protocol doesn't announce thread creation.  NPTL has no
manager threads.  With this patch, linux-dp has no failures debugging
NPTL programs over the remote protocol.

2004-10-29  Jim Blandy  <jimb@redhat.com>

	* gdb.threads/linux-dp.exp: Tolerate the absence of "[New thread]"
	messages, and the absence of the manager thread.

Index: gdb/testsuite/gdb.threads/linux-dp.exp
===================================================================
RCS file: /cvs/src/src/gdb/testsuite/gdb.threads/linux-dp.exp,v
retrieving revision 1.9
diff -c -r1.9 linux-dp.exp
*** gdb/testsuite/gdb.threads/linux-dp.exp	14 May 2003 19:36:56 -0000	1.9
--- gdb/testsuite/gdb.threads/linux-dp.exp	29 Oct 2004 05:10:41 -0000
***************
*** 91,97 ****
  	    return -1
  	}
  	-re "$gdb_prompt $" {
! 	    fail "create philosopher: $i"
  	}
  	timeout {
  	    fail "(timeout) create philosopher: $i"
--- 91,102 ----
  	    return -1
  	}
  	-re "$gdb_prompt $" {
! 	    # We used to fail here, but not all targets announce new
! 	    # threads as they are created.  For example, the GDB
! 	    # remote protocol target only finds out about threads when
! 	    # they actually report some event like a breakpoint hit,
! 	    # or when the user types 'info threads'.
! 	    unresolved "create philosopher: $i"
  	}
  	timeout {
  	    fail "(timeout) create philosopher: $i"
***************
*** 99,109 ****
      }
  }
  
! if {$expect_manager} {
!     set nthreads 7
! } else {
!     set nthreads 6
! }
  
  # Run until there are some threads.
  gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"]
--- 104,110 ----
      }
  }
  
! set nthreads 6
  
  # Run until there are some threads.
  gdb_breakpoint [gdb_get_line_number "linuxthreads.exp: info threads 2"]
***************
*** 112,118 ****
  for {set i $nthreads} {$i > 0} {incr i -1} {
      append info_threads_ptn "$i Thread .*"
  }
! gdb_test "info threads" $info_threads_ptn "info threads 2"
  
  # Try setting a thread-specific breakpoint.
  gdb_breakpoint "print_philosopher thread 5"
--- 113,163 ----
  for {set i $nthreads} {$i > 0} {incr i -1} {
      append info_threads_ptn "$i Thread .*"
  }
! append info_threads_ptn "\[\r\n\]+$gdb_prompt $"
! set info_threads_manager_ptn "[expr $nthreads + 1] Thread .*$info_threads_ptn"
! 
! gdb_test_multiple "info threads" "info threads 2" {
!     -re "$info_threads_manager_ptn" {
! 	# We did see a manager thread.  Check that against what we expected.
! 	switch -exact -- $expect_manager {
! 	    -1 {
! 		# We weren't sure whether to expect a manager thread.
! 		pass "info threads 2"
! 	    }
! 	    1 {
! 		# We were expecting a manager thread.
! 		pass "info threads 2"
! 	    }
! 	    0 {
! 		# We were not expecting to see the manager thread.
! 		fail "info threads 2"
! 	    }
! 	}
! 	set expect_manager 1
! 	incr nthreads
!     }
!     -re "$info_threads_ptn" {
! 	# We did not see a manager thread.  Check that against what we
! 	# expected.
! 	switch -exact -- $expect_manager {
! 	    -1 {
! 		# We weren't sure whether to expect a manager thread.
! 		# Don't expect it from here on out.
! 		pass "info threads 2"
! 	    }
! 	    1 {
! 		# We were expecting a manager thread, but we didn't see one.
! 		fail "info threads 2"
! 	    }
! 	    0 {
! 		# We were not expecting to see the manager thread.
! 		pass "info threads 2"
! 	    }
! 	}
! 	set expect_manager 0
!     }
! }
! 
  
  # Try setting a thread-specific breakpoint.
  gdb_breakpoint "print_philosopher thread 5"


             reply	other threads:[~2004-10-29 20:54 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-10-29 20:54 Jim Blandy [this message]
2005-01-10 18:22 Jim Blandy

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=vt2sm7xfdu3.fsf@zenia.home \
    --to=jimb@redhat.com \
    --cc=gdb-patches@sources.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