From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30649 invoked by alias); 16 Nov 2007 22:24:52 -0000 Received: (qmail 30638 invoked by uid 22791); 16 Nov 2007 22:24:51 -0000 X-Spam-Check-By: sourceware.org Received: from main.gmane.org (HELO ciao.gmane.org) (80.91.229.2) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 16 Nov 2007 22:24:48 +0000 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1It9cB-0000Qj-M1 for gdb-patches@sources.redhat.com; Fri, 16 Nov 2007 22:24:43 +0000 Received: from 77.246.241.246 ([77.246.241.246]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Nov 2007 22:24:43 +0000 Received: from ghost by 77.246.241.246 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 16 Nov 2007 22:24:43 +0000 To: gdb-patches@sources.redhat.com From: Vladimir Prus Subject: Re: delete_breakpoint: don't try to insert other breakpoints Date: Fri, 16 Nov 2007 22:24:00 -0000 Message-ID: References: <200711142324.11319.vladimir@codesourcery.com> <18238.3787.459206.333769@kahikatea.snap.net.nz> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7Bit User-Agent: KNode/0.10.4 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: 2007-11/txt/msg00344.txt.bz2 Nick Roberts wrote: > > > Eli, how is code which will never be reached a feature? > > > > The code is never reached only as long as breakpoints are deleted > > synchronously (because we remove the breakpoint instruction as soon as > > the inferior stops). > > I've run the testsuite using my asynchronous version of GDB, with and > without Vladimir's change and, in fact, there was one less failure and > seven more passes with it. Notably, the extra passes with > print-threads.exp involved breakpoints. > > Of course, this doesn't prove anything, and there may be a test that > shows the contrary, but it might provide some context. In fact, I've run across this code today while doing something different, and I now believe it's even not theoretically unused -- it's wrong. There are two possible cases for having breakpoints inserted when doing delete_breakpoint: 1. Just not removing breakpoints from inferior when we stop. 2. Ability to delete breakpoints from inferior while inferior is actually running. (1) does not seem useful for anything. For (2), delete_breakpoint will: - Remove the breakpoint from inferior - See if there's another breakpoint at the same address - Try to insert it As the result, there's a window when a breakpoint that should be inserted is actually not. - Volodya