From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5345 invoked by alias); 27 Jul 2012 15:21:19 -0000 Received: (qmail 5334 invoked by uid 22791); 27 Jul 2012 15:21:18 -0000 X-SWARE-Spam-Status: No, hits=-7.5 required=5.0 tests=AWL,BAYES_00,KHOP_RCVD_UNTRUST,KHOP_THREADED,RCVD_IN_DNSWL_HI,RCVD_IN_HOSTKARMA_W,SPF_HELO_PASS,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; Fri, 27 Jul 2012 15:20:54 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id q6RFKOIs013930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 27 Jul 2012 11:20:25 -0400 Received: from [127.0.0.1] (ovpn01.gateway.prod.ext.ams2.redhat.com [10.39.146.11]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id q6RFKM3e002641; Fri, 27 Jul 2012 11:20:23 -0400 Message-ID: <5012B1B6.1030003@redhat.com> Date: Fri, 27 Jul 2012 15:21:00 -0000 From: Pedro Alves User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:14.0) Gecko/20120717 Thunderbird/14.0 MIME-Version: 1.0 To: Jan Kratochvil CC: Joel Brobecker , Philippe Waroquiers , gdb-patches@sourceware.org, "Maciej W. Rozycki" Subject: Re: [patchv2] Write bpt at the ON_STACK bpt address References: <20120723155951.GA24718@adacore.com> <20120723163513.GA1222@host2.jankratochvil.net> <1343074047.2209.23.camel@soleil> <20120723201611.GA19567@host2.jankratochvil.net> <1343075809.2209.53.camel@soleil> <501009AE.40901@redhat.com> <1343247870.2240.29.camel@soleil> <20120725212653.GC2767@adacore.com> <1343252775.2240.51.camel@soleil> <20120725223933.GD2767@adacore.com> <20120726212339.GA1710@host2.jankratochvil.net> In-Reply-To: <20120726212339.GA1710@host2.jankratochvil.net> 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-07/txt/msg00688.txt.bz2 On 07/26/2012 10:23 PM, Jan Kratochvil wrote: >> But it sounds like this is forcing GDB to have insider knowledge of >> > valgrind. > As you were asking to put there 'int3' (and not 'hlt') the user convenience > coincidentally matches here with what Philippe asks for valgrind. > > > I am only concerned a bit about this change arcross all archs for 7.5. > Maybe 7.5 could limit this patch only for i386/x86_64 which is well > understood. FWIW, the patch looks good to me, and I don't think that limiting to x86 is necessary: the instruction should never be executed; and we're already writing to the stack using functions that throw, one more write should be any different. If that fails, the other writes would too. > + /* Write a legitimate instruction at the point where the infcall > + breakpoint is going to be inserted. While this instruction > + is never going to be executed, a user investigating the > + memory from GDB would see this instruction instead of random > + uninitialized bytes. We chose the breakpoint instruction > + just because it may look as the most logical one to the user. > + > + If software breakpoints are unsupported for this target we > + leave the user visible memory content uninitialized. */ > + IMO, this comment should also mention that in addition to being nice for the user, this is actually _necessary_ for at least Valgrind v XXX.YYY. -- Pedro Alves