diff options
author | Tom Tromey <tom@tromey.com> | 2021-03-08 07:27:57 -0700 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2021-03-08 07:28:36 -0700 |
commit | efe3af2f9a6da088a00961d579318213eeb266d4 (patch) | |
tree | bd276e76dcfc87c9434a821ba166963baed2441b /gdb/ada-exp.h | |
parent | ebc06ad8f4365b8881ac40760fbb8cc71b490edd (diff) | |
download | gdb-efe3af2f9a6da088a00961d579318213eeb266d4.zip gdb-efe3af2f9a6da088a00961d579318213eeb266d4.tar.gz gdb-efe3af2f9a6da088a00961d579318213eeb266d4.tar.bz2 |
Implement function calls for Ada
This implements function calls for Ada. This takes a different
approach than that used for other languages, primarily because Ada
requires special treatment generally. The "ordinary" special case for
just the callee didn't really apply neatly here; there's only one case
in Ada needing special callee treatment.
gdb/ChangeLog
2021-03-08 Tom Tromey <tom@tromey.com>
* ada-lang.c (ada_funcall_operation::evaluate): New method.
* ada-exp.h (class ada_var_msym_value_operation) <get_symbol>: New
method.
(class ada_funcall_operation): New.
Diffstat (limited to 'gdb/ada-exp.h')
-rw-r--r-- | gdb/ada-exp.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/gdb/ada-exp.h b/gdb/ada-exp.h index 34b9c1d..287ed5c 100644 --- a/gdb/ada-exp.h +++ b/gdb/ada-exp.h @@ -320,6 +320,9 @@ public: struct expression *exp, enum noside noside) override; + symbol *get_symbol () const + { return std::get<0> (m_storage); } + protected: using operation::do_generate_ax; @@ -387,6 +390,22 @@ public: { return STRUCTOP_STRUCT; } }; +/* Function calls for Ada. */ +class ada_funcall_operation + : public tuple_holding_operation<operation_up, std::vector<operation_up>> +{ +public: + + using tuple_holding_operation::tuple_holding_operation; + + value *evaluate (struct type *expect_type, + struct expression *exp, + enum noside noside) override; + + enum exp_opcode opcode () const override + { return OP_FUNCALL; } +}; + } /* namespace expr */ #endif /* ADA_EXP_H */ |