41 # define SHT_SUNW_dof 0x6ffffff4
46 extern const struct probe_ops dtrace_probe_ops;
96 unsigned int args_expr_built : 1;
104 static const char *
const keywords[] = {
"-pdtrace",
"-probe-dtrace", NULL };
286 #define DOF_UINT(dof, field) \
287 extract_unsigned_integer ((gdb_byte *) &(field), \
289 (((dof)->dofh_ident[DTRACE_DOF_ID_ENCODING] \
290 == DTRACE_DOF_ENCODE_MSB) \
291 ? BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE))
297 #define DTRACE_DOF_PTR(dof, offset) (&((char *) (dof))[(offset)])
303 #define DTRACE_DOF_SECT(dof, idx) \
304 ((struct dtrace_dof_sect *) \
305 DTRACE_DOF_PTR ((dof), \
306 DOF_UINT ((dof), (dof)->dofh_secoff) \
307 + ((idx) * DOF_UINT ((dof), (dof)->dofh_secsize))))
316 struct gdbarch *gdbarch,
VEC (
probe_p) **probesp,
320 char *strtab,
char *offtab,
char *eofftab,
321 char *argtab, uint64_t strtab_size)
323 int i, j, num_probes, num_enablers;
374 for (i = 0; i < num_enablers; i++)
377 uint32_t enabler_offset
385 for (i = 0; i < num_probes; i++)
387 uint32_t probe_offset
393 ret->
p.
arch = gdbarch;
394 ret->args_expr_built = 0;
424 while (*p++ !=
'\0' && p - strtab < strtab_size);
441 if (expr != NULL && expr->
elts[0].
opcode == OP_TYPE)
466 bfd *abfd = objfile->
obfd;
467 int size = bfd_get_arch_size (abfd) / 8;
479 goto invalid_dof_data;
485 goto invalid_dof_data;
525 goto invalid_dof_data;
529 for (i = 0; i < num_probes; i++)
538 provider, strtab, offtab, eofftab, argtab,
547 _(
"skipping section '%s' which does not contain valid DOF data."),
557 struct gdbarch *gdbarch)
563 probe->args_expr_built = 1;
589 if (arg->
type != NULL)
606 struct gdbarch *gdbarch)
608 if (!probe->args_expr_built)
619 bfd *abfd = objfile->
obfd;
620 asection *sect = NULL;
629 for (sect = abfd->sections; sect != NULL; sect = sect->next)
631 if (elf_section_data (sect)->this_hdr.sh_type ==
SHT_SUNW_dof)
637 if (!bfd_malloc_and_get_section (abfd, sect, &dof))
639 _(
"could not obtain the contents of"
640 "section '%s' in objfile `%s'."),
641 sect->name, abfd->filename);
658 struct gdbarch *gdbarch = probe->
p.
arch;
698 struct gdbarch *gdbarch = probe_generic->
arch;
706 static struct value *
710 struct gdbarch *gdbarch = probe_generic->
arch;
792 const char *val = NULL;
813 struct gdbarch *gdbarch = probe->
arch;
823 error (
_(
"No inferior running"));
845 struct gdbarch *gdbarch = probe->
arch;
855 error (
_(
"No inferior running"));
864 error (
_(
"Probe %s:%s cannot be disabled: no enablers."), probe->
provider, probe->
name);
914 Show information about DTrace static probes.\n\
915 Usage: info probes dtrace [PROVIDER [NAME [OBJECT]]]\n\
916 Each argument is a regular expression, used to select probes.\n\
917 PROVIDER matches probe provider names.\n\
918 NAME matches the probe names.\n\
919 OBJECT matches the executable or shared library name."),
static void dtrace_compile_to_ax(struct probe *probe_generic, struct agent_expr *expr, struct axs_value *value, unsigned n)
int gdbarch_dtrace_probe_is_enabled_p(struct gdbarch *gdbarch)
union exp_element elts[1]
void initialize_expout(struct parser_state *ps, size_t initial_size, const struct language_defn *lang, struct gdbarch *gdbarch)
struct obstack storage_obstack
int ptid_equal(ptid_t ptid1, ptid_t ptid2)
#define DTRACE_DOF_PTR(dof, offset)
static int dtrace_can_evaluate_probe_arguments(struct probe *probe_generic)
int gdbarch_dtrace_parse_probe_argument_p(struct gdbarch *gdbarch)
struct objfile * separate_debug_objfile_backlink
int gdbarch_dtrace_probe_is_enabled(struct gdbarch *gdbarch, CORE_ADDR addr)
#define DTRACE_DOF_SECT(dof, idx)
void gdbarch_dtrace_enable_probe(struct gdbarch *gdbarch, CORE_ADDR addr)
const struct builtin_type * builtin_type(struct gdbarch *gdbarch)
struct cmd_list_element ** info_probes_cmdlist_get(void)
static void info_probes_dtrace_command(char *arg, int from_tty)
static void dtrace_get_probes(VEC(probe_p)**probesp, struct objfile *objfile)
#define VEC_safe_push(T, V, O)
static struct value * dtrace_evaluate_probe_argument(struct probe *probe_generic, unsigned n, struct frame_info *frame)
struct objfile_per_bfd_storage * per_bfd
int gdbarch_dtrace_disable_probe_p(struct gdbarch *gdbarch)
static void dtrace_process_dof(asection *sect, struct objfile *objfile, VEC(probe_p)**probesp, struct dtrace_dof_hdr *dof)
int probe_is_linespec_by_keyword(const char **linespecp, const char *const *keywords)
#define VEC_iterate(T, V, I, P)
#define CATCH(EXCEPTION, MASK)
int prefixify_expression(struct expression *expr)
const char * const_char_ptr
static void dtrace_disable_probe(struct probe *probe)
DEF_VEC_O(dtrace_probe_arg_s)
void gdbarch_dtrace_disable_probe(struct gdbarch *gdbarch, CORE_ADDR addr)
struct cmd_list_element * add_cmd(const char *name, enum command_class theclass, cmd_cfunc_ftype *fun, const char *doc, struct cmd_list_element **list)
#define SECT_OFF_DATA(objfile)
void free_current_contents(void *ptr)
struct expression * parse_expression_with_language(const char *string, enum language lang)
static int dtrace_probe_is_linespec(const char **linespecp)
void complaint(struct complaints **complaints, const char *fmt,...)
struct cleanup * make_cleanup(make_cleanup_ftype *function, void *arg)
#define ANOFFSET(secoff, whichone)
struct gdbarch * get_objfile_arch(const struct objfile *objfile)
#define VEC_index(T, V, I)
static const char * dtrace_type_name(struct probe *probe_generic)
struct type * builtin_long
static void dtrace_gen_info_probes_table_values(struct probe *probe_generic, VEC(const_char_ptr)**ret)
struct expression * expout
static void dtrace_probe_destroy(struct probe *probe_generic)
void _initialize_dtrace_probe(void)
void gen_expr(struct expression *exp, union exp_element **pc, struct agent_expr *ax, struct axs_value *value)
int gdbarch_dtrace_enable_probe_p(struct gdbarch *gdbarch)
void write_exp_elt_opcode(struct parser_state *ps, enum exp_opcode expelt)
void discard_cleanups(struct cleanup *old_chain)
static int dtrace_probe_is_enabled(struct dtrace_probe *probe)
const struct language_defn * current_language
static CORE_ADDR dtrace_get_probe_address(struct probe *probe, struct objfile *objfile)
static struct dtrace_probe_arg * dtrace_get_arg(struct dtrace_probe *probe, unsigned n, struct gdbarch *gdbarch)
struct complaints * symfile_complaints
void info_probes_for_ops(const char *arg, int from_tty, const struct probe_ops *pops)
static unsigned dtrace_get_probe_argument_count(struct probe *probe_generic, struct frame_info *frame)
static void dtrace_enable_probe(struct probe *probe)
void require_rvalue(struct agent_expr *ax, struct axs_value *value)
struct value * evaluate_subexp_standard(struct type *expect_type, struct expression *exp, int *pos, enum noside noside)
static void dtrace_process_dof_probe(struct objfile *objfile, struct gdbarch *gdbarch, VEC(probe_p)**probesp, struct dtrace_dof_hdr *dof, struct dtrace_dof_probe *probe, struct dtrace_dof_provider *provider, char *strtab, char *offtab, char *eofftab, char *argtab, uint64_t strtab_size)
const struct probe_ops * pops
static void dtrace_build_arg_exprs(struct dtrace_probe *probe, struct gdbarch *gdbarch)
#define DOF_UINT(dof, field)
void gdbarch_dtrace_parse_probe_argument(struct gdbarch *gdbarch, struct parser_state *pstate, int narg)
struct section_offsets * section_offsets
void reallocate_expout(struct parser_state *ps)
void write_exp_elt_type(struct parser_state *ps, struct type *expelt)
const struct probe_ops dtrace_probe_ops
void error(const char *fmt,...)
static void dtrace_gen_info_probes_table_header(VEC(info_probe_column_s)**heads)
void do_cleanups(struct cleanup *old_chain)