This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH] Implement way of checking if probe interface can evaluate arguments
- From: Gary Benson <gbenson at redhat dot com>
- To: Sergio Durigan Junior <sergiodj at redhat dot com>
- Cc: GDB Patches <gdb-patches at sourceware dot org>, Joel Brobecker <brobecker at adacore dot com>, Tom Tromey <tromey at redhat dot com>
- Date: Thu, 11 Jul 2013 16:00:47 +0100
- Subject: Re: [PATCH] Implement way of checking if probe interface can evaluate arguments
- References: <m3zjttesip dot fsf at redhat dot com>
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