diff options
Diffstat (limited to 'gdb/tracepoint.c')
-rw-r--r-- | gdb/tracepoint.c | 56 |
1 files changed, 16 insertions, 40 deletions
diff --git a/gdb/tracepoint.c b/gdb/tracepoint.c index 101c526..bf8a63c 100644 --- a/gdb/tracepoint.c +++ b/gdb/tracepoint.c @@ -691,15 +691,10 @@ validate_actionline (const char *line, struct breakpoint *b) if (exp->first_opcode () == OP_VAR_VALUE) { symbol *sym; - if (exp->op != nullptr) - { - expr::var_value_operation *vvop - = (dynamic_cast<expr::var_value_operation *> - (exp->op.get ())); - sym = vvop->get_symbol (); - } - else - sym = exp->elts[2].symbol; + expr::var_value_operation *vvop + = (dynamic_cast<expr::var_value_operation *> + (exp->op.get ())); + sym = vvop->get_symbol (); if (SYMBOL_CLASS (sym) == LOC_CONST) { @@ -1395,16 +1390,10 @@ encode_actions_1 (struct command_line *action, { case OP_REGISTER: { - const char *name; - if (exp->op != nullptr) - { - expr::register_operation *regop - = (dynamic_cast<expr::register_operation *> - (exp->op.get ())); - name = regop->get_name (); - } - else - name = &exp->elts[2].string; + expr::register_operation *regop + = (dynamic_cast<expr::register_operation *> + (exp->op.get ())); + const char *name = regop->get_name (); i = user_reg_map_name_to_regnum (target_gdbarch (), name, strlen (name)); @@ -1424,16 +1413,10 @@ encode_actions_1 (struct command_line *action, /* Safe because we know it's a simple expression. */ tempval = evaluate_expression (exp.get ()); addr = value_address (tempval); - struct type *type; - if (exp->op != nullptr) - { - expr::unop_memval_operation *memop - = (dynamic_cast<expr::unop_memval_operation *> - (exp->op.get ())); - type = memop->get_type (); - } - else - type = exp->elts[1].type; + expr::unop_memval_operation *memop + = (dynamic_cast<expr::unop_memval_operation *> + (exp->op.get ())); + struct type *type = memop->get_type (); /* Initialize the TYPE_LENGTH if it is a typedef. */ check_typedef (type); collect->add_memrange (target_gdbarch (), @@ -1447,17 +1430,10 @@ encode_actions_1 (struct command_line *action, case OP_VAR_VALUE: { - struct symbol *sym; - - if (exp->op != nullptr) - { - expr::var_value_operation *vvo - = (dynamic_cast<expr::var_value_operation *> - (exp->op.get ())); - sym = vvo->get_symbol (); - } - else - sym = exp->elts[2].symbol; + expr::var_value_operation *vvo + = (dynamic_cast<expr::var_value_operation *> + (exp->op.get ())); + struct symbol *sym = vvo->get_symbol (); const char *name = sym->natural_name (); collect->collect_symbol (sym, |