From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 22183 invoked by alias); 13 Mar 2012 15:03:09 -0000 Received: (qmail 22083 invoked by uid 22791); 13 Mar 2012 15:03:08 -0000 X-SWARE-Spam-Status: No, hits=-6.7 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,TW_CP,T_RP_MATCHES_RCVD 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; Tue, 13 Mar 2012 15:02:54 +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 q2DF2WUU006817 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 13 Mar 2012 11:02:32 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id q2DF2VXs001058; Tue, 13 Mar 2012 11:02:32 -0400 Message-ID: <4F5F6187.50209@redhat.com> Date: Tue, 13 Mar 2012 15:03:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.1) Gecko/20120216 Thunderbird/10.0.1 MIME-Version: 1.0 To: Joel Brobecker CC: gdb-patches@sourceware.org Subject: Re: [RFA] Problem after hitting breakpoint on Windows (with GDBserver) References: <1331602756-23567-1-git-send-email-brobecker@adacore.com> <1331602756-23567-2-git-send-email-brobecker@adacore.com> In-Reply-To: <1331602756-23567-2-git-send-email-brobecker@adacore.com> Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit 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-03/txt/msg00438.txt.bz2 On 03/13/2012 01:39 AM, Joel Brobecker wrote: > + if (val == 0) > + memcpy (bp_tgt->shadow_contents, readbuf, bp_tgt->placed_size); > > /* Write the breakpoint. */ > if (val == 0) Merge? > + As a limitation, MYADDR must not be the shadow_contents buffer of one I wouldn't call it a limitation; it's more a design choice thing, like memcpy doesn't handle overlapping buffers. Otherwise this is fine with me. An assertion in breakpoint_xfer_memory to catch that READBUF or WRITEBUF doesn't overlap bp->target_info.shadow_contents would be nice. We could even avoid the new comments in target.h that way, as there's be no way to write a new hook that doesn't trip on it instantly. As we discussed yesterday on IRC, the current code always reinserts locations, which means that gdb > 7.4 now does an extra read off of inferior memory to fill the shadow on breakpoint re-sets. That'd be possible to avoid (and avoiding this whole problem along the way), though I think Joel's patch is a good one even knowing that. -- Pedro Alves