From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9660 invoked by alias); 29 Jan 2006 23:24:29 -0000 Received: (qmail 9649 invoked by uid 22791); 29 Jan 2006 23:24:28 -0000 X-Spam-Check-By: sourceware.org Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.31.1) with ESMTP; Sun, 29 Jan 2006 23:24:27 +0000 Received: from drow by nevyn.them.org with local (Exim 4.54) id 1F3LuC-0006f6-H9; Sun, 29 Jan 2006 18:24:24 -0500 Date: Mon, 30 Jan 2006 09:00:00 -0000 From: Daniel Jacobowitz To: John Williams Cc: gdb@sourceware.org Subject: Re: gdbserver+pthreads requires PTHREACE_SINGLESTEP? Message-ID: <20060129232424.GA25558@nevyn.them.org> Mail-Followup-To: John Williams , gdb@sourceware.org References: <43DD4DF8.2010203@itee.uq.edu.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <43DD4DF8.2010203@itee.uq.edu.au> User-Agent: Mutt/1.5.8i X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2006-01/txt/msg00326.txt.bz2 On Mon, Jan 30, 2006 at 09:21:28AM +1000, John Williams wrote: > Hello, > > Am I correct in thinking that the thread debug support in gdbserver > requires the kernel to implement the PTRACE_SINGLESTEP functionality? No, it does not. Please look at the reinsert_addr methods, for instance on MIPS. > The singlestep seems to be necessary because when, say , the > create_thread BP is hit, gdbserver wants to step over the first > instruction, reinsert the breakpoint, then continue as before. > > This creates a bit of a bind for me, since the CPU I'm targetting has no > HW single step capability - ptrace(PTRACE_SINGLESTEP) returns -EIO. > > Is there a workaround for non-singlestep targets, short of doing a full > kernel SW implementation of single stepping (yuck)? We can set a temporary breakpoint at the return address. In general, that is not viable, but we know that these particular breakpoints are (A) trivial empty functions, and (B) called by a single thread under a serializing lock. -- Daniel Jacobowitz CodeSourcery