From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 105242 invoked by alias); 10 Aug 2015 03:21:05 -0000 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 Received: (qmail 105233 invoked by uid 89); 10 Aug 2015 03:21:04 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.3 required=5.0 tests=AWL,BAYES_00,KAM_LAZY_DOMAIN_SECURITY,LIKELY_SPAM_BODY,RP_MATCHES_RCVD,SPF_HELO_PASS autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Mon, 10 Aug 2015 03:21:02 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 6B06D4D; Mon, 10 Aug 2015 03:21:01 +0000 (UTC) Received: from localhost (unused-10-15-17-51.yyz.redhat.com [10.15.17.51]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t7A3L0gO026433 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sun, 9 Aug 2015 23:21:01 -0400 From: Sergio Durigan Junior To: Joel Brobecker Cc: "Jose E. Marchesi" , gdb-patches@sourceware.org Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes. References: <87r3tp722i.fsf@redhat.com> <20150325191418.GA32233@adacore.com> <87bnjfraq1.fsf@oracle.com> <20150326175028.GA13867@adacore.com> <87y4mdjcie.fsf@oracle.com> <20150331184727.GF13867@adacore.com> <878uedey48.fsf@oracle.com> <20150806213103.GC14992@adacore.com> <874mkb9qv9.fsf@oracle.com> <87k2t7rxmk.fsf@oracle.com> <20150807151232.GD14992@adacore.com> X-URL: http://blog.sergiodj.net Date: Mon, 10 Aug 2015 03:21:00 -0000 In-Reply-To: <20150807151232.GD14992@adacore.com> (Joel Brobecker's message of "Fri, 7 Aug 2015 08:12:32 -0700") Message-ID: <87h9o7esmb.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00214.txt.bz2 On Friday, August 07 2015, Joel Brobecker wrote: >> So... we can make GDB to look at the DOF version and then use a >> different struct (struct dof_provider_v1 ?) when handling embedded >> programs using the old format. >> >> I can prepare a patch for this. For testing purposes pdtrace can be >> made to generate DOFv1 programs even in systems lacking an old enough >> dtrace. Thanks, Jose. That would be much appreciated. > Also, I didn't say it before, I wasn't so sure that casting a binary > stream to a structure to read its contents was the best way to do > things. It can of works, but makes the code a little harder to read, > IMO, because accessing its contents requires the accessor macros. > Perhaps it might be better to just have decoding routines that take > the binary data and produce the corresponding struct, with the data > properly decoded. That way, you can add DOF version checks and decode > the data differently, without the rest of the code having to worry > about which version of the type they should be using. It's not obvious > to me that this way is better than the current way, but that's how > I would have tried it first... (just my 2 cents) I agree. Something else really worth doing is creating a debug setting for DTrace probes, and print useful information while decoding them. Almost all (if not all) the information that Joel gathered using external tools could have been printed from inside GDB. Cheers, -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/