This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] Add method overload resolution to expression parser


Hi,

The attached patch is the first of several patches which will attempt mitigate the requirement of single-quoting every single C++ expression passed to the parser.

This patch specifically adds method overload resolution into parser, so now gdb correctly understands "print foo::flubber(int)".

I've added a few basic tests to gdb.cp/overload.exp, but when this series of patches is nearing completion, I will submit my archer "realcpp" tests, which are far more thorough (and currently causes gdb to crash a lot).

Tested regression-free on x86 linux.

Keith

ChangeLog
2009-09-01  Keith Seitz  <keiths@redhat.com>

	* c-exp.y: Add new rule for resolving method overloads.
	Add cleanups for nonempty_typelist.  Changed all users.
	* eval.c (make_params): New function.
	(free_param_types): New function.
	(evaluate_subexp_standard): Pass expect_type to value_aggregate_elt.
	Handle case TYPE_INSTANCE.
	(evaluate_subexp_for_address): Pass expect_type to value_aggregate_elt.
	* expression.h (enum exp_opcode): Add TYPE_INSTANCE.
	(compare_parameters): Add declaration.
	* parse.c (operator_length_standard): Add TYPE_INSTANCE.
	* valops.c (value_aggregate_elt): Add new expect_type parameter.
	Pass expect_type to value_struct_elt_for_reference.
	(value_struct_elt_for_reference): Add expect_type parameter and use
	compare_parameters.
	Check for overload matches with and without artificial parameters.
	Skip artificial methods.
	(compare_parameters): New function.
	* value.h (value_aggregate_elt): Add new expect_type parameter.

testsuite/ChangeLog
2009-09-01  Keith Seitz  <keiths@redhat.com>

	* gdb.cp/overload.exp: Add tests for resolving overloaded
	methods in expression parsing/evaluation.

Attachment: ovld-expr.patch
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]