From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19036 invoked by alias); 9 Aug 2008 18:49:03 -0000 Received: (qmail 19024 invoked by uid 22791); 9 Aug 2008 18:49:02 -0000 X-Spam-Check-By: sourceware.org Received: from hiauly1.hia.nrc.ca (HELO hiauly1.hia.nrc.ca) (132.246.100.193) by sourceware.org (qpsmtpd/0.31) with ESMTP; Sat, 09 Aug 2008 18:48:28 +0000 Received: by hiauly1.hia.nrc.ca (Postfix, from userid 1000) id 7019B4DCB; Sat, 9 Aug 2008 14:48:24 -0400 (EDT) Date: Sat, 09 Aug 2008 18:49:00 -0000 From: John David Anglin To: Pedro Alves Cc: gdb-patches@sourceware.org Subject: Re: ttrace: Protocal error Message-ID: <20080809184823.GA296@hiauly1.hia.nrc.ca> Reply-To: John David Anglin References: <20080808201457.3064B4EBE@hiauly1.hia.nrc.ca> <200808091551.17013.pedro@codesourcery.com> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="FL5UXtIhxfXey3p5" Content-Disposition: inline In-Reply-To: <200808091551.17013.pedro@codesourcery.com> User-Agent: Mutt/1.5.16 (2007-06-09) Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-08/txt/msg00250.txt.bz2 --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1661 On Sat, 09 Aug 2008, Pedro Alves wrote: > If you were really in a TARGET_WAITKIND_SYSCALL_ENTRY, this would be > at least the second resume after the lwp exit. > Maybe I am reading the backtrace wrong though. If you have the patience, > showing what GDB outputs when you do a "run" after setting > "set debug infrun 1" would help. Attached. Ignoring protocol errors seems to work. Used the following. Note there is a conflict with your change. Index: inf-ttrace.c =================================================================== RCS file: /cvs/src/src/gdb/inf-ttrace.c,v retrieving revision 1.30 diff -u -3 -p -r1.30 inf-ttrace.c --- inf-ttrace.c 9 Jul 2008 22:23:05 -0000 1.30 +++ inf-ttrace.c 9 Aug 2008 18:35:51 -0000 @@ -787,12 +804,16 @@ inf_ttrace_kill (void) static int inf_ttrace_resume_callback (struct thread_info *info, void *arg) { - if (!ptid_equal (info->ptid, inferior_ptid)) + /* There is a race condition in detecting when a thread is stopped. + So, we need to resume "dying" threads and ignore protocol errors + that occur from resuming threads that aren't stopped. */ + if (!ptid_equal (info->ptid, inferior_ptid) && !is_exited (info->ptid)) { pid_t pid = ptid_get_pid (info->ptid); lwpid_t lwpid = ptid_get_lwp (info->ptid); - if (ttrace (TT_LWP_CONTINUE, pid, lwpid, TT_NOPC, 0, 0) == -1) + if (ttrace (TT_LWP_CONTINUE, pid, lwpid, TT_NOPC, 0, 0) == -1 + && errno != EPROTO) perror_with_name (("ttrace")); } Dave -- J. David Anglin dave.anglin@nrc-cnrc.gc.ca National Research Council of Canada (613) 990-0752 (FAX: 952-6602) --FL5UXtIhxfXey3p5 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="vla6.dbg.2" Content-length: 1427 (gdb) r The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /mnt/gnu/gcc/objdir/hppa2.0w-hp-hpux11.11/libgomp/testsuite/vla6.x3g infrun: wait_for_inferior (treat_exec_as_sigtrap=1) infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x91d0 infrun: quietly stopped infrun: stop_stepping infrun: resume (step=0, signal=0), stepping_over_breakpoint=0 infrun: wait_for_inferior (treat_exec_as_sigtrap=1) infrun: infwait_normal_state infrun: TARGET_WAITKIND_STOPPED infrun: stop_pc = 0x19f8 infrun: quietly stopped infrun: stop_stepping warning: Private mapping of shared library text was not specified by the executable; setting a breakpoint in a shared library which is not privately mapped will not work. See the HP-UX 11i v3 chatr manpage for methods to privately map shared library text. infrun: proceed (addr=0xffffffff, signal=0, step=0) infrun: resume (step=0, signal=0), stepping_over_breakpoint=0 infrun: wait_for_inferior (treat_exec_as_sigtrap=0) [New process 5170, lwp 7674424] infrun: infwait_normal_state infrun: TARGET_WAITKIND_SPURIOUS infrun: resume (step=0, signal=0), stepping_over_breakpoint=0 infrun: prepare_to_wait [process 5170, lwp 7674424 exited] infrun: infwait_normal_state infrun: TARGET_WAITKIND_SPURIOUS infrun: resume (step=0, signal=0), stepping_over_breakpoint=0 0xc00268dc in ?? () ttrace: Protocol error. --FL5UXtIhxfXey3p5--