From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Tom Tromey <tromey@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] Be in language c more c++ compatible
Date: Sat, 16 Jul 2011 09:45:00 -0000 [thread overview]
Message-ID: <20110715210906.GA17148@host1.jankratochvil.net> (raw)
In-Reply-To: <m3k4bj9s7f.fsf@fleche.redhat.com>
On Fri, 15 Jul 2011 22:58:28 +0200, Tom Tromey wrote:
> >>>>> "Jan" == Jan Kratochvil <jan.kratochvil@redhat.com> writes:
> Jan> The current source language is "auto; currently c".
>
> I am curious why this happens.
> It seems like it should say "currently c++" -- I didn't check the code
> but my mental model would be that if there is no frame, then the default
> symtab should either be 'main' or, if no main, say the first CU in the
> symbol file; and the default symtab's language should be used for auto.
You are close but I do not think it matters.
One can have purely C program which has dynamically (even indirectly) linked
some library in C++ and one should be able to access C++ expressions in that
library. One cannot with the main program is in Fortran or other languages
but C vs. C++ are both mixed in the real world and also their parsing does not
conflict too much.
> Jan> The second (valops.c) part is there because with `language c++'
> Jan> parsing "C::t" is straight OP_TYPE handled correctly in
> Jan> evaluate_subexp_standard. But with `language c' it gets parsed as
> Jan> OP_SCOPE and I find there a bug, copied the code there.
>
> I don't even know why we have OP_SCOPE.
I agree, c-exp.y already tries to resolve everything to OP_TYPE and
OP_VAR_VALUE. I admit I tried to remove but the code still depends on it.
Also non-C languages use OP_SCOPE. I find that cleanup as a different one
/ additional one.
Thanks,
Jan
next prev parent reply other threads:[~2011-07-15 21:09 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-15 20:47 Jan Kratochvil
2011-07-16 8:42 ` Tom Tromey
2011-07-16 9:45 ` Jan Kratochvil [this message]
2011-07-23 21:17 ` Mark Kettenis
2011-07-23 21:38 ` Jan Kratochvil
2011-07-25 15:00 ` Tom Tromey
2011-07-23 22:12 ` Matt Rice
2011-07-24 15:59 ` Jan Kratochvil
2011-07-24 15:59 ` Matt Rice
2011-07-25 14:52 ` 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=20110715210906.GA17148@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=tromey@redhat.com \
/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