Mirror of the gdb mailing list
 help / color / mirror / Atom feed
From: Andrew STUBBS <andrew.stubbs@st.com>
To: GDB List <gdb@sourceware.org>
Subject: Re: GDB printf command
Date: Tue, 17 Oct 2006 14:10:00 -0000	[thread overview]
Message-ID: <4534E3FF.9030505@st.com> (raw)
In-Reply-To: <20061017132426.GA28323@nevyn.them.org>

Daniel Jacobowitz wrote:
>> 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.

Sorry, I opened my C90 standard at the wrong page and read that '%lf' is 
accepted for scanf by mistake - C90 says it is undefined for printf. C99 
however ignores it, as you say, but that is not 'bad' as defined by GDB 
at present. It should be either passed through or converted to '%f'.

> 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.

The expression parser/evaluator must use host types at some level. Does 
this not have similar horrors hidden away? If this can convert target 
types to host types (of at least the same precision) can the printf not 
be implemented with the same mapping somehow?

Andrew


  reply	other threads:[~2006-10-17 14:10 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-10-17 12:03 Andrew STUBBS
2006-10-17 13:24 ` Daniel Jacobowitz
2006-10-17 14:10   ` Andrew STUBBS [this message]
2006-10-17 14:25     ` Daniel Jacobowitz
2006-10-17 14:43       ` Andrew STUBBS
2006-10-17 14:54         ` Daniel Jacobowitz
2006-10-18 11:24           ` Andrew STUBBS
2006-10-18 13:53             ` Daniel Jacobowitz
2006-10-31 11:43             ` Andrew STUBBS
2006-10-31 13:42               ` Daniel Jacobowitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4534E3FF.9030505@st.com \
    --to=andrew.stubbs@st.com \
    --cc=gdb@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox