From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8989 invoked by alias); 19 Sep 2011 19:47:30 -0000 Received: (qmail 8980 invoked by uid 22791); 19 Sep 2011 19:47:29 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp-vbr5.xs4all.nl (HELO smtp-vbr5.xs4all.nl) (194.109.24.25) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 19 Sep 2011 19:47:14 +0000 Received: from cnoc.nl.alt001.com (oostvogels.xs4all.nl [83.163.197.192]) by smtp-vbr5.xs4all.nl (8.13.8/8.13.8) with ESMTP id p8JJl7Gr095489; Mon, 19 Sep 2011 21:47:08 +0200 (CEST) (envelope-from joost@cnoc.nl) Received: from localhost (localhost.localdomain [127.0.0.1]) by cnoc.nl.alt001.com (Postfix) with ESMTP id 7A395BF81; Mon, 19 Sep 2011 21:47:07 +0200 (CEST) Received: from cnoc.nl.alt001.com ([127.0.0.1]) by localhost (cnoc.nl.alt001.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1vAbulUotPTv; Mon, 19 Sep 2011 21:47:06 +0200 (CEST) Received: from [192.168.3.116] (host116.cnoc.intern [192.168.3.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cnoc.nl.alt001.com (Postfix) with ESMTPS id 8E739BBE4; Mon, 19 Sep 2011 21:47:06 +0200 (CEST) Subject: Calling class-methods in pascal (fpc) From: Joost van der Sluis To: gdb@sourceware.org Cc: Pierre Free Pascal Date: Mon, 19 Sep 2011 19:47:00 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit Message-ID: <1316461626.3660.12.camel@feddie.cnoc.lan> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-09/txt/msg00065.txt.bz2 Hi all, 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. Regards, Joost van der Sluis.