This is the mail archive of the gdb@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: GDB printf command


On Tue, Oct 17, 2006 at 01:03:33PM +0100, Andrew STUBBS wrote:
> Hi,
> 
> The %ll issue, recently discussed on the patches list, was originally 
> reported to me against GDB 6.4.
> 
> While testing my fix to GDB 6.5 I have discovered that the new version 
> is even more broken than the old one (at least in some respects, no 
> doubt whatever it set out to fix was achieved).

Correct.  It was deliberately made stricter, because the older version
could crash or internal error in more ways.

> Specifically '%lf' is not permitted. This used to work and is permitted 
> by both C90 and C99.

I don't remember what reference I used, but in C99 I see that this is
deliberately ignored and the same as %f.  Seems dumb to me, but there
you go.

> Can anybody tell me why this is the case - it seems deliberate - and 
> what is the intended range of capabilities of this command?
> 
> It would appear to me to be most useful if it can operate on any type 
> the GDB expression parser is capable of handling, regardless of host system.

It seems to me, as I wrote earlier, that the right thing to do would be
to change it to work on target types rather than host types.  It also
seems to me that the right way to do this would be to reuse the printf
format string parser from gnulib.  We will have to map target types on
to host types to get that to work, which will be a little hokey, but it
should be doable for all interesting cases.

-- 
Daniel Jacobowitz
CodeSourcery


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