This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
Re: gdbserver+pthreads requires PTHREACE_SINGLESTEP?
- From: Daniel Jacobowitz <drow at false dot org>
- To: John Williams <jwilliams at itee dot uq dot edu dot au>
- Cc: gdb at sourceware dot org
- Date: Sun, 29 Jan 2006 18:24:24 -0500
- Subject: Re: gdbserver+pthreads requires PTHREACE_SINGLESTEP?
- References: <43DD4DF8.2010203@itee.uq.edu.au>
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