Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@mvista.com>
To: Andrew Cagney <ac131313@redhat.com>
Cc: Jason Molenda <jason-swarelist@molenda.com>,
	gdb-patches@sources.redhat.com
Subject: Re: PATCH: Add type_sprint() function to return type in string form
Date: Tue, 22 Apr 2003 17:33:00 -0000	[thread overview]
Message-ID: <20030422173348.GA325@nevyn.them.org> (raw)
In-Reply-To: <3EA57BD9.5020502@redhat.com>

On Tue, Apr 22, 2003 at 01:28:57PM -0400, Andrew Cagney wrote:
> >On Tue, Apr 22, 2003 at 12:48:09PM -0400, Andrew Cagney wrote:
> >
> >>>On Fri, Apr 18, 2003 at 03:24:26PM -0700, Jason Molenda wrote:
> >>>
> >
> >>>>There are a few places in gdb where code prints an error message
> >>>>with a type included in it.  The only way for these functions to
> >>>>print a type is with type_print(), which takes a ui_file stream to
> >>>>print its output to.  This means they either have to send the output
> >>>>to gdb_stderr, or build up a fake memory ui_file and retrieve the
> >>>>contents.
> >>>>
> >>>>This patch adds a type_sprint() which does the latter and returns the
> >>>>xmalloc()'ed string.
> >
> >>
> >>Good interface choice!  Just some tweaks.
> >>
> >>sprint makes me think of the nasty sprintf family, which this is 
> >>definitly not.  So ..  suggest calling it something like type_xstrdup: 
> >>x-> xmalloc family; strdup -> allocate a string duplicate (like 
> >>ui_file_xstrdup, but yes pushing it a bit).  The alternative would be 
> >>type_xasprint (&string, ...) but I think that is getting ugly :-)
> >
> >
> >How about type_asprint?  I really don't think that the x is necessary,
> >but the a would be a convenient reminder.
> 
> GDB should use neither sprint* nor asprint*.

I disagree.  Why on earth wouldn't we use sprintf?  Just because it can
be used incorrectly is no excuse.

>  type_sprint or 
> type_asprint would confuse this.

Even given the above assumption, I disagree with your conclusion.

> The xasprint* family all have the signature:
> 
> 	...xasprint* (char **buf, ....)
> 
> which doesn't apply here.

Perhaps it should apply?

> >>The old error message should never have included a period ("."), might 
> >>as well remove it while tweaking the code.
> >
> >
> >Didn't we settle on full sentence error messages the last time this
> >came up?
> 
> For the moment, it's a full sentence, with a leading upper case letter 
> but no trailing period :-)  The period doesn't make much sence to a GUI. 
>  The ARI is looking for this.

Huh, so it is.  Odd.

-- 
Daniel Jacobowitz
MontaVista Software                         Debian GNU/Linux Developer


  reply	other threads:[~2003-04-22 17:33 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-04-18 22:24 Jason Molenda
2003-04-22  3:26 ` Daniel Jacobowitz
2003-04-22 16:48   ` Andrew Cagney
2003-04-22 16:55     ` Daniel Jacobowitz
2003-04-22 17:29       ` Andrew Cagney
2003-04-22 17:33         ` Daniel Jacobowitz [this message]
2003-04-22 19:21           ` Andrew Cagney
2003-04-22 19:28             ` Daniel Jacobowitz
2003-04-22 20:16               ` Andrew Cagney
2003-04-22 20:22                 ` Daniel Jacobowitz
2003-04-22 20:35                   ` Jason Molenda
2003-04-22 21:15               ` Andrew Cagney
2003-04-22 19:55             ` Kevin Buettner
2003-04-23 14:23 ` Jason Molenda
2003-04-23 17:37   ` Andrew Cagney

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=20030422173348.GA325@nevyn.them.org \
    --to=drow@mvista.com \
    --cc=ac131313@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=jason-swarelist@molenda.com \
    /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