2015-02-19 Steve Ellcey <sellcey@imgtec.com>
authorSteve Ellcey <sellcey@imgtec.com>
Thu, 19 Feb 2015 22:42:37 +0000 (14:42 -0800)
committerSteve Ellcey <sellcey@imgtec.com>
Thu, 19 Feb 2015 22:42:37 +0000 (14:42 -0800)
* dtrace-probe.c (dtrace_process_dof_probe): Initialize arg.expr.
(dtrace_get_probes) Change type of variable 'dof'.

gdb/ChangeLog
gdb/dtrace-probe.c

index 303bb96d008657bf48d988016f82e03f1b785e25..07c7c509758920dcd421a7e40bf5f10c1f878176 100644 (file)
@@ -1,3 +1,8 @@
+2015-02-19  Steve Ellcey  <sellcey@imgtec.com>
+
+       * dtrace-probe.c (dtrace_process_dof_probe): Initialize arg.expr.
+       (dtrace_get_probes) Change type of variable 'dof'.
+
 2015-02-19  Antoine Tremblay  <antoine.tremblay@ericsson.com>
 
        PR breakpoints/16812
index a6544ba1c98c0c5dd369f15354fb8b1713fb5c04..b24444926cb324b142ff60a24255f7112bbcf88a 100644 (file)
@@ -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,18 @@ 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);
        }
     }