* ax-gdb.c (gen_expr): Handle UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE.
* breakpoint.c (watchpoint_exp_is_const): Handle UNOP_CAST_TYPE, UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. * c-exp.y (exp): Emit UNOP_MEMVAL_TYPE, UNOP_CAST_TYPE. Update for changes to UNOP_REINTERPRET_CAST, UNOP_DYNAMIC_CAST. Use type_exp production where appropriate. * eval.c (evaluate_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_address) <UNOP_MEMVAL_TYPE>: New case. (evaluate_subexp_for_sizeof) <UNOP_MEMVAL_TYPE>: New case. * expprint.c (print_subexp_standard) <UNOP_CAST_TYPE>: New case. <UNOP_MEMVAL_TYPE>: New case. (dump_subexp_body_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * parse.c (operator_length_standard) <UNOP_DYNAMIC_CAST, UNOP_REINTERPRET_CAST>: Update. <UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE>: New cases. * stack.c (return_command): Also check for UNOP_CAST_TYPE. * std-operator.def (UNOP_CAST_TYPE, UNOP_MEMVAL_TYPE): New constants.
This commit is contained in:
parent
b1e0c0fa45
commit
9eaf670568
9 changed files with 178 additions and 37 deletions
|
@ -429,13 +429,25 @@ print_subexp_standard (struct expression *exp, int *pos,
|
|||
fputs_filtered (")", stream);
|
||||
return;
|
||||
|
||||
case UNOP_CAST_TYPE:
|
||||
(*pos) += 1;
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
fputs_filtered ("(", stream);
|
||||
fputs_filtered ("(", stream);
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
fputs_filtered (") ", stream);
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
fputs_filtered (")", stream);
|
||||
return;
|
||||
|
||||
case UNOP_DYNAMIC_CAST:
|
||||
case UNOP_REINTERPRET_CAST:
|
||||
fputs_filtered (opcode == UNOP_DYNAMIC_CAST ? "dynamic_cast"
|
||||
: "reinterpret_cast", stream);
|
||||
fputs_filtered ("<", stream);
|
||||
(*pos) += 2;
|
||||
type_print (exp->elts[pc + 1].type, "", stream, 0);
|
||||
(*pos) += 1;
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
fputs_filtered ("> (", stream);
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
fputs_filtered (")", stream);
|
||||
|
@ -471,6 +483,18 @@ print_subexp_standard (struct expression *exp, int *pos,
|
|||
fputs_filtered (")", stream);
|
||||
return;
|
||||
|
||||
case UNOP_MEMVAL_TYPE:
|
||||
(*pos) += 1;
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
fputs_filtered ("(", stream);
|
||||
fputs_filtered ("{", stream);
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
fputs_filtered ("} ", stream);
|
||||
print_subexp (exp, pos, stream, PREC_PREFIX);
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
fputs_filtered (")", stream);
|
||||
return;
|
||||
|
||||
case UNOP_MEMVAL_TLS:
|
||||
(*pos) += 3;
|
||||
if ((int) prec > (int) PREC_PREFIX)
|
||||
|
@ -910,10 +934,18 @@ dump_subexp_body_standard (struct expression *exp,
|
|||
elt = dump_subexp (exp, stream, elt);
|
||||
}
|
||||
break;
|
||||
case UNOP_MEMVAL:
|
||||
case UNOP_CAST:
|
||||
case UNOP_DYNAMIC_CAST:
|
||||
case UNOP_REINTERPRET_CAST:
|
||||
case UNOP_CAST_TYPE:
|
||||
case UNOP_MEMVAL_TYPE:
|
||||
++elt;
|
||||
fprintf_filtered (stream, " (");
|
||||
elt = dump_subexp (exp, stream, elt);
|
||||
fprintf_filtered (stream, ")");
|
||||
elt = dump_subexp (exp, stream, elt);
|
||||
break;
|
||||
case UNOP_MEMVAL:
|
||||
case UNOP_CAST:
|
||||
fprintf_filtered (stream, "Type @");
|
||||
gdb_print_host_address (exp->elts[elt].type, stream);
|
||||
fprintf_filtered (stream, " (");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue