From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12919 invoked by alias); 3 Oct 2008 02:33:25 -0000 Received: (qmail 12871 invoked by uid 22791); 3 Oct 2008 02:33:25 -0000 X-Spam-Check-By: sourceware.org Received: from igw1.br.ibm.com (HELO igw1.br.ibm.com) (32.104.18.24) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 03 Oct 2008 02:32:31 +0000 Received: from d24relay01.br.ibm.com (unknown [9.8.31.16]) by igw1.br.ibm.com (Postfix) with ESMTP id D50BC32C0A0 for ; Thu, 2 Oct 2008 23:00:50 -0300 (BRT) Received: from d24av02.br.ibm.com (d24av02.br.ibm.com [9.18.232.47]) by d24relay01.br.ibm.com (8.13.8/8.13.8/NCO v9.1) with ESMTP id m932WLqd2695204 for ; Thu, 2 Oct 2008 23:32:21 -0300 Received: from d24av02.br.ibm.com (loopback [127.0.0.1]) by d24av02.br.ibm.com (8.12.11.20060308/8.13.3) with ESMTP id m932WSTH008892 for ; Thu, 2 Oct 2008 23:32:28 -0300 Received: from [9.18.199.7] ([9.18.199.7]) by d24av02.br.ibm.com (8.12.11.20060308/8.12.11) with ESMTP id m932WSeR008886; Thu, 2 Oct 2008 23:32:28 -0300 Subject: Re: [PATCH 1/4] 'catch syscall' feature -- Architecture-independent part From: =?ISO-8859-1?Q?S=E9rgio?= Durigan =?ISO-8859-1?Q?J=FAnior?= To: Joel Brobecker Cc: gdb-patches@sourceware.org In-Reply-To: <20081002211256.GO3665@adacore.com> References: <1222798409.30389.23.camel@miki> <20081002211256.GO3665@adacore.com> Content-Type: text/plain; charset=iso-8859-1 Date: Fri, 03 Oct 2008 02:33:00 -0000 Message-Id: <1223001252.9858.11.camel@miki> Mime-Version: 1.0 X-Mailer: Evolution 2.22.3.1 Content-Transfer-Encoding: 8bit X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-10/txt/msg00078.txt.bz2 Hi Joel, On Thu, 2008-10-02 at 14:12 -0700, Joel Brobecker wrote: > > * breakpoint.h (enum bptype): Add syscall catchpoint and entry > > breakpoint types. > > (struct breakpoint): Add field 'syscall_number' (used to know > > which syscall triggered the catchpoint) and > > 'syscall_to_be_caught' (used to know which syscall we are trying > > to catch). > > I would really like to try to avoid creating a different enum for > each catchpoint type, if we can. See for instance how I implemented > Ada exception catchpoints: > > http://www.sourceware.org/ml/gdb-patches/2007-01/msg00102.html > > Do you think we could leverage on the "breakpoint_ops" structure > to implement this feature? Daniel, you know this part of the code > really well, what do you think? > > Obviously, his feature is a different kind of beast than Ada exception > catchpoints (which behind the scene is just an elaborated breakpoint). > So he won't be able to use the bp_breakpoint kind I used. Actually, > I don't see any bptype kind that could be used, so we'll have to create > one, but if the name could be generic enough to be used in other > circumstances. If I understood correctly, you think it's better to create a "generic" bptype so that not only "catch syscall" can use it, right? That, or figure out some other way to use "breakpoint_ops" in order to identify if the catchpoint is a syscall one. Is it? The way I see, there's no problem to implement "catch syscall" using another way. However, and I think you already know that, the "catch fork", "catch vfork" and "catch exec" are implemented using an entry on "enum bptype" (and that's specific why I've chosen to do this). Do you think we should change this, too? > Similarly, the breakpoint_ops structure might need to be extended > a bit, to provide methods that would insert/remove the catchpoint. I'm not sure if I understood this part correctly. Maybe my GDB-fu isn't good enought yet :-). I'll take a look at breakpoint_ops to see if I can understand better what you want. Thanks for the review, by the way. Regards, -- Sérgio Durigan Júnior Linux on Power Toolchain - Software Engineer Linux Technology Center - LTC IBM Brazil