From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21465 invoked by alias); 3 Oct 2011 16:17:11 -0000 Received: (qmail 21457 invoked by uid 22791); 3 Oct 2011 16:17:09 -0000 X-SWARE-Spam-Status: No, hits=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp-vbr4.xs4all.nl (HELO smtp-vbr4.xs4all.nl) (194.109.24.24) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 03 Oct 2011 16:16:54 +0000 Received: from cnoc.nl.alt001.com (oostvogels.xs4all.nl [83.163.197.192]) by smtp-vbr4.xs4all.nl (8.13.8/8.13.8) with ESMTP id p93GGeKm008948; Mon, 3 Oct 2011 18:16:40 +0200 (CEST) (envelope-from joost@cnoc.nl) Received: from localhost (localhost.localdomain [127.0.0.1]) by cnoc.nl.alt001.com (Postfix) with ESMTP id A1C92BF7A; Mon, 3 Oct 2011 18:16:39 +0200 (CEST) Received: from cnoc.nl.alt001.com ([127.0.0.1]) by localhost (cnoc.nl.alt001.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id xwZA6DtE6WpJ; Mon, 3 Oct 2011 18:16:38 +0200 (CEST) Received: from [192.168.3.116] (host116.cnoc.intern [192.168.3.116]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by cnoc.nl.alt001.com (Postfix) with ESMTPS id D2587BF20; Mon, 3 Oct 2011 18:16:38 +0200 (CEST) Subject: Re: Crash of Archer's gdb on mingw (passing null argument to vasprintf) From: Joost van der Sluis To: Joel Brobecker Cc: gdb@sourceware.org Date: Mon, 03 Oct 2011 16:17:00 -0000 In-Reply-To: <20111003145904.GK27340@adacore.com> References: <1317634777.28003.15.camel@feddie.cnoc.lan> <20111003145904.GK27340@adacore.com> Content-Type: multipart/mixed; boundary="=-RIi0Qp0I5/23GfWtds5m" Message-ID: <1317658598.28003.48.camel@feddie.cnoc.lan> Mime-Version: 1.0 X-IsSubscribed: yes Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2011-10/txt/msg00006.txt.bz2 --=-RIi0Qp0I5/23GfWtds5m Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 808 On Mon, 2011-10-03 at 07:59 -0700, Joel Brobecker wrote: > > In gdbtypes.c there's this code: > > > > warning (_("Range for type %s has invalid bounds %s..%s"), > > TYPE_NAME (type), plongest (TYPE_LOW_BOUND (range_type)), > > plongest (TYPE_HIGH_BOUND (range_type))); > > > > This goes wrong when TYPE_NAME (type) is null. > > We should several example of us handling this type of situation. > Typically we use: > > TYPE_NAME (type) ? TYPE_NAME (type) : "" I've found the TYPE_ERROR_NAME macro. Now another question: how do I send a patch for inclusion in gdb? Can I send it to this list? Or gdb-patches? btw: patch is attached. First part will only apply to Archer though. (My guess is the archer-jankratochvil-vla branch) Regards, Joost van der Slui --=-RIi0Qp0I5/23GfWtds5m Content-Disposition: attachment; filename="TYPE_NAME_fix.diff" Content-Type: text/x-patch; name="TYPE_NAME_fix.diff"; charset="ISO-8859-1" Content-Transfer-Encoding: 7bit Content-length: 998 --- a/gdb/gdbtypes.c +++ b/gdb/gdbtypes.c @@ -1527,7 +1544,7 @@ type_length_get (struct type *type, struct type *target_type, int full_span) /* It may happen for wrong DWARF annotations returning garbage data. */ if (count < 0) warning (_("Range for type %s has invalid bounds %s..%s"), - TYPE_NAME (type), plongest (TYPE_LOW_BOUND (range_type)), + TYPE_ERROR_NAME (type), plongest (TYPE_LOW_BOUND (range_type)), plongest (TYPE_HIGH_BOUND (range_type))); /* The code below does not handle count == 0 right. */ if (count <= 0) --- a/gdb/gnu-v3-abi.c +++ b/gdb/gnu-v3-abi.c @@ -319,7 +319,7 @@ gnuv3_rtti_type (struct value *value, || strncmp (vtable_symbol_name, "vtable for ", 11)) { warning (_("can't find linker symbol for virtual table for `%s' value"), - TYPE_NAME (values_type)); + TYPE_ERROR_NAME (values_type)); if (vtable_symbol_name) warning (_(" found `%s' instead"), vtable_symbol_name); return NULL; --=-RIi0Qp0I5/23GfWtds5m--