GDB (xrefs)
Classes | Macros | Typedefs | Enumerations | Functions | Variables
/tmp/gdb-7.10/gdb/stap-probe.c File Reference
#include "defs.h"
#include "stap-probe.h"
#include "probe.h"
#include "vec.h"
#include "ui-out.h"
#include "objfiles.h"
#include "arch-utils.h"
#include "command.h"
#include "gdbcmd.h"
#include "filenames.h"
#include "value.h"
#include "ax.h"
#include "ax-gdb.h"
#include "complaints.h"
#include "cli/cli-utils.h"
#include "linespec.h"
#include "user-regs.h"
#include "parser-defs.h"
#include "language.h"
#include "elf-bfd.h"
#include <ctype.h>

Go to the source code of this file.

Classes

struct  stap_probe_arg
 
struct  stap_probe
 

Macros

#define STAP_BASE_SECTION_NAME   ".stapsdt.base"
 

Typedefs

typedef struct stap_probe_arg stap_probe_arg_s
 

Enumerations

enum  stap_arg_bitness {
  STAP_ARG_BITNESS_UNDEFINED, STAP_ARG_BITNESS_8BIT_UNSIGNED, STAP_ARG_BITNESS_8BIT_SIGNED, STAP_ARG_BITNESS_16BIT_UNSIGNED,
  STAP_ARG_BITNESS_16BIT_SIGNED, STAP_ARG_BITNESS_32BIT_UNSIGNED, STAP_ARG_BITNESS_32BIT_SIGNED, STAP_ARG_BITNESS_64BIT_UNSIGNED,
  STAP_ARG_BITNESS_64BIT_SIGNED
}
 
enum  stap_operand_prec {
  STAP_OPERAND_PREC_NONE = 0, STAP_OPERAND_PREC_LOGICAL_OR, STAP_OPERAND_PREC_LOGICAL_AND, STAP_OPERAND_PREC_ADD_CMP,
  STAP_OPERAND_PREC_BITWISE, STAP_OPERAND_PREC_MUL
}
 

Functions

 DEF_VEC_O (stap_probe_arg_s)
 
static void stap_parse_argument_1 (struct stap_parse_info *p, int has_lhs, enum stap_operand_prec prec)
 
static void stap_parse_argument_conditionally (struct stap_parse_info *p)
 
static int stap_is_operator (const char *op)
 
static void show_stapexpressiondebug (struct ui_file *file, int from_tty, struct cmd_list_element *c, const char *value)
 
static enum stap_operand_prec stap_get_operator_prec (enum exp_opcode op)
 
static enum exp_opcode stap_get_opcode (const char **s)
 
static struct typestap_get_expected_argument_type (struct gdbarch *gdbarch, enum stap_arg_bitness b)
 
static int stap_is_generic_prefix (struct gdbarch *gdbarch, const char *s, const char **r, const char *const *prefixes)
 
static int stap_is_register_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static int stap_is_register_indirection_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static int stap_is_integer_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static int stap_generic_check_suffix (struct gdbarch *gdbarch, const char *s, const char **r, const char *const *suffixes)
 
static int stap_check_integer_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static int stap_check_register_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static int stap_check_register_indirection_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static void stap_parse_register_operand (struct stap_parse_info *p)
 
static void stap_parse_single_operand (struct stap_parse_info *p)
 
static struct expressionstap_parse_argument (const char **arg, struct type *atype, struct gdbarch *gdbarch)
 
static void stap_parse_probe_arguments (struct stap_probe *probe, struct gdbarch *gdbarch)
 
static CORE_ADDR stap_get_probe_address (struct probe *probe, struct objfile *objfile)
 
static unsigned stap_get_probe_argument_count (struct probe *probe_generic, struct frame_info *frame)
 
static struct stap_probe_argstap_get_arg (struct stap_probe *probe, unsigned n, struct gdbarch *gdbarch)
 
static int stap_can_evaluate_probe_arguments (struct probe *probe_generic)
 
static struct valuestap_evaluate_probe_argument (struct probe *probe_generic, unsigned n, struct frame_info *frame)
 
static void stap_compile_to_ax (struct probe *probe_generic, struct agent_expr *expr, struct axs_value *value, unsigned n)
 
static void stap_probe_destroy (struct probe *probe_generic)
 
static void stap_modify_semaphore (CORE_ADDR address, int set, struct gdbarch *gdbarch)
 
static void stap_set_semaphore (struct probe *probe_generic, struct objfile *objfile, struct gdbarch *gdbarch)
 
static void stap_clear_semaphore (struct probe *probe_generic, struct objfile *objfile, struct gdbarch *gdbarch)
 
static void handle_stap_probe (struct objfile *objfile, struct sdt_note *el, VEC(probe_p)**probesp, CORE_ADDR base)
 
static void get_stap_base_address_1 (bfd *abfd, asection *sect, void *obj)
 
