Lines Matching refs:ax

33 #include "ax.h"
34 #include "ax-gdb.h"
40 Then look at the types and enums in ax-gdb.h. For the code itself,
79 static void gen_offset (struct agent_expr *ax, int offset);
81 static void gen_var_ref (struct agent_expr *ax,
85 static void gen_int_literal (struct agent_expr *ax,
90 static void require_rvalue (struct agent_expr *ax, struct axs_value *value);
91 static void gen_usual_unary (struct agent_expr *ax, struct axs_value *value);
94 static void gen_conversion (struct agent_expr *ax,
97 static void gen_usual_arithmetic (struct agent_expr *ax,
100 static void gen_integral_promotions (struct agent_expr *ax,
102 static void gen_cast (struct agent_expr *ax,
104 static void gen_scale (struct agent_expr *ax,
106 static void gen_add (struct agent_expr *ax,
110 static void gen_sub (struct agent_expr *ax,
113 static void gen_binop (struct agent_expr *ax,
119 static void gen_logical_not (struct agent_expr *ax, struct axs_value *value);
120 static void gen_complement (struct agent_expr *ax, struct axs_value *value);
124 static void gen_bitfield_ref (struct agent_expr *ax,
127 static void gen_struct_ref (struct agent_expr *ax,
132 struct agent_expr *ax, struct axs_value *value);
134 struct agent_expr *ax, struct axs_value *value);
136 struct agent_expr *ax, struct axs_value *value);
315 gen_traced_pop (struct agent_expr *ax, struct axs_value *value)
323 ax_simple (ax, aop_pop);
335 ax_const_l (ax, length);
336 ax_simple (ax, aop_trace);
344 ax_reg (ax, value->u.reg);
345 ax_simple (ax, aop_pop);
350 ax_simple (ax, aop_pop);
361 gen_sign_extend (struct agent_expr *ax, struct type *type)
365 ax_ext (ax, TYPE_LENGTH (type) * TARGET_CHAR_BIT);
373 gen_extend (struct agent_expr *ax, struct type *type)
377 ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, bits));
385 gen_fetch (struct agent_expr *ax, struct type *type)
390 ax_trace_quick (ax, TYPE_LENGTH (type));
404 ax_simple (ax, aop_ref8);
407 ax_simple (ax, aop_ref16);
410 ax_simple (ax, aop_ref32);
413 ax_simple (ax, aop_ref64);
425 gen_sign_extend (ax, type);
443 gen_left_shift (struct agent_expr *ax, int distance)
447 ax_const_l (ax, distance);
448 ax_simple (ax, aop_lsh);
452 ax_const_l (ax, -distance);
453 ax_simple (ax, aop_rsh_unsigned);
465 gen_frame_args_address (struct agent_expr *ax)
470 TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
471 ax_reg (ax, frame_reg);
472 gen_offset (ax, frame_offset);
479 gen_frame_locals_address (struct agent_expr *ax)
484 TARGET_VIRTUAL_FRAME_POINTER (ax->scope, &frame_reg, &frame_offset);
485 ax_reg (ax, frame_reg);
486 gen_offset (ax, frame_offset);
496 gen_offset (struct agent_expr *ax, int offset)
503 ax_const_l (ax, offset);
504 ax_simple (ax, aop_add);
508 ax_const_l (ax, -offset);
509 ax_simple (ax, aop_sub);
518 gen_sym_offset (struct agent_expr *ax, struct symbol *var)
520 gen_offset (ax, SYMBOL_VALUE (var));
528 gen_var_ref (struct agent_expr *ax, struct axs_value *value, struct symbol *var)
537 ax_const_l (ax, (LONGEST) SYMBOL_VALUE (var));
542 ax_const_l (ax, (LONGEST) SYMBOL_VALUE_ADDRESS (var));
553 ax_const_l (ax, SYMBOL_VALUE_ADDRESS (var));
558 gen_frame_args_address (ax);
559 gen_sym_offset (ax, var);
565 gen_frame_args_address (ax);
566 gen_sym_offset (ax, var);
568 gen_fetch (ax, lookup_pointer_type (builtin_type_void));
574 gen_frame_locals_address (ax);
575 gen_sym_offset (ax, var);
581 ax_reg (ax, SYMBOL_BASEREG (var));
582 gen_sym_offset (ax, var);
592 ax_const_l (ax, BLOCK_START (SYMBOL_BLOCK_VALUE (var)));
610 ax_reg (ax, SYMBOL_VALUE (var));
622 ax_const_l (ax, SYMBOL_VALUE_ADDRESS (msym));
634 SYMBOL_OPS (var)->tracepoint_var_ref (var, ax, value);
655 gen_int_literal (struct agent_expr *ax, struct axs_value *value, LONGEST k,
658 ax_const_l (ax, k);
672 require_rvalue (struct agent_expr *ax, struct axs_value *value)
682 gen_fetch (ax, value->type);
691 ax_reg (ax, value->u.reg);
692 gen_extend (ax, value->type);
717 gen_usual_unary (struct agent_expr *ax, struct axs_value *value)
757 require_rvalue (ax, value);
783 gen_conversion (struct agent_expr *ax, struct type *from, struct type *to)
790 gen_extend (ax, from);
797 gen_extend (ax, to);
805 gen_extend (ax, to);
815 struct agent_expr *ax = new_agent_expr (0);
824 gen_conversion (ax, from, to);
825 nontrivial = ax->len > 0;
826 free_agent_expr (ax);
837 gen_usual_arithmetic (struct agent_expr *ax, struct axs_value *value1,
853 gen_conversion (ax, value2->type, target);
860 ax_simple (ax, aop_swap);
861 gen_conversion (ax, value1->type, target);
862 ax_simple (ax, aop_swap);
874 gen_integral_promotions (struct agent_expr *ax, struct axs_value *value)
878 gen_conversion (ax, value->type, builtin_type_int);
883 gen_conversion (ax, value->type, builtin_type_unsigned_int);
891 gen_cast (struct agent_expr *ax, struct axs_value *value, struct type *type)
895 require_rvalue (ax, value);
922 gen_conversion (ax, value->type, type);
947 gen_scale (struct agent_expr *ax, enum agent_op op, struct type *type)
953 ax_const_l (ax, TYPE_LENGTH (element));
954 ax_simple (ax, op);
965 gen_add (struct agent_expr *ax, struct axs_value *value,
973 ax_simple (ax, aop_swap);
974 gen_scale (ax, aop_mul, value2->type);
975 ax_simple (ax, aop_add);
976 gen_extend (ax, value2->type); /* Catch overflow. */
984 gen_scale (ax, aop_mul, value1->type);
985 ax_simple (ax, aop_add);
986 gen_extend (ax, value1->type); /* Catch overflow. */
995 ax_simple (ax, aop_add);
996 gen_extend (ax, value1->type); /* Catch overflow. */
1012 gen_sub (struct agent_expr *ax, struct axs_value *value,
1020 gen_scale (ax, aop_mul, value1->type);
1021 ax_simple (ax, aop_sub);
1022 gen_extend (ax, value1->type); /* Catch overflow. */
1033 ax_simple (ax, aop_sub);
1034 gen_scale (ax, aop_div_unsigned, value1->type);
1047 ax_simple (ax, aop_sub);
1048 gen_extend (ax, value1->type); /* Catch overflow. */
1065 gen_binop (struct agent_expr *ax, struct axs_value *value,
1074 ax_simple (ax,
1077 gen_extend (ax, value1->type); /* catch overflow */
1084 gen_logical_not (struct agent_expr *ax, struct axs_value *value)
1090 gen_usual_unary (ax, value);
1091 ax_simple (ax, aop_log_not);
1097 gen_complement (struct agent_expr *ax, struct axs_value *value)
1102 gen_usual_unary (ax, value);
1103 gen_integral_promotions (ax, value);
1104 ax_simple (ax, aop_bit_not);
1105 gen_extend (ax, value->type);
1115 gen_deref (struct agent_expr *ax, struct axs_value *value)
1136 gen_address_of (struct agent_expr *ax, struct axs_value *value)
1203 gen_bitfield_ref (struct agent_expr *ax, struct axs_value *value,
1282 ax_simple (ax, aop_dup); /* keep a copy of the address */
1285 gen_offset (ax, offset / TARGET_CHAR_BIT);
1290 ax_trace_quick (ax, op_size / TARGET_CHAR_BIT);
1294 ax_simple (ax, ops[op]);
1331 gen_left_shift (ax, end - (offset + op_size));
1333 gen_left_shift (ax, offset - start);
1337 ax_simple (ax, aop_swap);
1347 ax_simple (ax, aop_bit_or);
1350 ((TYPE_UNSIGNED (type) ? ax_zero_ext : ax_ext) (ax, end - start));
1364 gen_struct_ref (struct agent_expr *ax, struct axs_value *value, char *field,
1375 gen_usual_unary (ax, value);
1376 gen_deref (ax, value);
1395 gen_bitfield_ref (ax, value, TYPE_FIELD_TYPE (type, i),
1401 gen_offset (ax, TYPE_FIELD_BITPOS (type, i) / TARGET_CHAR_BIT);
1420 gen_repeat (union exp_element **pc, struct agent_expr *ax,
1426 gen_expr (pc, ax, &value1);
1463 gen_sizeof (union exp_element **pc, struct agent_expr *ax,
1471 int start = ax->len;
1472 gen_expr (pc, ax, value);
1475 ax->len = start;
1477 ax_const_l (ax, TYPE_LENGTH (value->type));
1489 gen_expr (union exp_element **pc, struct agent_expr *ax,
1502 ax_const_l (ax, value_as_long (v));
1523 gen_expr (pc, ax, &value1);
1524 gen_usual_unary (ax, &value1);
1525 gen_expr (pc, ax, &value2);
1526 gen_usual_unary (ax, &value2);
1527 gen_usual_arithmetic (ax, &value1, &value2);
1531 gen_add (ax, value, &value1, &value2, "addition");
1534 gen_sub (ax, value, &value1, &value2);
1537 gen_binop (ax, value, &value1, &value2,
1541 gen_binop (ax, value, &value1, &value2,
1545 gen_binop (ax, value, &value1, &value2,
1549 gen_add (ax, value, &value1, &value2, "array subscripting");
1552 gen_deref (ax, value);
1555 gen_binop (ax, value, &value1, &value2,
1560 gen_binop (ax, value, &value1, &value2,
1565 gen_binop (ax, value, &value1, &value2,
1585 gen_expr (pc, ax, &value1);
1589 gen_traced_pop (ax, &value1);
1590 gen_expr (pc, ax, value);
1599 gen_int_literal (ax, value, k, type);
1604 gen_var_ref (ax, value, (*pc)[2].symbol);
1625 gen_repeat (pc, ax, value);
1632 gen_expr (pc, ax, value);
1633 gen_cast (ax, value, type);
1641 gen_expr (pc, ax, value);
1658 gen_int_literal (ax, &value1, (LONGEST) 0, builtin_type_int);
1659 gen_usual_unary (ax, &value1); /* shouldn't do much */
1660 gen_expr (pc, ax, &value2);
1661 gen_usual_unary (ax, &value2);
1662 gen_usual_arithmetic (ax, &value1, &value2);
1663 gen_sub (ax, value, &value1, &value2);
1668 gen_expr (pc, ax, value);
1669 gen_logical_not (ax, value);
1674 gen_expr (pc, ax, value);
1675 gen_complement (ax, value);
1680 gen_expr (pc, ax, value);
1681 gen_usual_unary (ax, value);
1684 gen_deref (ax, value);
1689 gen_expr (pc, ax, value);
1690 gen_address_of (ax, value);
1698 gen_sizeof (pc, ax, value);
1708 gen_expr (pc, ax, value);
1710 gen_struct_ref (ax, value, name, ".", "structure or union");
1712 gen_struct_ref (ax, value, name, "->",
1742 struct agent_expr *ax = new_agent_expr (0);
1745 old_chain = make_cleanup_free_agent_expr (ax);
1749 gen_expr (&pc, ax, value);
1755 return ax;
1769 struct agent_expr *ax = expr_to_agent (expr, &value);
1774 free_agent_expr (ax);
1779 ax_const_l (ax, TYPE_LENGTH (value.type));
1781 return ax;
1794 struct agent_expr *ax = new_agent_expr (scope);
1798 old_chain = make_cleanup_free_agent_expr (ax);
1802 gen_expr (&pc, ax, &value);
1805 gen_traced_pop (ax, &value);
1808 ax_simple (ax, aop_end);
1814 return ax;