From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 27636 invoked by alias); 19 Sep 2008 21:52:28 -0000 Received: (qmail 27628 invoked by uid 22791); 19 Sep 2008 21:52:28 -0000 X-Spam-Check-By: sourceware.org Received: from mx2.redhat.com (HELO mx2.redhat.com) (66.187.237.31) by sourceware.org (qpsmtpd/0.31) with ESMTP; Fri, 19 Sep 2008 21:51:47 +0000 Received: from int-mx2.corp.redhat.com (int-mx2.corp.redhat.com [172.16.27.26]) by mx2.redhat.com (8.13.8/8.13.8) with ESMTP id m8JLoeI2010758; Fri, 19 Sep 2008 17:51:01 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx2.corp.redhat.com (8.13.1/8.13.1) with ESMTP id m8JLoSIw012726; Fri, 19 Sep 2008 17:50:28 -0400 Received: from opsy.redhat.com (vpn-10-76.bos.redhat.com [10.16.10.76]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id m8JLoRsn029368; Fri, 19 Sep 2008 17:50:27 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 0FED250800F; Fri, 19 Sep 2008 15:50:04 -0600 (MDT) To: "Paul Pluzhnikov" Cc: gdb-patches@sourceware.org Subject: Re: GDB aborts on missing command args. Which way to fix? References: <8ac60eac0809161049t6bd917bbk8127317a7d8b42cb@mail.gmail.com> From: Tom Tromey Reply-To: tromey@redhat.com X-Attribution: Tom Date: Fri, 19 Sep 2008 21:52:00 -0000 In-Reply-To: <8ac60eac0809161049t6bd917bbk8127317a7d8b42cb@mail.gmail.com> (Paul Pluzhnikov's message of "Tue\, 16 Sep 2008 10\:49\:39 -0700") Message-ID: User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2008-09/txt/msg00423.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov 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. Tom