static int get_stap_base_address (bfd *obfd, bfd_vma *base)
 
static void stap_get_probes (VEC(probe_p)**probesp, struct objfile *objfile)
 
static const char * stap_type_name (struct probe *probe)
 
static int stap_probe_is_linespec (const char **linespecp)
 
static void stap_gen_info_probes_table_header (VEC(info_probe_column_s)**heads)
 
static void stap_gen_info_probes_table_values (struct probe *probe_generic, VEC(const_char_ptr)**ret)
 
static void info_probes_stap_command (char *arg, int from_tty)
 
void _initialize_stap_probe (void)
 

Variables

const struct probe_ops stap_probe_ops
 
static unsigned int stap_expression_debug = 0
 

Macro Definition Documentation

#define STAP_BASE_SECTION_NAME   ".stapsdt.base"

Definition at line 46 of file stap-probe.c.

Referenced by get_stap_base_address_1().

Typedef Documentation

Definition at line 98 of file stap-probe.c.

Enumeration Type Documentation

Enumerator
STAP_ARG_BITNESS_UNDEFINED 
STAP_ARG_BITNESS_8BIT_UNSIGNED 
STAP_ARG_BITNESS_8BIT_SIGNED 
STAP_ARG_BITNESS_16BIT_UNSIGNED 
STAP_ARG_BITNESS_16BIT_SIGNED 
STAP_ARG_BITNESS_32BIT_UNSIGNED 
STAP_ARG_BITNESS_32BIT_SIGNED 
STAP_ARG_BITNESS_64BIT_UNSIGNED 
STAP_ARG_BITNESS_64BIT_SIGNED 

Definition at line 71 of file stap-probe.c.

Enumerator
STAP_OPERAND_PREC_NONE 
STAP_OPERAND_PREC_LOGICAL_OR 
STAP_OPERAND_PREC_LOGICAL_AND 
STAP_OPERAND_PREC_ADD_CMP 
STAP_OPERAND_PREC_BITWISE 
STAP_OPERAND_PREC_MUL 

Definition at line 134 of file stap-probe.c.

Function Documentation

void _initialize_stap_probe ( void  )
DEF_VEC_O ( stap_probe_arg_s  )
static int get_stap_base_address ( bfd *  obfd,
bfd_vma *  base 
)
static

Definition at line 1550 of file stap-probe.c.

References _, complaint(), get_stap_base_address_1(), and symfile_complaints.

Referenced by stap_get_probes().

static void get_stap_base_address_1 ( bfd *  abfd,
asection *  sect,
void *  obj 
)
static

Definition at line 1536 of file stap-probe.c.

References STAP_BASE_SECTION_NAME.

Referenced by get_stap_base_address().

static void handle_stap_probe ( struct objfile objfile,
struct sdt_note *  el,
VEC(probe_p)**  probesp,
CORE_ADDR  base 
)
static
static void info_probes_stap_command ( char *  arg,
int  from_tty 
)
static

Definition at line 1694 of file stap-probe.c.

References info_probes_for_ops().

Referenced by _initialize_stap_probe().

static void show_stapexpressiondebug ( struct ui_file file,
int  from_tty,
struct cmd_list_element c,
const char *  value 
)
static

Definition at line 169 of file stap-probe.c.

References _, and fprintf_filtered().

Referenced by _initialize_stap_probe().

static int stap_can_evaluate_probe_arguments ( struct probe probe_generic)
static

Definition at line 1293 of file stap-probe.c.

References probe::arch, gdbarch_stap_is_single_operand_p(), and stap_probe::p.

static int stap_check_integer_suffix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static
static int stap_check_register_indirection_suffix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static
static int stap_check_register_suffix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static
static void stap_clear_semaphore ( struct probe probe_generic,
struct objfile objfile,
struct gdbarch gdbarch 
)
static
static void stap_compile_to_ax ( struct probe probe_generic,
struct agent_expr expr,
struct axs_value value,
unsigned  n 
)
static
static struct value* stap_evaluate_probe_argument ( struct probe probe_generic,
unsigned  n,
struct frame_info frame 
)
static
static void stap_gen_info_probes_table_header ( VEC(info_probe_column_s)**  heads)
static
static void stap_gen_info_probes_table_values ( struct probe probe_generic,
VEC(const_char_ptr)**  ret 
)
static
static int stap_generic_check_suffix ( struct gdbarch gdbarch,
const char *  s,
const char **  r,
const char *const suffixes 
)
static
static struct stap_probe_arg* stap_get_arg ( struct stap_probe probe,
unsigned  n,
struct gdbarch gdbarch 
)
static
static struct type* stap_get_expected_argument_type ( struct gdbarch gdbarch,
enum stap_arg_bitness  b 
)
static
static enum exp_opcode stap_get_opcode ( const char **  s)
static

Definition at line 222 of file stap-probe.c.

References _, gdb_assert, and internal_error().

Referenced by stap_parse_argument_1().

