GDB (xrefs)
Loading...
Searching...
No Matches
ada-exp.h
Go to the documentation of this file.
1/* Definitions for Ada expressions
2
3 Copyright (C) 2020-2023 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#ifndef ADA_EXP_H
21#define ADA_EXP_H
22
23#include "expop.h"
24
25extern struct value *ada_unop_neg (struct type *expect_type,
26 struct expression *exp,
27 enum noside noside, enum exp_opcode op,
28 struct value *arg1);
29extern struct value *ada_atr_tag (struct type *expect_type,
30 struct expression *exp,
31 enum noside noside, enum exp_opcode op,
32 struct value *arg1);
33extern struct value *ada_atr_size (struct type *expect_type,
34 struct expression *exp,
35 enum noside noside, enum exp_opcode op,
36 struct value *arg1);
37extern struct value *ada_abs (struct type *expect_type,
38 struct expression *exp,
39 enum noside noside, enum exp_opcode op,
40 struct value *arg1);
41extern struct value *ada_unop_in_range (struct type *expect_type,
42 struct expression *exp,
43 enum noside noside, enum exp_opcode op,
44 struct value *arg1, struct type *type);
45extern struct value *ada_mult_binop (struct type *expect_type,
46 struct expression *exp,
47 enum noside noside, enum exp_opcode op,
48 struct value *arg1, struct value *arg2);
49extern struct value *ada_equal_binop (struct type *expect_type,
50 struct expression *exp,
51 enum noside noside, enum exp_opcode op,
52 struct value *arg1, struct value *arg2);
53extern struct value *ada_ternop_slice (struct expression *exp,
54 enum noside noside,
55 struct value *array,
56 struct value *low_bound_val,
57 struct value *high_bound_val);
58extern struct value *ada_binop_in_bounds (struct expression *exp,
59 enum noside noside,
60 struct value *arg1,
61 struct value *arg2,
62 int n);
63extern struct value *ada_binop_minmax (struct type *expect_type,
64 struct expression *exp,
65 enum noside noside, enum exp_opcode op,
66 struct value *arg1,
67 struct value *arg2);
68extern struct value *ada_pos_atr (struct type *expect_type,
69 struct expression *exp,
70 enum noside noside, enum exp_opcode op,
71 struct value *arg);
72extern struct value *ada_atr_enum_rep (struct expression *exp,
73 enum noside noside, struct type *type,
74 struct value *arg);
75extern struct value *ada_atr_enum_val (struct expression *exp,
76 enum noside noside, struct type *type,
77 struct value *arg);
78extern struct value *ada_val_atr (struct expression *exp,
79 enum noside noside, struct type *type,
80 struct value *arg);
81extern struct value *ada_binop_exp (struct type *expect_type,
82 struct expression *exp,
83 enum noside noside, enum exp_opcode op,
84 struct value *arg1, struct value *arg2);
85
86namespace expr
87{
88
89/* The base class for Ada type resolution. Ada operations that want
90 to participate in resolution implement this interface. */
92{
93 /* Resolve this object. EXP is the expression being resolved.
94 DEPROCEDURE_P is true if a symbol that refers to a zero-argument
95 function may be turned into a function call. PARSE_COMPLETION
96 and TRACKER are passed in from the parser context. CONTEXT_TYPE
97 is the expected type of the expression, or nullptr if none is
98 known. This method should return true if the operation should be
99 replaced by a function call with this object as the callee. */
100 virtual bool resolve (struct expression *exp,
101 bool deprocedure_p,
102 bool parse_completion,
104 struct type *context_type) = 0;
105
106 /* Possibly replace this object with some other expression object.
107 This is like 'resolve', but can return a replacement.
108
109 The default implementation calls 'resolve' and wraps this object
110 in a function call if that call returns true. OWNER is a
111 reference to the unique pointer that owns the 'this'; it can be
112 'move'd from to construct the replacement.
113
114 This should either return a new object, or OWNER -- never
115 nullptr. */
116
117 virtual operation_up replace (operation_up &&owner,
118 struct expression *exp,
119 bool deprocedure_p,
120 bool parse_completion,
122 struct type *context_type);
123};
124
125/* In Ada, some generic operations must be wrapped with a handler that
126 handles some Ada-specific type conversions. */
128 : public tuple_holding_operation<operation_up>
129{
130public:
131
133
134 value *evaluate (struct type *expect_type,
135 struct expression *exp,
136 enum noside noside) override;
137
138 enum exp_opcode opcode () const override
139 { return std::get<0> (m_storage)->opcode (); }
140
141protected:
142
143 void do_generate_ax (struct expression *exp,
144 struct agent_expr *ax,
145 struct axs_value *value,
146 struct type *cast_type)
147 override;
148};
149
150/* An Ada string constant. */
152 : public string_operation
153{
154public:
155
156 using string_operation::string_operation;
157
158 /* Return the underlying string. */
159 const char *get_name () const
160 {
161 return std::get<0> (m_storage).c_str ();
162 }
163
164 value *evaluate (struct type *expect_type,
165 struct expression *exp,
166 enum noside noside) override;
167};
168
169/* The Ada TYPE'(EXP) construct. */
171 : public tuple_holding_operation<operation_up, struct type *>
172{
173public:
174
176
177 value *evaluate (struct type *expect_type,
178 struct expression *exp,
179 enum noside noside) override;
180
181 enum exp_opcode opcode () const override
182 { return UNOP_QUAL; }
183};
184
185/* Ternary in-range operator. */
187 : public tuple_holding_operation<operation_up, operation_up, operation_up>
188{
189public:
190
192
193 value *evaluate (struct type *expect_type,
194 struct expression *exp,
195 enum noside noside) override;
196
197 enum exp_opcode opcode () const override
198 { return TERNOP_IN_RANGE; }
199};
200
206
207/* The in-range operation, given a type. */
209 : public tuple_holding_operation<operation_up, struct type *>
210{
211public:
212
214
215 value *evaluate (struct type *expect_type,
216 struct expression *exp,
217 enum noside noside) override
218 {
219 value *val = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
220 return ada_unop_in_range (expect_type, exp, noside, UNOP_IN_RANGE,
221 val, std::get<1> (m_storage));
222 }
223
224 enum exp_opcode opcode () const override
225 { return UNOP_IN_RANGE; }
226};
227
228/* The Ada + and - operators. */
230 : public tuple_holding_operation<enum exp_opcode, operation_up, operation_up>
231{
232public:
233
235
236 value *evaluate (struct type *expect_type,
237 struct expression *exp,
238 enum noside noside) override;
239
240 enum exp_opcode opcode () const override
241 { return std::get<0> (m_storage); }
242};
243
248
251
253
254/* Implement the equal and not-equal operations for Ada. */
256 : public tuple_holding_operation<enum exp_opcode, operation_up, operation_up>
257{
258public:
259
261
262 value *evaluate (struct type *expect_type,
263 struct expression *exp,
264 enum noside noside) override
265 {
266 value *arg1 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
267 value *arg2 = std::get<2> (m_storage)->evaluate (arg1->type (),
268 exp, noside);
269 return ada_equal_binop (expect_type, exp, noside, std::get<0> (m_storage),
270 arg1, arg2);
271 }
272
273 void do_generate_ax (struct expression *exp,
274 struct agent_expr *ax,
275 struct axs_value *value,
276 struct type *cast_type)
277 override
278 {
279 gen_expr_binop (exp, opcode (),
280 std::get<1> (this->m_storage).get (),
281 std::get<2> (this->m_storage).get (),
282 ax, value);
283 }
284
285 enum exp_opcode opcode () const override
286 { return std::get<0> (m_storage); }
287};
288
289/* Bitwise operators for Ada. */
290template<enum exp_opcode OP>
292 : public maybe_constant_operation<operation_up, operation_up>
293{
294public:
295
296 using maybe_constant_operation::maybe_constant_operation;
297
298 value *evaluate (struct type *expect_type,
299 struct expression *exp,
300 enum noside noside) override
301 {
302 value *lhs = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
303 value *rhs = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
304 value *result = eval_op_binary (expect_type, exp, noside, OP, lhs, rhs);
305 return value_cast (lhs->type (), result);
306 }
307
308 enum exp_opcode opcode () const override
309 { return OP; }
310};
311
315
316/* Ada array- or string-slice operation. */
318 : public maybe_constant_operation<operation_up, operation_up, operation_up>,
319 public ada_resolvable
320{
321public:
322
323 using maybe_constant_operation::maybe_constant_operation;
324
325 value *evaluate (struct type *expect_type,
326 struct expression *exp,
327 enum noside noside) override
328 {
329 value *array = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
330 value *low = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
331 value *high = std::get<2> (m_storage)->evaluate (nullptr, exp, noside);
332 return ada_ternop_slice (exp, noside, array, low, high);
333 }
334
335 enum exp_opcode opcode () const override
336 { return TERNOP_SLICE; }
337
338 bool resolve (struct expression *exp,
339 bool deprocedure_p,
340 bool parse_completion,
342 struct type *context_type) override;
343};
344
345/* Implement BINOP_IN_BOUNDS for Ada. */
347 : public maybe_constant_operation<operation_up, operation_up, int>
348{
349public:
350
351 using maybe_constant_operation::maybe_constant_operation;
352
353 value *evaluate (struct type *expect_type,
354 struct expression *exp,
355 enum noside noside) override
356 {
357 value *arg1 = std::get<0> (m_storage)->evaluate (nullptr, exp, noside);
358 value *arg2 = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
359 return ada_binop_in_bounds (exp, noside, arg1, arg2,
360 std::get<2> (m_storage));
361 }
362
363 enum exp_opcode opcode () const override
364 { return BINOP_IN_BOUNDS; }
365};
366
367/* Implement several unary Ada OP_ATR_* operations. */
369 : public maybe_constant_operation<operation_up, enum exp_opcode, int>
370{
371public:
372
373 using maybe_constant_operation::maybe_constant_operation;
374
375 value *evaluate (struct type *expect_type,
376 struct expression *exp,
377 enum noside noside) override;
378
379 enum exp_opcode opcode () const override
380 { return std::get<1> (m_storage); }
381};
382
383/* Variant of var_value_operation for Ada. */
385 : public var_value_operation, public ada_resolvable
386{
387public:
388
389 using var_value_operation::var_value_operation;
390
391 value *evaluate (struct type *expect_type,
392 struct expression *exp,
393 enum noside noside) override;
394
395 value *evaluate_for_cast (struct type *expect_type,
396 struct expression *exp,
397 enum noside noside) override;
398
399 const block *get_block () const
400 { return std::get<0> (m_storage).block; }
401
402 bool resolve (struct expression *exp,
403 bool deprocedure_p,
404 bool parse_completion,
406 struct type *context_type) override;
407
408protected:
409
410 void do_generate_ax (struct expression *exp,
411 struct agent_expr *ax,
412 struct axs_value *value,
413 struct type *cast_type)
414 override;
415};
416
417/* Variant of var_msym_value_operation for Ada. */
420{
421public:
422
423 using var_msym_value_operation::var_msym_value_operation;
424
425 value *evaluate_for_cast (struct type *expect_type,
426 struct expression *exp,
427 enum noside noside) override;
428
429protected:
430
432};
433
434typedef struct value *ada_atr_ftype (struct expression *exp,
435 enum noside noside,
436 struct type *type,
437 struct value *arg);
438
439/* Implement several Ada attributes. */
440template<ada_atr_ftype FUNC>
442 : public tuple_holding_operation<struct type *, operation_up>
443{
444public:
445
447
448 value *evaluate (struct type *expect_type,
449 struct expression *exp,
450 enum noside noside) override
451 {
452 value *arg = std::get<1> (m_storage)->evaluate (nullptr, exp, noside);
453 return FUNC (exp, noside, std::get<0> (m_storage), arg);
454 }
455
456 enum exp_opcode opcode () const override
457 {
458 /* The value here generally doesn't matter. */
459 return OP_ATR_VAL;
460 }
461};
462
466
467/* The indirection operator for Ada. */
470{
471public:
472
473 using unop_ind_base_operation::unop_ind_base_operation;
474
475 value *evaluate (struct type *expect_type,
476 struct expression *exp,
477 enum noside noside) override;
478};
479
480/* Implement STRUCTOP_STRUCT for Ada. */
483{
484public:
485
486 using structop_base_operation::structop_base_operation;
487
488 value *evaluate (struct type *expect_type,
489 struct expression *exp,
490 enum noside noside) override;
491
492 enum exp_opcode opcode () const override
493 { return STRUCTOP_STRUCT; }
494
495 /* Set the completion prefix. */
496 void set_prefix (std::string &&prefix)
497 {
498 m_prefix = std::move (prefix);
499 }
500
501 bool complete (struct expression *exp, completion_tracker &tracker) override
502 {
503 return structop_base_operation::complete (exp, tracker, m_prefix.c_str ());
504 }
505
506 void dump (struct ui_file *stream, int depth) const override
507 {
508 structop_base_operation::dump (stream, depth);
509 dump_for_expression (stream, depth + 1, m_prefix);
510 }
511
512private:
513
514 /* We may need to provide a prefix to field name completion. See
515 ada-exp.y:find_completion_bounds for details. */
516 std::string m_prefix;
517};
518
519/* Function calls for Ada. */
521 : public tuple_holding_operation<operation_up, std::vector<operation_up>>,
522 public ada_resolvable
523{
524public:
525
527
528 value *evaluate (struct type *expect_type,
529 struct expression *exp,
530 enum noside noside) override;
531
532 bool resolve (struct expression *exp,
533 bool deprocedure_p,
534 bool parse_completion,
536 struct type *context_type) override;
537
538 enum exp_opcode opcode () const override
539 { return OP_FUNCALL; }
540};
541
542/* An Ada assignment operation. */
544 : public assign_operation
545{
546public:
547
548 using assign_operation::assign_operation;
549
550 value *evaluate (struct type *expect_type,
551 struct expression *exp,
552 enum noside noside) override;
553
554 enum exp_opcode opcode () const override
555 { return BINOP_ASSIGN; }
556
558 { return m_current; }
559
560 /* A helper function for the parser to evaluate just the LHS of the
561 assignment. */
563 {
564 return std::get<0> (m_storage)->evaluate (nullptr, exp,
566 }
567
568 /* The parser must construct the assignment node before parsing the
569 RHS, so that '@' can access the assignment, so this helper
570 function is needed to set the RHS after construction. */
572 {
573 std::get<1> (m_storage) = std::move (rhs);
574 }
575
576private:
577
578 /* Temporary storage for the value of the left-hand-side. */
579 value *m_current = nullptr;
580};
581
582/* Implement the Ada target name symbol ('@'). This is used to refer
583 to the LHS of an assignment from the RHS. */
585{
586public:
587
589 : m_lhs (lhs)
590 { }
591
592 value *evaluate (struct type *expect_type,
593 struct expression *exp,
594 enum noside noside) override
595 {
597 return m_lhs->eval_for_resolution (exp);
598 return m_lhs->current ();
599 }
600
601 enum exp_opcode opcode () const override
602 {
603 /* It doesn't really matter. */
604 return OP_VAR_VALUE;
605 }
606
607 void dump (struct ui_file *stream, int depth) const override
608 {
609 gdb_printf (stream, _("%*sAda target symbol '@'\n"), depth, "");
610 }
611
612private:
613
614 /* The left hand side of the assignment. */
616};
617
618/* This abstract class represents a single component in an Ada
619 aggregate assignment. */
621{
622public:
623
624 /* Assign to LHS, which is part of CONTAINER. EXP is the expression
625 being evaluated. INDICES, LOW, and HIGH indicate which
626 sub-components have already been assigned; INDICES should be
627 updated by this call. */
628 virtual void assign (struct value *container,
629 struct value *lhs, struct expression *exp,
630 std::vector<LONGEST> &indices,
631 LONGEST low, LONGEST high) = 0;
632
633 /* Same as operation::uses_objfile. */
634 virtual bool uses_objfile (struct objfile *objfile) = 0;
635
636 /* Same as operation::dump. */
637 virtual void dump (ui_file *stream, int depth) = 0;
638
639 virtual ~ada_component () = default;
640
641protected:
642
643 ada_component () = default;
645};
646
647/* Unique pointer specialization for Ada assignment components. */
648typedef std::unique_ptr<ada_component> ada_component_up;
649
650/* An operation that holds a single component. */
652 : public tuple_holding_operation<ada_component_up>
653{
654public:
655
657
658 /* Assuming that LHS represents an lvalue having a record or array
659 type, evaluate an assignment of this aggregate's value to LHS.
660 CONTAINER is an lvalue containing LHS (possibly LHS itself).
661 Does not modify the inferior's memory, nor does it modify the
662 contents of LHS (unless == CONTAINER). Returns the modified
663 CONTAINER. */
664
665 value *assign_aggregate (struct value *container,
666 struct value *lhs,
667 struct expression *exp);
668
669 value *evaluate (struct type *expect_type,
670 struct expression *exp,
671 enum noside noside) override
672 {
673 error (_("Aggregates only allowed on the right of an assignment"));
674 }
675
676 enum exp_opcode opcode () const override
677 { return OP_AGGREGATE; }
678};
679
680/* A component holding a vector of other components to assign. */
682{
683public:
684
685 explicit ada_aggregate_component (std::vector<ada_component_up> &&components)
686 : m_components (std::move (components))
687 {
688 }
689
690 void assign (struct value *container,
691 struct value *lhs, struct expression *exp,
692 std::vector<LONGEST> &indices,
693 LONGEST low, LONGEST high) override;
694
695 bool uses_objfile (struct objfile *objfile) override;
696
697 void dump (ui_file *stream, int depth) override;
698
699private:
700
701 std::vector<ada_component_up> m_components;
702};
703
704/* A component that assigns according to a provided index (which is
705 relative to the "low" value). */
707{
708public:
709
711 : m_index (index),
712 m_op (std::move (op))
713 {
714 }
715
716 void assign (struct value *container,
717 struct value *lhs, struct expression *exp,
718 std::vector<LONGEST> &indices,
719 LONGEST low, LONGEST high) override;
720
721 bool uses_objfile (struct objfile *objfile) override;
722
723 void dump (ui_file *stream, int depth) override;
724
725private:
726
729};
730
731/* A component which handles an "others" clause. */
733{
734public:
735
737 : m_op (std::move (op))
738 {
739 }
740
741 void assign (struct value *container,
742 struct value *lhs, struct expression *exp,
743 std::vector<LONGEST> &indices,
744 LONGEST low, LONGEST high) override;
745
746 bool uses_objfile (struct objfile *objfile) override;
747
748 void dump (ui_file *stream, int depth) override;
749
750private:
751
753};
754
755/* An interface that represents an association that is used in
756 aggregate assignment. */
758{
759public:
760
761 /* Like ada_component::assign, but takes an operation as a
762 parameter. The operation is evaluated and then assigned into LHS
763 according to the rules of the concrete implementation. */
764 virtual void assign (struct value *container,
765 struct value *lhs,
766 struct expression *exp,
767 std::vector<LONGEST> &indices,
768 LONGEST low, LONGEST high,
769 operation_up &op) = 0;
770
771 /* Same as operation::uses_objfile. */
772 virtual bool uses_objfile (struct objfile *objfile) = 0;
773
774 /* Same as operation::dump. */
775 virtual void dump (ui_file *stream, int depth) = 0;
776
777 virtual ~ada_association () = default;
778
779protected:
780
781 ada_association () = default;
783};
784
785/* Unique pointer specialization for Ada assignment associations. */
786typedef std::unique_ptr<ada_association> ada_association_up;
787
788/* A component that holds a vector of associations and an operation.
789 The operation is re-evaluated for each choice. */
791{
792public:
793
795 : m_op (std::move (op))
796 {
797 }
798
799 /* Set the vector of associations. This is done separately from the
800 constructor because it was simpler for the implementation of the
801 parser. */
802 void set_associations (std::vector<ada_association_up> &&assoc)
803 {
804 m_assocs = std::move (assoc);
805 }
806
807 void assign (struct value *container,
808 struct value *lhs, struct expression *exp,
809 std::vector<LONGEST> &indices,
810 LONGEST low, LONGEST high) override;
811
812 bool uses_objfile (struct objfile *objfile) override;
813
814 void dump (ui_file *stream, int depth) override;
815
816private:
817
818 std::vector<ada_association_up> m_assocs;
820};
821
822/* An association that uses a discrete range. */
824{
825public:
826
828 : m_low (std::move (low)),
829 m_high (std::move (high))
830 {
831 }
832
833 void assign (struct value *container,
834 struct value *lhs, struct expression *exp,
835 std::vector<LONGEST> &indices,
836 LONGEST low, LONGEST high,
837 operation_up &op) override;
838
839 bool uses_objfile (struct objfile *objfile) override;
840
841 void dump (ui_file *stream, int depth) override;
842
843private:
844
847};
848
849/* An association that uses a name. The name may be an expression
850 that evaluates to an integer (for arrays), or an Ada string or
851 variable value operation. */
853{
854public:
855
857 : m_val (std::move (val))
858 {
859 }
860
861 void assign (struct value *container,
862 struct value *lhs, struct expression *exp,
863 std::vector<LONGEST> &indices,
864 LONGEST low, LONGEST high,
865 operation_up &op) override;
866
867 bool uses_objfile (struct objfile *objfile) override;
868
869 void dump (ui_file *stream, int depth) override;
870
871private:
872
874};
875
876/* A character constant expression. This is a separate operation so
877 that it can participate in resolution, so that TYPE'(CST) can
878 work correctly for enums with character enumerators. */
880 public ada_resolvable
881{
882public:
883
885
886 bool resolve (struct expression *exp,
887 bool deprocedure_p,
888 bool parse_completion,
890 struct type *context_type) override
891 {
892 /* This should never be called, because this class also implements
893 'replace'. */
894 gdb_assert_not_reached ("unexpected call");
895 }
896
898 struct expression *exp,
899 bool deprocedure_p,
900 bool parse_completion,
902 struct type *context_type) override;
903
904 value *evaluate (struct type *expect_type,
905 struct expression *exp,
906 enum noside noside) override;
907};
908
910{
911public:
912
913 using concat_operation::concat_operation;
914
915 value *evaluate (struct type *expect_type,
916 struct expression *exp,
917 enum noside noside) override;
918};
919
920} /* namespace expr */
921
922#endif /* ADA_EXP_H */
constexpr string_view get()
Definition 70483.cc:49
struct value * ada_pos_atr(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg)
Definition ada-lang.c:8802
struct value * ada_unop_neg(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
Definition ada-lang.c:10059
struct value * ada_ternop_slice(struct expression *exp, enum noside noside, struct value *array, struct value *low_bound_val, struct value *high_bound_val)
Definition ada-lang.c:10199
struct value * ada_atr_enum_val(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
Definition ada-lang.c:8866
struct value * ada_atr_tag(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
Definition ada-lang.c:10105
struct value * ada_binop_exp(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
Definition ada-lang.c:10460
struct value * ada_atr_enum_rep(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
Definition ada-lang.c:8847
struct value * ada_val_atr(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
Definition ada-lang.c:8831
struct value * ada_unop_in_range(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct type *type)
Definition ada-lang.c:10071
struct value * ada_abs(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
Definition ada-lang.c:10142
struct value * ada_mult_binop(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
Definition ada-lang.c:10157
struct value * ada_atr_size(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1)
Definition ada-lang.c:10119
struct value * ada_equal_binop(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
Definition ada-lang.c:10177
struct value * ada_binop_minmax(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
Definition ada-lang.c:10443
struct value * ada_binop_in_bounds(struct expression *exp, enum noside noside, struct value *arg1, struct value *arg2, int n)
Definition ada-lang.c:10280
void gen_expr_binop(struct expression *exp, enum exp_opcode op, expr::operation *lhs, expr::operation *rhs, struct agent_expr *ax, struct axs_value *value)
Definition ax-gdb.c:2230
ada_aggregate_component(std::vector< ada_component_up > &&components)
Definition ada-exp.h:685
std::vector< ada_component_up > m_components
Definition ada-exp.h:701
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9430
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
Definition ada-lang.c:9447
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9439
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:669
enum exp_opcode opcode() const override
Definition ada-exp.h:676
value * assign_aggregate(struct value *container, struct value *lhs, struct expression *exp)
Definition ada-lang.c:9459
value * eval_for_resolution(struct expression *exp)
Definition ada-exp.h:562
void set_rhs(operation_up rhs)
Definition ada-exp.h:571
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:9696
enum exp_opcode opcode() const override
Definition ada-exp.h:554
virtual bool uses_objfile(struct objfile *objfile)=0
DISABLE_COPY_AND_ASSIGN(ada_association)
virtual void dump(ui_file *stream, int depth)=0
virtual void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high, operation_up &op)=0
virtual ~ada_association()=default
enum exp_opcode opcode() const override
Definition ada-exp.h:456
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:448
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10743
enum exp_opcode opcode() const override
Definition ada-exp.h:240
enum exp_opcode opcode() const override
Definition ada-exp.h:285
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:262
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
Definition ada-exp.h:273
enum exp_opcode opcode() const override
Definition ada-exp.h:363
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:353
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:298
enum exp_opcode opcode() const override
Definition ada-exp.h:308
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10542
operation_up replace(operation_up &&owner, struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
Definition ada-lang.c:10555
bool resolve(struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type) override
Definition ada-exp.h:886
void set_associations(std::vector< ada_association_up > &&assoc)
Definition ada-exp.h:802
ada_choices_component(operation_up &&op)
Definition ada-exp.h:794
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9642
std::vector< ada_association_up > m_assocs
Definition ada-exp.h:818
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
Definition ada-lang.c:9655
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9631
virtual void dump(ui_file *stream, int depth)=0
virtual void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high)=0
ada_component()=default
virtual ~ada_component()=default
DISABLE_COPY_AND_ASSIGN(ada_component)
virtual bool uses_objfile(struct objfile *objfile)=0
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10678
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9535
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high, operation_up &op) override
Definition ada-lang.c:9549
ada_discrete_range_association(operation_up &&low, operation_up &&high)
Definition ada-exp.h:827
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9541
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:11117
enum exp_opcode opcode() const override
Definition ada-exp.h:538
ada_name_association(operation_up val)
Definition ada-exp.h:856
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9577
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high, operation_up &op) override
Definition ada-lang.c:9584
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9571
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9665
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
Definition ada-lang.c:9682
ada_others_component(operation_up &&op)
Definition ada-exp.h:736
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9671
ada_positional_component(int index, operation_up &&op)
Definition ada-exp.h:710
void assign(struct value *container, struct value *lhs, struct expression *exp, std::vector< LONGEST > &indices, LONGEST low, LONGEST high) override
Definition ada-lang.c:9518
bool uses_objfile(struct objfile *objfile) override
Definition ada-lang.c:9500
void dump(ui_file *stream, int depth) override
Definition ada-lang.c:9506
enum exp_opcode opcode() const override
Definition ada-exp.h:181
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10723
const char * get_name() const
Definition ada-exp.h:159
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10614
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:11075
bool complete(struct expression *exp, completion_tracker &tracker) override
Definition ada-exp.h:501
void set_prefix(std::string &&prefix)
Definition ada-exp.h:496
void dump(struct ui_file *stream, int depth) const override
Definition ada-exp.h:506
enum exp_opcode opcode() const override
Definition ada-exp.h:492
void dump(struct ui_file *stream, int depth) const override
Definition ada-exp.h:607
enum exp_opcode opcode() const override
Definition ada-exp.h:601
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:592
ada_target_operation(ada_assign_operation *lhs)
Definition ada-exp.h:588
ada_assign_operation * m_lhs
Definition ada-exp.h:615
enum exp_opcode opcode() const override
Definition ada-exp.h:197
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10732
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:325
enum exp_opcode opcode() const override
Definition ada-exp.h:335
enum exp_opcode opcode() const override
Definition ada-exp.h:379
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10783
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10991
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-exp.h:215
enum exp_opcode opcode() const override
Definition ada-exp.h:224
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10804
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10850
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
Definition ada-lang.c:10964
const block * get_block() const
Definition ada-exp.h:399
value * evaluate_for_cast(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10828
value * evaluate(struct type *expect_type, struct expression *exp, enum noside noside) override
Definition ada-lang.c:10576
void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type) override
Definition ada-lang.c:10599
enum exp_opcode opcode() const override
Definition ada-exp.h:138
long_const_operation(struct type *type, LONGEST val)
Definition expop.h:686
virtual void do_generate_ax(struct expression *exp, struct agent_expr *ax, struct axs_value *value, struct type *cast_type)
Definition expression.h:176
virtual void dump(struct ui_file *stream, int depth) const =0
virtual bool complete(struct expression *exp, completion_tracker &tracker)
Definition expop.h:1014
tuple_holding_operation(Arg... args)
Definition expop.h:374
struct value * eval_op_binary(struct type *expect_type, struct expression *exp, enum noside noside, enum exp_opcode op, struct value *arg1, struct value *arg2)
Definition eval.c:1352
#define OP(name)
exp_opcode
Definition expression.h:45
noside
Definition expression.h:56
@ EVAL_AVOID_SIDE_EFFECTS
Definition expression.h:58
Definition ada-exp.h:87
struct value * ada_atr_ftype(struct expression *exp, enum noside noside, struct type *type, struct value *arg)
Definition ada-exp.h:434
std::unique_ptr< operation > operation_up
Definition expression.h:82
std::unique_ptr< ada_association > ada_association_up
Definition ada-exp.h:786
static void dump_for_expression(struct ui_file *stream, int depth, const operation_up &op)
Definition expop.h:309
std::unique_ptr< ada_component > ada_component_up
Definition ada-exp.h:648
Definition aarch64.h:67
#define prefix(a, b, R, do)
Definition ppc64-tdep.c:52
#define resolve(X)
Definition block.h:109
virtual operation_up replace(operation_up &&owner, struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type)
Definition ada-lang.c:10486
virtual bool resolve(struct expression *exp, bool deprocedure_p, bool parse_completion, innermost_block_tracker *tracker, struct type *context_type)=0
Definition value.h:130
struct type * type() const
Definition value.h:180
void gdb_printf(struct ui_file *stream, const char *format,...)
Definition utils.c:1886
struct value * value_cast(struct type *type, struct value *arg2)
Definition valops.c:403