From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6513 invoked by alias); 7 Aug 2015 14:11:02 -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 5889 invoked by uid 89); 7 Aug 2015 14:11:01 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-0.6 required=5.0 tests=AWL,BAYES_00,LIKELY_SPAM_BODY,RP_MATCHES_RCVD,SPF_PASS,UNPARSEABLE_RELAY autolearn=no version=3.3.2 X-HELO: userp1040.oracle.com Received: from userp1040.oracle.com (HELO userp1040.oracle.com) (156.151.31.81) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 07 Aug 2015 14:11:00 +0000 Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by userp1040.oracle.com (Sentrion-MTA-4.3.2/Sentrion-MTA-4.3.2) with ESMTP id t77EAm5C014579 (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 7 Aug 2015 14:10:49 GMT Received: from aserv0121.oracle.com (aserv0121.oracle.com [141.146.126.235]) by userv0022.oracle.com (8.13.8/8.13.8) with ESMTP id t77EAmiO032330 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=FAIL); Fri, 7 Aug 2015 14:10:48 GMT Received: from abhmp0012.oracle.com (abhmp0012.oracle.com [141.146.116.18]) by aserv0121.oracle.com (8.13.8/8.13.8) with ESMTP id t77EAmXh007231; Fri, 7 Aug 2015 14:10:48 GMT Received: from termi.oracle.com (/10.175.237.167) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Fri, 07 Aug 2015 07:10:47 -0700 From: jose.marchesi@oracle.com (Jose E. Marchesi) To: Joel Brobecker Cc: Sergio Durigan Junior , gdb-patches@sourceware.org Subject: Re: [PATCH V4 5/9] New probe type: DTrace USDT probes. References: <1422874968-382-1-git-send-email-jose.marchesi@oracle.com> <1422874968-382-6-git-send-email-jose.marchesi@oracle.com> <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> Date: Fri, 07 Aug 2015 14:11:00 -0000 In-Reply-To: <874mkb9qv9.fsf@oracle.com> (Jose E. Marchesi's message of "Fri, 07 Aug 2015 15:20:58 +0200") Message-ID: <87k2t7rxmk.fsf@oracle.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2015-08/txt/msg00201.txt.bz2 + if (DOF_UINT (dof, section->dofs_size) + < sizeof (struct dtrace_dof_provider)) + { + /* The section is smaller than expected, so do not use it. + This has been observed on x86-solaris 10. */ + goto invalid_dof_data; + } + It looks to me that at some point a new field was probably added to the struct dtrace_dof_provider, changing its size. Confirmed: DOF version 2 added support for is-enabled probes, and the struct dtrace_dof_provider got a new 4 bytes field: @@ -719,6 +722,7 @@ typedef struct dof_provider { dof_attr_t dofpv_funcattr; /* function attributes */ dof_attr_t dofpv_nameattr; /* name attributes */ dof_attr_t dofpv_argsattr; /* args attributes */ + dof_secidx_t dofpv_prenoffs; /* link to DOF_SECT_PRENOFFS section */ } dof_provider_t; Looks like your solaris-x86 binaries are embedding DOFv1 programs. You can check that by looking at dof->dofh_ident[6]: it will be 1 in a DOFv1 program and 2 in a DOFv2 program. 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.