static enum stap_operand_prec stap_get_operator_prec ( enum exp_opcode  op)
static
static CORE_ADDR stap_get_probe_address ( struct probe probe,
struct objfile objfile 
)
static

Definition at line 1200 of file stap-probe.c.

References probe::address, ANOFFSET, SECT_OFF_DATA, and objfile::section_offsets.

static unsigned stap_get_probe_argument_count ( struct probe probe_generic,
struct frame_info frame 
)
static
static void stap_get_probes ( VEC(probe_p)**  probesp,
struct objfile objfile 
)
static
static int stap_is_generic_prefix ( struct gdbarch gdbarch,
const char *  s,
const char **  r,
const char *const prefixes 
)
static

Definition at line 380 of file stap-probe.c.

Referenced by stap_is_register_indirection_prefix(), and stap_is_register_prefix().

static int stap_is_integer_prefix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static

Definition at line 439 of file stap-probe.c.

References gdbarch_stap_integer_prefixes(), and len.

Referenced by stap_parse_single_operand().

static int stap_is_operator ( const char *  op)
static

Definition at line 1249 of file stap-probe.c.

Referenced by stap_parse_argument_1().

static int stap_is_register_indirection_prefix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static
static int stap_is_register_prefix ( struct gdbarch gdbarch,
const char *  s,
const char **  r 
)
static
static void stap_modify_semaphore ( CORE_ADDR  address,
int  set,
struct gdbarch gdbarch 
)
static
static struct expression* stap_parse_argument ( const char **  arg,
struct type atype,
struct gdbarch gdbarch 
)
static
static void stap_parse_argument_1 ( struct stap_parse_info p,
int  has_lhs,
enum stap_operand_prec  prec 
)
static
static void stap_parse_argument_conditionally ( struct stap_parse_info p)
static
static void stap_parse_probe_arguments ( struct stap_probe probe,
struct gdbarch gdbarch 
)
static
static void stap_parse_register_operand ( struct stap_parse_info p)
static
static void stap_parse_single_operand ( struct stap_parse_info p)
static
static void stap_probe_destroy ( struct probe probe_generic)
static
static int stap_probe_is_linespec ( const char **  linespecp)
static

Definition at line 1634 of file stap-probe.c.

References probe_is_linespec_by_keyword().

static void stap_set_semaphore ( struct probe probe_generic,
struct objfile objfile,
struct gdbarch gdbarch 
)
static
static const char* stap_type_name ( struct probe probe)
static

Definition at line 1627 of file stap-probe.c.

References gdb_assert, probe::pops, and stap_probe_ops.

Variable Documentation

unsigned int stap_expression_debug = 0
static

Definition at line 55 of file stap-probe.c.

Referenced by _initialize_stap_probe(), and stap_parse_probe_arguments().

const struct probe_ops stap_probe_ops
Initial value:
=
{
NULL,
NULL
}
static CORE_ADDR stap_get_probe_address(struct probe *probe, struct objfile *objfile)
Definition: stap-probe.c:1200
static void stap_clear_semaphore(struct probe *probe_generic, struct objfile *objfile, struct gdbarch *gdbarch)
Definition: stap-probe.c:1431
static void stap_probe_destroy(struct probe *probe_generic)
Definition: stap-probe.c:1348
static struct value * stap_evaluate_probe_argument(struct probe *probe_generic, unsigned n, struct frame_info *frame)
Definition: stap-probe.c:1308
static int stap_can_evaluate_probe_arguments(struct probe *probe_generic)
Definition: stap-probe.c:1293
static void stap_gen_info_probes_table_header(VEC(info_probe_column_s)**heads)
Definition: stap-probe.c:1642
static void stap_get_probes(VEC(probe_p)**probesp, struct objfile *objfile)
Definition: stap-probe.c:1574
static void stap_compile_to_ax(struct probe *probe_generic, struct agent_expr *expr, struct axs_value *value, unsigned n)
Definition: stap-probe.c:1326
static unsigned stap_get_probe_argument_count(struct probe *probe_generic, struct frame_info *frame)
Definition: stap-probe.c:1210
static void stap_set_semaphore(struct probe *probe_generic, struct objfile *objfile, struct gdbarch *gdbarch)
Definition: stap-probe.c:1415
static const char * stap_type_name(struct probe *probe)
Definition: stap-probe.c:1627
static void stap_gen_info_probes_table_values(struct probe *probe_generic, VEC(const_char_ptr)**ret)
Definition: stap-probe.c:1653
static int stap_probe_is_linespec(const char **linespecp)
Definition: stap-probe.c:1634

Definition at line 1672 of file stap-probe.c.

Referenced by handle_stap_probe(), stap_clear_semaphore(), stap_compile_to_ax(), stap_evaluate_probe_argument(), stap_gen_info_probes_table_values(), stap_get_probe_argument_count(), stap_probe_destroy(), stap_set_semaphore(), and stap_type_name().