Implement function call operations
authorTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:27:57 +0000 (07:27 -0700)
committerTom Tromey <tom@tromey.com>
Mon, 8 Mar 2021 14:28:29 +0000 (07:28 -0700)
commita00b7254fb614af557de7ae7cc0eb39a0ce0e408
tree8a3d68f79a485f7c2d45ab3b0f3c1074ea793d34
parent1c02eb30358a1d31918830b800cf1ff7c817439a
Implement function call operations

This implement function call operations.

The current function call code relies on some very lengthy code
(evaluate_funcall is 398 lines...) to distinguish between the
different opcodes that might appear in the callee position.

Rather than try to replicate this, and have a function that tried to
dissect many different kinds of operation subclass, this patch instead
puts the work into the callee.  A new operation::evaluate_funcall
method is added, and then this is overridden in the classes that
require special treatment.

gdb/ChangeLog
2021-03-08  Tom Tromey  <tom@tromey.com>

* expression.h (class operation) <evaluate_funcall>: New methods.
* expop.h (class scope_operation) <evaluate_funcall>: New method.
(class var_value_operation) <evaluate_funcall>: New method.
(class structop_base_operation) <evaluate_funcall>: New method.
(class var_msym_value_operation) <evaluate_funcall>: New method.
(class structop_member_base): New class.
(class structop_member_operation): Derive from
structop_member_base.
(class structop_mptr_operation): Derive from
structop_member_base.
(class funcall_operation): New class.
* eval.c (operation::evaluate_funcall)
(var_value_operation::evaluate_funcall)
(scope_operation::evaluate_funcall)
(structop_member_base::evaluate_funcall)
(structop_base_operation::evaluate_funcall): New methods.
gdb/ChangeLog
gdb/eval.c
gdb/expop.h
gdb/expression.h
This page took 0.024858 seconds and 4 git commands to generate.