This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [PATCH v3 8/9] compile: New compile printf
- From: Jan Kratochvil <jan dot kratochvil at redhat dot com>
- To: Pedro Alves <palves at redhat dot com>
- Cc: gdb-patches at sourceware dot org, Phil Muldoon <pmuldoon at redhat dot com>
- Date: Wed, 6 May 2015 13:29:54 +0200
- Subject: Re: [PATCH v3 8/9] compile: New compile printf
- Authentication-results: sourceware.org; auth=none
- References: <20150411194322 dot 29128 dot 52477 dot stgit at host1 dot jankratochvil dot net> <20150411194429 dot 29128 dot 61494 dot stgit at host1 dot jankratochvil dot net> <5540FE29 dot 5050004 at redhat dot com> <20150503140605 dot GC18394 at host1 dot jankratochvil dot net> <5549EB71 dot 1070101 at redhat dot com>
On Wed, 06 May 2015 12:22:41 +0200, Pedro Alves wrote:
> I understand that. But what I was asking is (after the series is wholly
> pushed), what is the advantage of "(gdb) compile printf"
> over "(gdb) compile print printf (...)" and "(gdb) call printf (...)".
This patch, that is
[PATCH v3 8/9] compile: New compile printf
without the part
[PATCH v3 9/9] compile: compile printf: gdbserver support
is really just that
(gdb) compile print printf (...)
and the patch is also therefore very simple.
According to Phil - roughly, not citing - such 'compile printf' was simple
enough to code to make it worth such a feature, despite it has many
shortcomings.
> Agreed on the latter, but the question really is: why do we need
> "set compile-printf-args" instead of using "set compile-args" for
> all expression evaluation through the compiler?
> Shouldn't "-Werror=format" be in "set compile-args" too?
Why not, this is a matter of opinion. IMO cc itself should have -Werror by
default as otherwise by default it is willing to knowingly produce crashing
programs. The only safe warnings are -Wunused* ones and maybe few others.
So again, this patch tries to make minimal changes to what is the current
established wrong standard.
Jan