From patchwork Thu Feb 19 21:48:19 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve Ellcey X-Patchwork-Id: 5178 Received: (qmail 8987 invoked by alias); 19 Feb 2015 21:48:34 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 8971 invoked by uid 89); 19 Feb 2015 21:48:34 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL, BAYES_00, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mailapp01.imgtec.com Received: from mailapp01.imgtec.com (HELO mailapp01.imgtec.com) (195.59.15.196) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 19 Feb 2015 21:48:24 +0000 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id 819AA9017B463; Thu, 19 Feb 2015 21:48:17 +0000 (GMT) Received: from BAMAIL02.ba.imgtec.org (10.20.40.28) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Thu, 19 Feb 2015 21:48:21 +0000 Received: from [10.20.3.58] (10.20.3.58) by bamail02.ba.imgtec.org (10.20.40.28) with Microsoft SMTP Server (TLS) id 14.3.174.1; Thu, 19 Feb 2015 13:48:19 -0800 Message-ID: <1424382499.27855.130.camel@ubuntu-sellcey> Subject: Re: Build failure with probe patch From: Steve Ellcey Reply-To: To: Sergio Durigan Junior CC: "Jose E. Marchesi" , Pedro Alves , Date: Thu, 19 Feb 2015 13:48:19 -0800 In-Reply-To: <87h9uhk4go.fsf@redhat.com> References: <87wq3ercw0.fsf@redhat.com> <1424306916.27855.115.camel@ubuntu-sellcey> <87r3tl7uwz.fsf@oracle.com> <54E6150B.9060808@redhat.com> <87vbix3iqm.fsf@oracle.com> <1424368119.27855.123.camel@ubuntu-sellcey> <87egply6gs.fsf@oracle.com> <87h9uhk4go.fsf@redhat.com> MIME-Version: 1.0 On Thu, 2015-02-19 at 15:53 -0500, Sergio Durigan Junior wrote: > > > > This looks good to me. > > This is OK with a ChangeLog entry, and after you address Jose's request. OK, here is the patch (and ChangeLog) after I added a comment about initializing arg.expr. I will go ahead and check it in later today. Steve Ellcey sellcey@imgtec.com 2015-02-19 Steve Ellcey * dtrace-probe.c (dtrace_process_dof_probe): Initialize arg.expr. (dtrace_get_probes) Change dof type. diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c index a6544ba..5b41e6b 100644 --- a/gdb/dtrace-probe.c +++ b/gdb/dtrace-probe.c @@ -415,6 +415,9 @@ dtrace_process_dof_probe (struct objfile *objfile, struct dtrace_probe_arg arg; struct expression *expr; + /* Set arg.expr to ensure all fields in expr are initialized and + the compiler will not warn when arg is used. */ + arg.expr = NULL; arg.type_str = xstrdup (p); /* Use strtab_size as a sentinel. */ @@ -617,17 +620,17 @@ dtrace_get_probes (VEC (probe_p) **probesp, struct objfile *objfile) { if (elf_section_data (sect)->this_hdr.sh_type == SHT_SUNW_dof) { - struct dtrace_dof_hdr *dof; + bfd_byte *dof; /* Read the contents of the DOF section and then process it to extract the information of any probe defined into it. */ - if (!bfd_malloc_and_get_section (abfd, sect, (bfd_byte **) &dof)) + if (!bfd_malloc_and_get_section (abfd, sect, &dof)) complaint (&symfile_complaints, _("could not obtain the contents of" "section '%s' in objfile `%s'."), sect->name, abfd->filename); - dtrace_process_dof (sect, objfile, probesp, dof); + dtrace_process_dof (sect, objfile, probesp, (struct dtrace_dof_hdr *) dof); xfree (dof); } }