GDB (xrefs)
Classes | Macros | Enumerations | Functions | Variables
/tmp/gdb-8.1/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
 
class  stap_static_probe_ops
 
class  stap_probe
 

Macros

#define STAP_BASE_SECTION_NAME   ".stapsdt.base"
 

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

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, const char *probe_name)
 
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 expression_up stap_parse_argument (const char **arg, struct type *atype, struct gdbarch *gdbarch)
 
static CORE_ADDR relocate_address (CORE_ADDR address, struct objfile *objfile)
 
static void stap_modify_semaphore (CORE_ADDR address, int set, struct gdbarch *gdbarch)
 
static void handle_stap_probe (struct objfile *objfile, struct sdt_note *el, std::vector< probe *> *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 info_probes_stap_command (const char *arg, int from_tty)
 
void _initialize_stap_probe (void)
 

Variables

static unsigned int stap_expression_debug = 0
 
const stap_static_probe_ops stap_static_probe_ops
 

Macro Definition Documentation

◆ STAP_BASE_SECTION_NAME

#define STAP_BASE_SECTION_NAME   ".stapsdt.base"

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

Referenced by get_stap_base_address_1().

Enumeration Type Documentation

◆ stap_arg_bitness

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 67 of file stap-probe.c.

◆ stap_operand_prec

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 235 of file stap-probe.c.

Function Documentation

◆ _initialize_stap_probe()

void _initialize_stap_probe ( void  )

◆ get_stap_base_address()

static int get_stap_base_address ( bfd *  obfd,
bfd_vma *  base 
)
static

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

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

Referenced by stap_static_probe_ops::get_probes().

◆ get_stap_base_address_1()

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

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

References STAP_BASE_SECTION_NAME.

Referenced by get_stap_base_address().

◆ handle_stap_probe()

static void handle_stap_probe ( struct objfile objfile,
struct sdt_note *  el,
std::vector< probe *> *  probesp,
CORE_ADDR  base 
)
static

◆ info_probes_stap_command()

static void info_probes_stap_command ( const char *  arg,
int  from_tty 
)
static

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

References info_probes_for_spops().

Referenced by _initialize_stap_probe().

◆ relocate_address()

static CORE_ADDR relocate_address ( CORE_ADDR  address,
struct objfile objfile 
)
static

◆ show_stapexpressiondebug()

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

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

References _, and fprintf_filtered().

Referenced by _initialize_stap_probe().

◆ stap_check_integer_suffix()

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

◆ stap_check_register_indirection_suffix()

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

◆ stap_check_register_suffix()

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

◆ stap_generic_check_suffix()

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

◆ stap_get_expected_argument_type()

static struct type* stap_get_expected_argument_type ( struct gdbarch gdbarch,
enum stap_arg_bitness  b,
const char *  probe_name 
)
static

◆ stap_get_opcode()

static enum exp_opcode stap_get_opcode ( const char **  s)
static

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

References _, error(), and gdb_assert.

Referenced by stap_parse_argument_1().

◆ stap_get_operator_prec()

static enum stap_operand_prec stap_get_operator_prec ( enum exp_opcode  op)
static

◆ stap_is_generic_prefix()

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

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

Referenced by stap_is_register_indirection_prefix(), and stap_is_register_prefix().

◆ stap_is_integer_prefix()

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

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

References gdbarch_stap_integer_prefixes().

Referenced by stap_parse_single_operand().

◆ stap_is_operator()

static int stap_is_operator ( const char *  op)
static

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

Referenced by stap_parse_argument_1().

◆ stap_is_register_indirection_prefix()

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

◆ stap_is_register_prefix()

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

◆ stap_modify_semaphore()

static void stap_modify_semaphore ( CORE_ADDR  address,
int  set,
struct gdbarch gdbarch 
)
static

◆ stap_parse_argument()

static expression_up stap_parse_argument ( const char **  arg,
struct type atype,
struct gdbarch gdbarch 
)
static

◆ stap_parse_argument_1()

static void stap_parse_argument_1 ( struct stap_parse_info p,
int  has_lhs,
enum stap_operand_prec  prec 
)
static

◆ stap_parse_argument_conditionally()

static void stap_parse_argument_conditionally ( struct stap_parse_info p)
static

◆ stap_parse_register_operand()

static void stap_parse_register_operand ( struct stap_parse_info p)
static

◆ stap_parse_single_operand()

static void stap_parse_single_operand ( struct stap_parse_info p)
static

Variable Documentation

◆ stap_expression_debug

unsigned int stap_expression_debug = 0
static

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

Referenced by _initialize_stap_probe(), and stap_probe::parse_arguments().

◆ stap_static_probe_ops

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

Referenced by stap_probe::get_static_ops().