From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 18799 invoked by alias); 25 Jul 2012 20:39:21 -0000 Received: (qmail 18782 invoked by uid 22791); 25 Jul 2012 20:39:19 -0000 X-SWARE-Spam-Status: No, hits=-3.1 required=5.0 tests=AWL,BAYES_00,KHOP_THREADED,RCVD_IN_DNSWL_NONE,TW_XC X-Spam-Check-By: sourceware.org Received: from Mailrelay020.isp.belgacom.be (HELO mailrelay020.isp.belgacom.be) (195.238.6.95) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jul 2012 20:39:07 +0000 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvwBALZYEFBR9qAt/2dsb2JhbAANOIVxsAuBNIVEAQEBBCNWEAsYAgImAgJXBrAGbpMxgSCKLSCFQoESA550iUOBVQ Received: from 45.160-246-81.adsl-dyn.isp.belgacom.be (HELO [192.168.1.2]) ([81.246.160.45]) by relay.skynet.be with ESMTP; 25 Jul 2012 22:39:06 +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: <20120725201107.GA32326@host2.jankratochvil.net> References: <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> <1343075809.2209.53.camel@soleil> <20120725144858.GB24718@adacore.com> <1343246641.2240.8.camel@soleil> <20120725201107.GA32326@host2.jankratochvil.net> Content-Type: text/plain; charset="UTF-8" Date: Wed, 25 Jul 2012 20:39:00 -0000 Message-ID: <1343248757.2240.41.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/msg00587.txt.bz2 On Wed, 2012-07-25 at 22:11 +0200, Jan Kratochvil wrote: > On Wed, 25 Jul 2012 22:04:01 +0200, Philippe Waroquiers wrote: > > IIUC, Jan's patch was to have GDB storing a hlt after the place > > where GDBSERVER will put 0xCC. > > Not after, all the storage happens for the same byte. Oops, I misunderstood that. > > hlt is stored there by memory write, int3 is stored there by Z0. > > > > What Valgrind needs is to have GDB storing the 0xCC > > (the hlt will then have no positive nor negative impact on Valgrind). > > I will put 0xcc == int3 there although I believe valgrind could decode hlt (or > even nop) the same way. I have not found the decoding of the hlt instruction in Valgrind, so I suspect it might not be supported. Any valid instruction that will terminate a "Valgrind block" will be ok there. For sure, the 0xcc is ok. There are other instructions which also ensures Valgrind stops translating the block (e.g. others "int" instructions). I think "nop" does not stop the block translation. So, inserting 0xcc looks more straightforward/natural/safer. Philippe