aboutsummaryrefslogtreecommitdiff
path: root/gdb/amd64-linux-tdep.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2019-03-24 10:28:42 -0600
committerTom Tromey <tom@tromey.com>2019-04-04 19:55:10 -0600
commit37eedb39824dc26c82a92b5515a352d7de0c9b5b (patch)
treeaaa2ca172270575273773089cbdcea2978e83ed1 /gdb/amd64-linux-tdep.c
parent73923d7eedc7ab52144308ef7e9c12cbe4341bca (diff)
downloadgdb-37eedb39824dc26c82a92b5515a352d7de0c9b5b.zip
gdb-37eedb39824dc26c82a92b5515a352d7de0c9b5b.tar.gz
gdb-37eedb39824dc26c82a92b5515a352d7de0c9b5b.tar.bz2
Make base class for parser_state
This makes a new base class, expr_builder, for parser_state. This separates the state needed to construct an expression from the state needed by the parsers. gdb/ChangeLog 2019-04-04 Tom Tromey <tom@tromey.com> * gdbarch.h, gdbarch.c: Rebuild. * gdbarch.sh (dtrace_parse_probe_argument): Change type. * stap-probe.h: (struct stap_parse_info): Replace "parser_state" with "expr_builder". * parser-defs.h (struct expr_builder): Rename from "parser_state". (parser_state): New class. * parse.c (expr_builder): Rename. (expr_builder::release): Rename. (write_exp_elt, write_exp_elt_opcode, write_exp_elt_sym) (write_exp_elt_msym, write_exp_elt_block, write_exp_elt_objfile) (write_exp_elt_longcst, write_exp_elt_floatcst) (write_exp_elt_type, write_exp_elt_intern, write_exp_string) (write_exp_string_vector, write_exp_bitstring) (write_exp_msymbol, mark_struct_expression) (write_dollar_variable) (insert_type_address_space, increase_expout_size): Replace "parser_state" with "expr_builder". * dtrace-probe.c: Replace "parser_state" with "expr_builder". * amd64-linux-tdep.c (amd64_dtrace_parse_probe_argument): Replace "parser_state" with "expr_builder".
Diffstat (limited to 'gdb/amd64-linux-tdep.c')
-rw-r--r--gdb/amd64-linux-tdep.c32
1 files changed, 16 insertions, 16 deletions
diff --git a/gdb/amd64-linux-tdep.c b/gdb/amd64-linux-tdep.c
index 21fc346..5475cf62 100644
--- a/gdb/amd64-linux-tdep.c
+++ b/gdb/amd64-linux-tdep.c
@@ -1735,7 +1735,7 @@ amd64_dtrace_disable_probe (struct gdbarch *gdbarch, CORE_ADDR addr)
static void
amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
- struct parser_state *pstate,
+ struct expr_builder *builder,
int narg)
{
struct stoken str;
@@ -1758,11 +1758,11 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
int regno = arg_reg_map[narg];
const char *regname = user_reg_map_regnum_to_name (gdbarch, regno);
- write_exp_elt_opcode (pstate, OP_REGISTER);
+ write_exp_elt_opcode (builder, OP_REGISTER);
str.ptr = regname;
str.length = strlen (regname);
- write_exp_string (pstate, str);
- write_exp_elt_opcode (pstate, OP_REGISTER);
+ write_exp_string (builder, str);
+ write_exp_elt_opcode (builder, OP_REGISTER);
}
else
{
@@ -1770,27 +1770,27 @@ amd64_dtrace_parse_probe_argument (struct gdbarch *gdbarch,
const char *regname = user_reg_map_regnum_to_name (gdbarch, AMD64_RSP_REGNUM);
/* Displacement. */
- write_exp_elt_opcode (pstate, OP_LONG);
- write_exp_elt_type (pstate, builtin_type (gdbarch)->builtin_long);
- write_exp_elt_longcst (pstate, narg - 6);
- write_exp_elt_opcode (pstate, OP_LONG);
+ write_exp_elt_opcode (builder, OP_LONG);
+ write_exp_elt_type (builder, builtin_type (gdbarch)->builtin_long);
+ write_exp_elt_longcst (builder, narg - 6);
+ write_exp_elt_opcode (builder, OP_LONG);
/* Register: SP. */
- write_exp_elt_opcode (pstate, OP_REGISTER);
+ write_exp_elt_opcode (builder, OP_REGISTER);
str.ptr = regname;
str.length = strlen (regname);
- write_exp_string (pstate, str);
- write_exp_elt_opcode (pstate, OP_REGISTER);
+ write_exp_string (builder, str);
+ write_exp_elt_opcode (builder, OP_REGISTER);
- write_exp_elt_opcode (pstate, BINOP_ADD);
+ write_exp_elt_opcode (builder, BINOP_ADD);
/* Cast to long. */
- write_exp_elt_opcode (pstate, UNOP_CAST);
- write_exp_elt_type (pstate,
+ write_exp_elt_opcode (builder, UNOP_CAST);
+ write_exp_elt_type (builder,
lookup_pointer_type (builtin_type (gdbarch)->builtin_long));
- write_exp_elt_opcode (pstate, UNOP_CAST);
+ write_exp_elt_opcode (builder, UNOP_CAST);
- write_exp_elt_opcode (pstate, UNOP_IND);
+ write_exp_elt_opcode (builder, UNOP_IND);
}
}