public inbox for gdb@sourceware.org
 help / color / mirror / Atom feed
From: Joost van der Sluis <joost@cnoc.nl>
To: gdb@sourceware.org
Cc: Pierre Free Pascal <pierre@freepascal.org>
Subject: Calling class-methods in pascal (fpc)
Date: Mon, 19 Sep 2011 19:47:00 -0000	[thread overview]
Message-ID: <1316461626.3660.12.camel@feddie.cnoc.lan> (raw)

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.

             reply	other threads:[~2011-09-19 19:47 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-19 19:47 Joost van der Sluis [this message]
2011-10-05 18:04 ` Tom Tromey

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1316461626.3660.12.camel@feddie.cnoc.lan \
    --to=joost@cnoc.nl \
    --cc=gdb@sourceware.org \
    --cc=pierre@freepascal.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).