public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Sergio Durigan Junior <sergiodj@redhat.com>
To: jose.marchesi@oracle.com (Jose E. Marchesi)
Cc: Steve Ellcey <sellcey@imgtec.com>,
	Pedro Alves <palves@redhat.com>,
	       <gdb-patches@sourceware.org>
Subject: Re: Build failure with probe patch
Date: Thu, 19 Feb 2015 21:18:00 -0000	[thread overview]
Message-ID: <87h9uhk4go.fsf@redhat.com> (raw)
In-Reply-To: <87egply6gs.fsf@oracle.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/

  reply	other threads:[~2015-02-19 21:18 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-18 17:51 Steve Ellcey 
2015-02-18 23:58 ` Sergio Durigan Junior
2015-02-19  0:48   ` Steve Ellcey
2015-02-19  4:39     ` Sergio Durigan Junior
2015-02-19 15:55     ` Jose E. Marchesi
2015-02-19 16:53       ` Pedro Alves
2015-02-19 17:32         ` Jose E. Marchesi
2015-02-19 17:48           ` Steve Ellcey
2015-02-19 20:41             ` Jose E. Marchesi
2015-02-19 21:18               ` Sergio Durigan Junior [this message]
2015-02-19 21:48                 ` Steve Ellcey
2015-02-19 21:52                   ` Sergio Durigan Junior
2015-02-19 21:59                     ` Steve Ellcey
2015-02-19 18:30           ` Pedro Alves
2015-02-19 20:11             ` Jose E. Marchesi
2015-02-19 10:43   ` Pedro Alves

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87h9uhk4go.fsf@redhat.com \
    --to=sergiodj@redhat.com \
    --cc=gdb-patches@sourceware.org \
    --cc=jose.marchesi@oracle.com \
    --cc=palves@redhat.com \
    --cc=sellcey@imgtec.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).