This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: Build failure with probe patch
- From: Sergio Durigan Junior <sergiodj at redhat dot com>
- To: jose dot marchesi at oracle dot com (Jose E. Marchesi)
- Cc: Steve Ellcey <sellcey at imgtec dot com>, Pedro Alves <palves at redhat dot com>, <gdb-patches at sourceware dot org>
- Date: Thu, 19 Feb 2015 15:53:59 -0500
- Subject: Re: Build failure with probe patch
- Authentication-results: sourceware.org; auth=none
- References: <bac100bc-73de-4bf6-86b5-912ad6887c5a at BAMAIL02 dot ba dot imgtec dot org> <87wq3ercw0 dot fsf at redhat dot com> <1424306916 dot 27855 dot 115 dot camel at ubuntu-sellcey> <87r3tl7uwz dot fsf at oracle dot com> <54E6150B dot 9060808 at redhat dot com> <87vbix3iqm dot fsf at oracle dot com> <1424368119 dot 27855 dot 123 dot camel at ubuntu-sellcey> <87egply6gs dot fsf at oracle dot com>
Hi Steve,
Thanks for the patch. And thanks Jose and Pedro taking care of this.
On Thursday, February 19 2015, Jose E. Marchesi wrote:
> To fix this problem I changed dtrace_process_dof_probe to have
> 'arg.expr = NULL' in the loop that stores argument descriptions. Here
> is a complete patch that compiled for me using the old GCC.
>
> Ah! But the warning seems all misplaced, isnt it? Weird... :D
Totally :-).
> diff --git a/gdb/dtrace-probe.c b/gdb/dtrace-probe.c
> index a6544ba..fd6ae6e 100644
> --- a/gdb/dtrace-probe.c
> +++ b/gdb/dtrace-probe.c
> @@ -415,6 +415,7 @@ dtrace_process_dof_probe (struct objfile *objfile,
> struct dtrace_probe_arg arg;
> struct expression *expr;
>
> + arg.expr = NULL;
>
> I would add a comment explaining why that sentence is necessary, as it
> is not obvious at all to the casual reader.
Agreed.
> arg.type_str = xstrdup (p);
>
> /* Use strtab_size as a sentinel. */
> @@ -617,17 +618,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);
> }
> }
>
> This looks good to me.
This is OK with a ChangeLog entry, and after you address Jose's request.
--
Sergio
GPG key ID: 0x65FC5E36
Please send encrypted e-mail if possible
http://sergiodj.net/