This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH V4 5/9] New probe type: DTrace USDT probes.


         
        +	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.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]