From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22597 invoked by alias); 12 Jun 2005 00:23:01 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 22584 invoked by uid 22791); 12 Jun 2005 00:22:55 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Sun, 12 Jun 2005 00:22:55 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DhGFY-00036P-JS; Sat, 11 Jun 2005 20:22:52 -0400 Date: Sun, 12 Jun 2005 00:23:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: tronics93-gdb@yahoo.com, gdb@sources.redhat.com Subject: Re: gdb 6.3 misses breakpoint on Linux when inferior does clone() Message-ID: <20050612002251.GA11866@nevyn.them.org> Mail-Followup-To: Mark Kettenis , tronics93-gdb@yahoo.com, gdb@sources.redhat.com References: <20050531170523.45257.qmail@web31913.mail.mud.yahoo.com> <20050601132331.GA19300@nevyn.them.org> <200506112331.j5BNVc4L020335@elgar.sibelius.xs4all.nl> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200506112331.j5BNVc4L020335@elgar.sibelius.xs4all.nl> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00107.txt.bz2 On Sun, Jun 12, 2005 at 01:31:38AM +0200, Mark Kettenis wrote: > Date: Wed, 1 Jun 2005 09:23:31 -0400 > From: Daniel Jacobowitz > > On Tue, May 31, 2005 at 10:05:22AM -0700, tronics93-gdb@yahoo.com wrote: > > The following code snippet gets the flags passed in to clone() (on > > x86): > > > > unsigned long regs[FRAME_SIZE]; > > > > if (ptrace(PTRACE_GETREGS, pid, 0, ®s) < 0) > > perror("ptrace_getregs failed:"); > > > > printf("syscall=%d, arg1=%#x, arg2=%#x\n", regs[ORIG_EAX], > > regs[EBX], regs[ECX]); > > Only if you're stopped at the clone. Hmm. Good point; perhaps we can > recover them from registers when we receive the clone event. > > But having to do that in a machine-dependent manner really sucks... > > It could probably be implemented if someone spent the time. > > ...so that time is probably better spent on implementing the proper > machine-independent functionality in the Linux kernel! Except that what we implement in GDB, we don't need to test for at runtime and handle dependencies on the kernel version. For the special case of CLONE_VM there's a third option, which may be superior: write to one thread's memory and see where the value shows up. -- Daniel Jacobowitz CodeSourcery, LLC