From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2621 invoked by alias); 2 Dec 2014 13:14:46 -0000 Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org Received: (qmail 2606 invoked by uid 89); 2 Dec 2014 13:14:45 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Tue, 02 Dec 2014 13:14:44 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id sB2DEeBC007670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 2 Dec 2014 08:14:41 -0500 Received: from localhost.localdomain (ovpn-112-31.ams2.redhat.com [10.36.112.31]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id sB2DEdHU015709; Tue, 2 Dec 2014 08:14:39 -0500 Message-ID: <547DBB3E.80601@redhat.com> Date: Tue, 02 Dec 2014 13:14:00 -0000 From: Phil Muldoon MIME-Version: 1.0 To: Armando Miraglia , gdb@sourceware.org Subject: Re: Custom catchpoints with Python API References: In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-IsSubscribed: yes X-SW-Source: 2014-12/txt/msg00003.txt.bz2 On 02/12/14 10:46, Armando Miraglia wrote: > Hi everybody. > > this is my first intervention here on the mainling list, so I hope I > will be asking the right question in the right place :) > > First of all, thanks a lot for the great job done with GDB. > > As the subject suggests, my question relates the Python API of GDB. I > am writing a GDB Python extension for a University project and so far > I managed to do a lot. However, I am having difficulties finding a way > to create custom Catchpoints similarly to what I have been doing with > Breakpoints. I see that extending gdb.Breakpoints I can create custom > breakpoints and watchpoints but I have not managed to find a way to > instantiate a class for a catchpoint that invokes my own code. > Is this even possible right now? No, not right now. Catchpoints internally extend something called breakpoint operations (basically a struct of function pointers that "do something" when a catchpoint is triggered). There was a nascent patch to do this in Python some years ago, but it was deemed the internal breakpoint operations structure was not sufficiently evolved to expose to the Python API. There was supposed to be a breakpoint refactor at one point, but I am not sure if that ever happened. Cheers Phil