From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 123500 invoked by alias); 12 Nov 2018 03:16:15 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 123483 invoked by uid 89); 12 Nov 2018 03:16:14 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-1.1 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY autolearn=no version=3.3.2 spammy=Plus, Hardware, shipping X-HELO: mga05.intel.com Received: from mga05.intel.com (HELO mga05.intel.com) (192.55.52.43) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Mon, 12 Nov 2018 03:16:12 +0000 Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga105.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Nov 2018 19:16:11 -0800 Received: from tassilo.jf.intel.com (HELO tassilo.localdomain) ([10.7.201.126]) by orsmga007.jf.intel.com with ESMTP; 11 Nov 2018 19:16:11 -0800 Received: by tassilo.localdomain (Postfix, from userid 1000) id 093E8300E46; Sun, 11 Nov 2018 19:16:11 -0800 (PST) Date: Mon, 12 Nov 2018 03:16:00 -0000 From: Andi Kleen To: Richard Biener Cc: Andi Kleen , GCC Patches Subject: Re: [PATCH 2/3] Add a pass to automatically add ptwrite instrumentation Message-ID: <20181112031610.GF6218@tassilo.jf.intel.com> References: <20181104063235.6914-1-andi@firstfloor.org> <20181104063235.6914-2-andi@firstfloor.org> <20181109181837.GB6218@tassilo.jf.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-SW-Source: 2018-11/txt/msg00888.txt.bz2 On Sun, Nov 11, 2018 at 10:06:21AM +0100, Richard Biener wrote: > That is, usually debuggers look for a location list of a variable > and find, say, %rax. But for ptwrite the debugger needs to > examine all active location lists for, say, %rax and figure out > that it contains the value for variable 'a'? In dwarf output you end up with a list of start-IP...stop-IP ... variable locations Both the original load/store and PTWRITE are in the same scope, and the debugger just looks it up based on the IP, so it all works without any extra modifications. I even had an earlier version of this that instrumented assembler output of the compiler with PTWRITE in a separate script, and it worked fine too. > > When there isn't any such relation between the ptwrite stored > value and any variable the ptwrite is useless, right? A programmer might still be able to make use of it based on the context or the order. e.g. if you don't instrument everything, but only specific variables, or you only instrument arguments and returns or similar then it could be still useful just based on the IP->symbol resolution. If you instrument too many things yes it will be hard to use without debug info resolution. > I hope you don't mind if this eventually slips to GCC 10 given > as you say there is no HW available right now. (still waiting > for a CPU with CET ...) :-/ Actually there is. Gemini Lake Atom Hardware with Goldmont Plus is shipping for some time and you can buy them. -Andi