This is the mail archive of the
mailing list for the GDB project.
Calling class-methods in pascal (fpc)
- From: Joost van der Sluis <joost at cnoc dot nl>
- To: gdb at sourceware dot org
- Cc: Pierre Free Pascal <pierre at freepascal dot org>
- Date: Mon, 19 Sep 2011 21:47:06 +0200
- Subject: Calling class-methods in pascal (fpc)
I've tried to call a method from a class in a pascal (fpc) application.
It didn't work when the language is set to Pascal. In that case it can't
find the method within the class definition. But when the language is
set to c++, it is possible to call the method.
What's happening is that in print_command_1() first parse_expression()
is called and thereafter evaluate_expression(). Now if lang=pascal,
parse_expression raises an error, because it doesn't recognize the
method as a member of the class-structure. (Because
lookup_struct_elt_type() does not check for nfn fields, but that's
beside the point)
But when lang=c++, parse_expression does not raise an exception, and
evaluate_expression does resolve the methodname. But even when the
class-member does not exist, parse_expression does not raise an
exception. The exception is raised in evaluate_expression.
Now to be able to fix this properly, I need to know what the function of
parse_expression() is compared to evaluate_expression()? To me it looks
like it that parse_expression is not needed at all.
Joost van der Sluis.