From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31256 invoked by alias); 7 Feb 2012 23:44:31 -0000 Received: (qmail 31245 invoked by uid 22791); 7 Feb 2012 23:44:30 -0000 X-SWARE-Spam-Status: No, hits=-1.2 required=5.0 tests=AWL,BAYES_00,MISSING_HEADERS X-Spam-Check-By: sourceware.org Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 07 Feb 2012 23:44:15 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1Ruuhq-0001re-Cv from Luis_Gustavo@mentor.com for gdb-patches@sourceware.org; Tue, 07 Feb 2012 15:44:14 -0800 Received: from NA1-MAIL.mgc.mentorg.com ([147.34.98.181]) by svr-orw-fem-01.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Feb 2012 15:44:14 -0800 Received: from [0.0.0.0] ([172.16.63.104]) by NA1-MAIL.mgc.mentorg.com with Microsoft SMTPSVC(6.0.3790.4675); Tue, 7 Feb 2012 15:44:13 -0800 Message-ID: <4F31B73A.7090606@mentor.com> Date: Tue, 07 Feb 2012 23:44:00 -0000 From: Luis Gustavo Reply-To: "Gustavo, Luis" User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.23) Gecko/20110922 Lightning/1.0b2 Thunderbird/3.1.15 MIME-Version: 1.0 CC: gdb-patches@sourceware.org Subject: Re: [PATCH] Fix breakpoint updates for multi-inferior References: <4F20610B.5010403@mentor.com> In-Reply-To: <4F20610B.5010403@mentor.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: 2012-02/txt/msg00094.txt.bz2 On 01/25/2012 06:07 PM, Luis Gustavo wrote: > Hi, > > While working on the target-side condition evaluation patch, i stumbled > upon the strange situation where GDB had more than a single "inserted" > location in a list with multiple duplicate locations. > > Further investigation showed that the logic for finding the first > inserted location at a specific address does not work when multiple > inferiors are being debugged. This code is inside > update_global_location_list (...). > > This is partly because we expect the list of locations to be sorted by > breakpoint numbers and addresses. > > Suppose we're going through locations at address FOO, and we already > defined the "first" for that set of locations. When a location does not > match the "first" location of that address, we then assume we've gone > past the locations at address FOO. This is correct for single inferiors. > > Now, consider a multi-inferior scenario and breakpoints with locations > on multiple inferiors. The code will fail to match two locations due to > the difference between the locations' program spaces, thus failing to > mark duplicate locations correctly. > > This patch solves this by updating the locations one program space at a > time, thus preventing multiple insertions of the same location. > > This bug shows up when doing multi-inferior debugging in GDBServer. You > will notice GDB sending multiple insert/remove requests for the same > address. > > OK? > > Luis Ping?