From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21628 invoked by alias); 25 Jul 2012 22:39:50 -0000 Received: (qmail 21620 invoked by uid 22791); 25 Jul 2012 22:39:49 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Wed, 25 Jul 2012 22:39:36 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 448B91C6C2D; Wed, 25 Jul 2012 18:39:36 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id i1OCfTFwhGWa; Wed, 25 Jul 2012 18:39:36 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id E521B1C6B66; Wed, 25 Jul 2012 18:39:35 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 27DED14561A; Wed, 25 Jul 2012 15:39:33 -0700 (PDT) Date: Wed, 25 Jul 2012 22:39:00 -0000 From: Joel Brobecker To: Philippe Waroquiers Cc: Pedro Alves , Jan Kratochvil , gdb-patches@sourceware.org Subject: Re: [patch] [i386] Put hlt at the ON_STACK breakpoint [Re: GDB 7.4.91 available for testing] Message-ID: <20120725223933.GD2767@adacore.com> References: <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> <501009AE.40901@redhat.com> <1343247870.2240.29.camel@soleil> <20120725212653.GC2767@adacore.com> <1343252775.2240.51.camel@soleil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1343252775.2240.51.camel@soleil> User-Agent: Mutt/1.5.20 (2009-06-14) 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/msg00597.txt.bz2 > A valid instruction is not enough. We need a valid instruction > that will cause Valgrind to terminate block translation. > The breakpoint trap instruction is ok for that. > (0xcc for x86 and amd64, 0x0005000d for mips32). I think it is fine to update GDB to insert the breakpoint instruction instead of leaving random bytes at the breakpoint location. But it sounds like this is forcing GDB to have insider knowledge of valgrind. It would seem better if, in parallel to our efforts, something was done on the valgrind side as well to make it work without the GDB workaround. For instance, couldn't valgrind figure out that the block translation should stop at a Z0 address if the instruction underneath is illegal? What I am trying to do, is make sure that new GDB versions work well with older versions of valgrind (although, isn't gdbserver support relatively recent?), while at the same time trying to make future versions of valgrind more robust. I don't know how long we are going to be able to keep the workaround. What if other tools implementing the remote protocol had the same problem, and they required us to insert a different instruction instead? -- Joel