GDB (xrefs)
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
stap-probe.c File Reference
#include "defs.h"
#include "stap-probe.h"
#include "probe.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 "expop.h"
#include <unordered_map>
#include "gdbsupport/hash_enum.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"
 

Typedefs

typedef expr::operation_up binop_maker_ftype(expr::operation_up &&, expr::operation_up &&)
 

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 expr::operation_up stap_parse_argument_1 (struct stap_parse_info *p, expr::operation_up &&lhs, enum stap_operand_prec prec) ATTRIBUTE_UNUSED_RESULT
 
static expr::operation_up stap_parse_argument_conditionally (struct stap_parse_info *p) ATTRIBUTE_UNUSED_RESULT
 
static bool 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 expr::operation_up stap_make_binop (enum exp_opcode opcode, expr::operation_up &&lhs, expr::operation_up &&rhs)
 
static struct typestap_get_expected_argument_type (struct gdbarch *gdbarch, enum stap_arg_bitness b, const char *probe_name)
 
static bool stap_is_generic_prefix (struct gdbarch *gdbarch, const char *s, const char **r, const char *const *prefixes)
 
static bool stap_is_register_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static bool stap_is_register_indirection_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static bool stap_is_integer_prefix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static bool stap_generic_check_suffix (struct gdbarch *gdbarch, const char *s, const char **r, const char *const *suffixes)
 
static bool stap_check_integer_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static bool stap_check_register_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static bool stap_check_register_indirection_suffix (struct gdbarch *gdbarch, const char *s, const char **r)
 
static expr::operation_up stap_parse_register_operand (struct stap_parse_info *p)
 
static expr::operation_up 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< std::unique_ptr< probe > > *probesp, CORE_ADDR base)
 
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 ()
 

Variables

static unsigned int stap_expression_debug = 0
 
const stap_static_probe_ops stap_static_probe_ops {}
 
static std::unordered_map< exp_opcode, binop_maker_ftype *, gdb::hash_enum< exp_opcode > > stap_maker_map
 

Macro Definition Documentation

◆ STAP_BASE_SECTION_NAME

#define STAP_BASE_SECTION_NAME   ".stapsdt.base"

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

Referenced by get_stap_base_address().

Typedef Documentation

◆ binop_maker_ftype

typedef expr::operation_up binop_maker_ftype(expr::operation_up &&, expr::operation_up &&)

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

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

Function Documentation

◆ _initialize_stap_probe()

void _initialize_stap_probe ( )

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

Referenced by initialize_all_files().

◆ get_stap_base_address()

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

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

References complaint, gdb_bfd_sections(), and STAP_BASE_SECTION_NAME.

Referenced by stap_static_probe_ops::get_probes().

◆ handle_stap_probe()

static void handle_stap_probe ( struct objfile * objfile,
struct sdt_note * el,
std::vector< std::unique_ptr< 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 1748 of file stap-probe.c.

References info_probes_for_spops().

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

References gdb_printf().

◆ stap_check_integer_suffix()

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

◆ stap_check_register_indirection_suffix()

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

◆ stap_check_register_suffix()

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

◆ stap_generic_check_suffix()

static bool 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 333 of file stap-probe.c.

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 bool stap_is_generic_prefix ( struct gdbarch * gdbarch,
const char * s,
const char ** r,
const char *const * prefixes )
static

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

Referenced by stap_is_register_indirection_prefix(), and stap_is_register_prefix().

◆ stap_is_integer_prefix()

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

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

References gdbarch_stap_integer_prefixes().

Referenced by stap_parse_single_operand().

◆ stap_is_operator()

static bool stap_is_operator ( const char * op)
static

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

Referenced by stap_parse_argument_1().

◆ stap_is_register_indirection_prefix()

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

◆ stap_is_register_prefix()

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

◆ stap_make_binop()

static expr::operation_up stap_make_binop ( enum exp_opcode opcode,
expr::operation_up && lhs,
expr::operation_up && rhs )
static

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

References stap_maker_map.

Referenced by stap_parse_argument_1().

◆ 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 expr::operation_up ATTRIBUTE_UNUSED_RESULT stap_parse_argument_1 ( struct stap_parse_info * p,
expr::operation_up && lhs,
enum stap_operand_prec prec )
static

◆ stap_parse_argument_conditionally()

static expr::operation_up stap_parse_argument_conditionally ( struct stap_parse_info * p)
static

◆ stap_parse_register_operand()

static expr::operation_up stap_parse_register_operand ( struct stap_parse_info * p)
static

◆ stap_parse_single_operand()

static expr::operation_up 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 53 of file stap-probe.c.

Referenced by stap_probe::parse_arguments().

◆ stap_maker_map

std::unordered_map<exp_opcode, binop_maker_ftype *, gdb::hash_enum<exp_opcode> > stap_maker_map
static

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

Referenced by stap_make_binop().

◆ stap_static_probe_ops

const stap_static_probe_ops stap_static_probe_ops {}

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

Referenced by stap_probe::get_static_ops().