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: Sun, 3 May 2015 16:06:05 +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>
On Wed, 29 Apr 2015 17:52:09 +0200, Pedro Alves wrote:
> The usefulness of "compile printf"
> specifically isn't as immediately clear though. I think the manual
> should say something about why you want to use "compile printf" over
> the alternatives. (Edit: Ah, I see that's in the next patch.)
I do not know, I have never used the existing GDB printf command myself.
GDB Manual could describe what the existing GDB printf command is good for.
IMO in the cases where one needs the printf command one already has to use
some extension language (such as Python) which can do that on its own.
This patch was created upon request by Phil.
> The main advantage is that after the next patch, the output always
> appears in gdb's console, while "compile code printf" works just like
> (gdb) print printf (...)
> meaning, in the "compile the output should go to the inferior's stdout.
>
> Or is there another advantage I missed, perhaps?
This patch is just to split it to two mails for review. I do not think it
makes sense on its own, it messes up debugging output with inferior output.
> But can give an example of why you'd want to set "set compile-printf-args"
> differently to "set compile-args" ?
I do not know exactly myself but currently there is already:
+ compile_printf_args = xstrdup ("-Werror=format");
so one may need to modify that for whatever reason. I do not think there
should be non-overridable GCC options.
> Some FIXMEs here.
Fixed:
_("Set compile printf command "
"GCC command-line arguments"),
_("Show compile printf command "
"GCC command-line arguments"),
Thanks,
Jan