From owner-freebsd-hackers@FreeBSD.ORG Fri May 14 11:53:22 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 37848106564A for ; Fri, 14 May 2010 11:53:22 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [65.122.17.42]) by mx1.freebsd.org (Postfix) with ESMTP id 04A788FC21 for ; Fri, 14 May 2010 11:53:22 +0000 (UTC) Received: from bigwig.baldwin.cx (66.111.2.69.static.nyinternet.net [66.111.2.69]) by cyrus.watson.org (Postfix) with ESMTPSA id 92B4646B92; Fri, 14 May 2010 07:53:21 -0400 (EDT) Received: from John-Baldwins-Macbook-Pro.local (localhost [IPv6:::1]) by bigwig.baldwin.cx (Postfix) with ESMTPA id 9971B8A021; Fri, 14 May 2010 07:53:20 -0400 (EDT) Message-ID: <4BED2B27.2020902@FreeBSD.org> Date: Fri, 14 May 2010 06:51:19 -0400 From: John Baldwin User-Agent: Thunderbird 2.0.0.24 (Macintosh/20100228) MIME-Version: 1.0 To: Ali Polatel References: <20100508111509.GB8186@harikalardiyari> <20100508123626.GC83316@deviant.kiev.zoral.com.ua> <20100509053303.GD8186@harikalardiyari> <20100509135807.GH83316@deviant.kiev.zoral.com.ua> <20100509182851.GE8186@harikalardiyari> <20100509214359.GJ83316@deviant.kiev.zoral.com.ua> <20100510164847.GF8186@harikalardiyari> <20100510170947.GP83316@deviant.kiev.zoral.com.ua> <20100511103500.GH8186@harikalardiyari> In-Reply-To: <20100511103500.GH8186@harikalardiyari> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.0.1 (bigwig.baldwin.cx); Fri, 14 May 2010 07:53:20 -0400 (EDT) X-Virus-Scanned: clamav-milter 0.95.1 at bigwig.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-2.6 required=4.2 tests=BAYES_00,NO_RELAYS autolearn=ham version=3.2.5 X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on bigwig.baldwin.cx Cc: Kostik Belousov , freebsd-hackers@freebsd.org Subject: Re: Ability to tell the difference between normal and syscall traps X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 14 May 2010 11:53:22 -0000 Ali Polatel wrote: > Kostik Belousov yazmış: >> On Mon, May 10, 2010 at 07:48:47PM +0300, Ali Polatel wrote: >>> Another question is how hard is it to implement PL_EVENT_EXEC? >>> This could be useful for truss as it updates the execution type of the >>> process after successful execve() calls afaict. >> Is this needed ? The question is not rhetorical, I am trying to >> understand what prevents use of PT_TO_SCE and checking the syscall >> number ? You would screen for SYS_execve or SYS_fexecve and >> reset the debugger state on SIGTRAP that is supplied to the debugger >> before first instruction of new image is executed. >> > > Not really needed, just cleaner imo. As system call numbers may be > different for different execution types and you need to look it up from > a table using a string as argument which is slow. I agree that this would be cleaner. Having worked on the ptrace/procfs stuff in other tools like strace and truss, exec truly is an important event to a debugger aside from just being another system call as it signals that the address space has been changed. -- John Baldwin