This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH v3 8/9] compile: New compile printf


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]