From: Jan Kratochvil <jan.kratochvil@redhat.com>
To: Yao Qi <qiyaoltc@gmail.com>
Cc: gdb-patches@sourceware.org, Phil Muldoon <pmuldoon@redhat.com>
Subject: Re: [obv] compile-print.exp: xfail->kfail for '@' GDB array operator
Date: Fri, 05 Jun 2015 21:23:00 -0000 [thread overview]
Message-ID: <20150605212316.GA12230@host1.jankratochvil.net> (raw)
In-Reply-To: <868ubynnfw.fsf@gmail.com>
Hi Yao,
I have replied to all your arguments but I think it is just enough to say:
'compile print' is a work in progress to become future 'print'.
On Fri, 05 Jun 2015 18:13:07 +0200, Yao Qi wrote:
> '@' is useful in command print, and it is reasonable for me to replace
> command print with 'compile print' one day, I agree on them. If gcc
> doesn't accept '@', 'compile print' shouldn't as well, but 'print' can.
That depends what 'compile print' should do. IMO it is "future 'print'".
So I do not understand why you say:
'compile print' shouldn't [...], but 'print' can.
> Command 'print' can be built on top of the 'compile print' stuff,
'print' should be replaced by 'compile print'. 'compile print' is a work in
progress towards that goal.
If you want we can create 'compile print2' which will be "future 'print'"
while 'compile print' can remain ISO C (or whatever language GCC is configure
to accept) clean. But then I do not see what 'compile print' would be good
for, 'compile print2' would supersede it in all aspects.
Besides that there is currently no kind of 'print' command unsupporting GDB
extensions so I do not understand why you want 'compile print' to have one.
> with extra functionality to transform '@' to a valid language form. Is it
> possible?
Everything is possible but I do not see usefulness of multiple commands where
one is a subset of functionality of other. The general goal should be
reducing the number of commands/options of GDB, not the opposite.
> Anyway, I suggest we consider support '@' when we really start
> considering replace 'print' command with 'compile print' command. Once
> we support '@' in 'compile print', we can't remove it. I am inclined to
> postpone the decision to some time we really need it.
'compile print' should be already useful in some cases (such as evaluating
macros containing statement expressions) although I admit I haven't yet had an
opportunity to utilize it (primarily because there is no inferior C++
'compile' support yet).
I was proposing to implement the discussed command
set compile print {never|always|preferred|deferred}
as it makes sense already; but I was assigned to other priorities so far.
> I don't know, but GDB expression (which supports '@') is not a language,
> so it is flexible to add and remove operators. Commands 'compile XXX'
> are different, because their input is source language, and IMO we
> shouldn't add any extensions to the source language.
I do not understand why you find the goals of 'compile print' and 'print' to
be different.
> Where is the original plan?
> https://sourceware.org/gdb/wiki/GCCCompileAndExecute is the only thing I
> can find, but I don't see the anything about replacing command 'print' with
> 'compile print'.
The plan is to support all the features of LLDB which uses clang/llvm for its
'print' command. Although it may not be a great argument as LLDB does not
support the '@' operator at all.
Jan
next prev parent reply other threads:[~2015-06-05 21:23 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-04 19:38 Jan Kratochvil
2015-06-05 9:35 ` Yao Qi
2015-06-05 12:40 ` Jan Kratochvil
2015-06-05 15:19 ` Doug Evans
2015-06-05 15:26 ` Jan Kratochvil
2015-06-05 16:13 ` Yao Qi
2015-06-05 21:23 ` Jan Kratochvil [this message]
2015-06-05 13:24 ` Jan Kratochvil
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=20150605212316.GA12230@host1.jankratochvil.net \
--to=jan.kratochvil@redhat.com \
--cc=gdb-patches@sourceware.org \
--cc=pmuldoon@redhat.com \
--cc=qiyaoltc@gmail.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