From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30913 invoked by alias); 20 Oct 2011 20:41:21 -0000 Received: (qmail 30903 invoked by uid 22791); 20 Oct 2011 20:41:20 -0000 X-SWARE-Spam-Status: No, hits=-7.2 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 20 Oct 2011 20:41:04 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9KKf3Wr020882 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Thu, 20 Oct 2011 16:41:03 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9KKf2wb018547; Thu, 20 Oct 2011 16:41:02 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p9KKf12M017434; Thu, 20 Oct 2011 16:41:01 -0400 From: Tom Tromey To: Kevin Pouget Cc: gdb-patches@sourceware.org Subject: Re: [RFC] Python Finish Breakpoints References: Date: Thu, 20 Oct 2011 20:58:00 -0000 In-Reply-To: (Kevin Pouget's message of "Mon, 30 May 2011 05:28:28 -0400") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain 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: 2011-10/txt/msg00579.txt.bz2 >>>>> "Kevin" == Kevin Pouget writes: Tom> You need to store a gdb.Type wrapper. Tom> A 'struct type' can also be invalidated when an objfile is destroyed. Kevin> I wouldn't mind, but I can't see how gdb.Type ensures validity, as far Kevin> as I've seen, there is no "is_valid" method and I can't and no further Kevin> verification during the Python -> C translation: When an objfile is destroyed, py-type.c:save_objfile_types is called. This makes a copy of the struct type underlying any relevant Type object. [ out_of_scope_notif ] Kevin> - avoid calling `out_of_scope' every normal_stop when the breakpoint Kevin> is not anymore in the callstack It seems to me that manually managing this is not the best we could do. I was re-reading the code and I realized that this isn't actually working the way I had remembered it working: +A @fdb{finish breakpoint} is a breakpoint set at the return address of +a frame, based on the "finish command. @code{gdb.FinishBreakpoint} extends +@code{gdb.Breakpoint} This approach is fine; but once a frame is gone, it is gone -- we should just destroy the breakpoint at that point. Maybe this would make the internal logic simpler as well. (I had been laboring under the misconception that a finish breakpoint took a linespec and then did the bookkeeping of "note function entry / set a new breakpoint" -- but actually I like your simpler approach better, and the latter can be done more easily purely in Python.) Tom