From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 5893 invoked by alias); 23 Jul 2012 20:37:03 -0000 Received: (qmail 5885 invoked by uid 22791); 23 Jul 2012 20:37:03 -0000 X-SWARE-Spam-Status: No, hits=-3.0 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,TW_XC X-Spam-Check-By: sourceware.org Received: from mailrelay008.isp.belgacom.be (HELO mailrelay008.isp.belgacom.be) (195.238.6.174) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 23 Jul 2012 20:36:46 +0000 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AuUBAFC1DVBR9oD+/2dsb2JhbAANOIVvsA+BQ4VHAQEBAwEjVhALGAICJgICVwYuh2yoYW6SbIEgii2FQYESA550iUM Received: from 254.128-246-81.adsl-dyn.isp.belgacom.be (HELO [192.168.1.2]) ([81.246.128.254]) by relay.skynet.be with ESMTP; 23 Jul 2012 22:36:45 +0200 Subject: Re: [patch] [i386] Put hlt at the ON_STACK breakpoint [Re: GDB 7.4.91 available for testing] From: Philippe Waroquiers To: Jan Kratochvil Cc: Joel Brobecker , gdb-patches@sourceware.org, Pedro Alves In-Reply-To: <20120723201611.GA19567@host2.jankratochvil.net> References: <20120718163413.GA17548@adacore.com> <1342739016.2220.32.camel@soleil> <20120720071158.GA7053@host2.jankratochvil.net> <1342817409.2149.41.camel@soleil> <20120722173053.GA22036@host2.jankratochvil.net> <1342983655.2301.55.camel@soleil> <20120723072125.GA12958@host2.jankratochvil.net> <20120723155951.GA24718@adacore.com> <20120723163513.GA1222@host2.jankratochvil.net> <1343074047.2209.23.camel@soleil> <20120723201611.GA19567@host2.jankratochvil.net> Content-Type: text/plain; charset="UTF-8" Date: Mon, 23 Jul 2012 20:37:00 -0000 Message-ID: <1343075809.2209.53.camel@soleil> Mime-Version: 1.0 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-07/txt/msg00474.txt.bz2 On Mon, 2012-07-23 at 22:16 +0200, Jan Kratochvil wrote: > On Mon, 23 Jul 2012 22:07:27 +0200, Philippe Waroquiers wrote: > > Note that the trap instruction should only be written by the > > push_dummy_code function : for Normal breakpoints, only a Z0 packet > > should be done, as Valgrind will not allow to modify the guest > > executable code (it is not mapped writable). > > I do not understand now what is and what is not allowed for valgrind to write. The file mapped code (main program, shared libs) is not writable, and so cannot be modified by Valgrind gdbsrv. But Valgrind gdbsrv can modify all the memory which is writable. So, a.o. it can modify the stack. > > For the inferior call to work at all you have to create the stack frame for > it, otherwise it cannot work, at least for parameters passed by stack. > > So the GDB patch is no longer needed when you have fixed valgrind to put 0xcc > during Z0? Why valgrind cannot write 0xcc into stack memory when it already > has to write there to create the stack frame / parameters passed by stack? Effectively, I have a patch which fixes the problem. But the patch is a kludge which heuristically guesses that GDB is pushing an infcall. > > (Yes, I should read valgrind source code instead.) > > IIUC the 'hlt' cleanup patch can go only for 7.6 as 7.5 should not regress > with new/fixed valgrind. infcall Valgrind gdbsrv tests are (currently) regressing with 7.4.91 It would be nice to have it fixed in 7.5 (so that no user can encounter the nasty error message output by Valgrind) but this is not a critical blocking problem. So, up to you to see in which GDB release it can go. If there will be a clean solution in GDB (7.5 or 7.6), then I will not commit the kludge in Valgrind. Philippe