forked from Imagelibrary/binutils-gdb
remove some sym_probe_fns methods
While looking into the probe API, it seemed to me that there were a number of methods in sym_probe_fns that were not needed. This patch removes them. Specifically, it seems to me that sym_probe_fns ought to be concerned with the API for constructing the probes. Any method relating to some aspect of an individual probe can be handled via the probe's own vtable. That is, the double indirection here doesn't seem useful -- it certainly isn't in fact used, but also I couldn't think of a potential use. 2013-12-06 Tom Tromey <tromey@redhat.com> * break-catch-throw.c (fetch_probe_arguments): Use get_probe_argument_count and evaluate_probe_argument. * elfread.c (elf_get_probe_argument_count) (elf_can_evaluate_probe_arguments, elf_evaluate_probe_argument) (elf_compile_to_ax): Remove. (elf_probe_fns): Update. * probe.c (get_probe_argument_count, can_evaluate_probe_arguments) (evaluate_probe_argument): Call method on probe, not via sym functions. * stap-probe.c (compute_probe_arg): Use get_probe_argument_count, evaluate_probe_argument. (compile_probe_arg): Use get_probe_argument_count. Call method on probe, not via sym functions. * symfile-debug.c (debug_sym_get_probe_argument_count) (debug_can_evaluate_probe_arguments) (debug_sym_evaluate_probe_argument, debug_sym_compile_to_ax): Remove. (debug_sym_probe_fns): Remove. * symfile.h (struct sym_probe_fns) <sym_get_probe_argument_count, can_evaluate_probe_arguments, sym_evaluate_probe_argument, sym_compile_to_ax>: Remove fields.
This commit is contained in:
@@ -1505,44 +1505,6 @@ elf_get_probes (struct objfile *objfile)
|
||||
return probes_per_objfile;
|
||||
}
|
||||
|
||||
/* Implementation of `sym_get_probe_argument_count', as documented in
|
||||
symfile.h. */
|
||||
|
||||
static unsigned
|
||||
elf_get_probe_argument_count (struct probe *probe)
|
||||
{
|
||||
return probe->pops->get_probe_argument_count (probe);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_can_evaluate_probe_arguments', as documented in
|
||||
symfile.h. */
|
||||
|
||||
static int
|
||||
elf_can_evaluate_probe_arguments (struct probe *probe)
|
||||
{
|
||||
return probe->pops->can_evaluate_probe_arguments (probe);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_evaluate_probe_argument', as documented in
|
||||
symfile.h. */
|
||||
|
||||
static struct value *
|
||||
elf_evaluate_probe_argument (struct probe *probe, unsigned n)
|
||||
{
|
||||
return probe->pops->evaluate_probe_argument (probe, n);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_compile_to_ax', as documented in symfile.h. */
|
||||
|
||||
static void
|
||||
elf_compile_to_ax (struct probe *probe,
|
||||
struct agent_expr *expr,
|
||||
struct axs_value *value,
|
||||
unsigned n)
|
||||
{
|
||||
probe->pops->compile_to_ax (probe, expr, value, n);
|
||||
}
|
||||
|
||||
/* Implementation of `sym_relocate_probe', as documented in symfile.h. */
|
||||
|
||||
static void
|
||||
@@ -1581,10 +1543,6 @@ probe_key_free (struct objfile *objfile, void *d)
|
||||
static const struct sym_probe_fns elf_probe_fns =
|
||||
{
|
||||
elf_get_probes, /* sym_get_probes */
|
||||
elf_get_probe_argument_count, /* sym_get_probe_argument_count */
|
||||
elf_can_evaluate_probe_arguments, /* sym_can_evaluate_probe_arguments */
|
||||
elf_evaluate_probe_argument, /* sym_evaluate_probe_argument */
|
||||
elf_compile_to_ax, /* sym_compile_to_ax */
|
||||
elf_symfile_relocate_probe, /* sym_relocate_probe */
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user