Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Daniel Jacobowitz <drow@false.org>
To: Tom Tromey <tromey@redhat.com>
Cc: Paul Pluzhnikov <ppluzhnikov@google.com>, gdb-patches@sourceware.org
Subject: Re: GDB aborts on missing command args. Which way to fix?
Date: Fri, 19 Sep 2008 22:02:00 -0000	[thread overview]
Message-ID: <20080919220128.GA27150@caradoc.them.org> (raw)
In-Reply-To: <m3wsh7956c.fsf@fleche.redhat.com>

On Fri, Sep 19, 2008 at 03:50:03PM -0600, Tom Tromey wrote:
> >>>>> "Paul" == Paul Pluzhnikov <ppluzhnikov@google.com> writes:
> 
> Paul> There are many instances of calls to buildargv() which aren't
> Paul> protected by 'if (args != NULL)', and cause gdb to abort.
> [...]
> Paul> I can fix this by adding the 'if (args != NULL)' checks everywhere,
> Paul> or by switching to 'buildargv_not_null(args, "appropriate missing
> Paul> argument error")'
> 
> Paul> Which way is preferred? (I prefer the second way).
> 
> That seems reasonable to me.
> 
> I think you might as well make it call nomem if the result is NULL,
> too.

I don't like passing error messages to functions that might fail; I
find it very confusing.  If you want to give usage errors, why not
combine it with the existing checks for wrong arguments?

Tom's got a good point about nomem, though.

-- 
Daniel Jacobowitz
CodeSourcery


  reply	other threads:[~2008-09-19 22:02 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-16 17:50 Paul Pluzhnikov
2008-09-19 21:52 ` Tom Tromey
2008-09-19 22:02   ` Daniel Jacobowitz [this message]
2008-09-26 23:22     ` [patch] " Paul Pluzhnikov
2008-10-03  7:04       ` Joel Brobecker
2008-10-03 16:39         ` Paul Pluzhnikov

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=20080919220128.GA27150@caradoc.them.org \
    --to=drow@false.org \
    --cc=gdb-patches@sourceware.org \
    --cc=ppluzhnikov@google.com \
    --cc=tromey@redhat.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