From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17415 invoked by alias); 1 Jun 2005 13:23:41 -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 17401 invoked by uid 22791); 1 Jun 2005 13:23:34 -0000 Received: from nevyn.them.org (HELO nevyn.them.org) (66.93.172.17) by sourceware.org (qpsmtpd/0.30-dev) with ESMTP; Wed, 01 Jun 2005 13:23:34 +0000 Received: from drow by nevyn.them.org with local (Exim 4.50) id 1DdTBz-00052r-OL; Wed, 01 Jun 2005 09:23:31 -0400 Date: Wed, 01 Jun 2005 13:23:00 -0000 From: Daniel Jacobowitz To: tronics93-gdb@yahoo.com Cc: gdb@sources.redhat.com Subject: Re: gdb 6.3 misses breakpoint on Linux when inferior does clone() Message-ID: <20050601132331.GA19300@nevyn.them.org> Mail-Followup-To: tronics93-gdb@yahoo.com, gdb@sources.redhat.com References: <20050531170523.45257.qmail@web31913.mail.mud.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050531170523.45257.qmail@web31913.mail.mud.yahoo.com> User-Agent: Mutt/1.5.8i X-SW-Source: 2005-06/txt/msg00002.txt.bz2 On Tue, May 31, 2005 at 10:05:22AM -0700, tronics93-gdb@yahoo.com wrote: > >> The kernel does not provide any interface for GDB to know whether > or > >> not a clone syscall has used CLONE_VM. > >> > >> [Satish] Doesn't ptrace(PTRACE_GETREGS,...) provide that > information >>? Or is that arch. specific ? > > >No, it does not. > > 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. It could probably be implemented if someone spent the time. -- Daniel Jacobowitz CodeSourcery, LLC