[PATCH] Implement way of checking if probe interface can evaluate arguments

Gary Benson gbenson@redhat.com
Thu Jul 11 15:00:00 GMT 2013


Sergio Durigan Junior wrote:
> diff --git a/gdb/solib-svr4.c b/gdb/solib-svr4.c
> index 6f8d0ef..9aeebaf 100644
> --- a/gdb/solib-svr4.c
> +++ b/gdb/solib-svr4.c
> @@ -1984,6 +1984,7 @@
>  	  for (i = 0; i < NUM_PROBES; i++)
>  	    {
>  	      const char *name = probe_info[i].name;
> +	      struct probe *p;
>  	      char buf[32];
>  
>  	      /* Fedora 17 and Red Hat Enterprise Linux 6.2-6.4
> @@ -2001,6 +2002,9 @@
>  
>  	      probes[i] = find_probes_in_objfile (os->objfile, "rtld", name);
>  
> +	      /* Checking whether the probe interface can evaluate
> +		 arguments.  */
> +
>  	      /* The "map_failed" probe did not exist in early
>  		 versions of the probes code in which the probes'
>  		 names were prefixed with "rtld_".  */

Duplicated comment.

> @@ -2012,6 +2016,15 @@
>  		  all_probes_found = 0;
>  		  break;
>  		}
> +
> +	      /* Checking to see if the probe interface can evaluate
> +		 arguments.  If not, we cannot use it.  */
> +	      p = VEC_index (probe_p, probes[i], 0);
> +	      if (!can_evaluate_probe_arguments (p))
> +		{
> +		  all_probes_found = 0;
> +		  break;
> +		}
>  	    }

This is checking one probe from each list (ie there will be 7 checks).
Is this what you wanted to do?  I would have thought you would either
want to check one probe or all probes.

Also I would comment "/* Ensure probe arguments can be evaluated.  */"
but that is probably bikeshedding on my part :)

Thanks,
Gary



More information about the Gdb-patches mailing list