[PATCH v3 8/9] compile: New compile printf
Jan Kratochvil
jan.kratochvil@redhat.com
Wed May 6 11:30:00 GMT 2015
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
More information about the Gdb-patches
mailing list