From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11256 invoked by alias); 25 Jul 2012 21:27:14 -0000 Received: (qmail 11248 invoked by uid 22791); 25 Jul 2012 21:27:13 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_HOSTKARMA_NO,TW_XC 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 21:26:57 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 46EBC1C7634; Wed, 25 Jul 2012 17:26:56 -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 SaAhXRDAktFE; Wed, 25 Jul 2012 17:26:56 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id D3C961C7607; Wed, 25 Jul 2012 17:26:55 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id 16FB714561A; Wed, 25 Jul 2012 14:26:53 -0700 (PDT) Date: Wed, 25 Jul 2012 21:27: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: <20120725212653.GC2767@adacore.com> 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> <501009AE.40901@redhat.com> <1343247870.2240.29.camel@soleil> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1343247870.2240.29.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/msg00594.txt.bz2 > The translated block is then continued <<< This is the critical info !!! I am having trouble understanding why the translated block would be continued in the case of an inferior function call, since the code is not to be executed (thanks to resetting the PC to its original value prior to the inferior function call when reaching the Z0 breakpoint we inserted). But... > So, if it is easy to change GDB to insert 0xcc (for x86 and amd84) > and the equivalent breakpoint instr for mips32, then that avoids > the kludgy patch in Valgrind, which is for sure fragile. ... if I still understand correctly, as long as we write a valid instruction at the point where we place the infcall breakpoint, we should be fine, right? Jan selected the hlt instruction, but we could go with the breakpoint trap instruction as well (0xcc), which I think should be simpler to generalize in the future. It should not matter which instruction is chosen as long as it fits the available space, since that instruction will never be executed (thanks to the Z0 packet introducing an official breakpoint there). -- Joel