From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17353 invoked by alias); 26 Feb 2004 03:27:46 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 17335 invoked from network); 26 Feb 2004 03:27:45 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 26 Feb 2004 03:27:45 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AwCBb-0007zB-Sk; Wed, 25 Feb 2004 22:27:43 -0500 Date: Thu, 26 Feb 2004 03:27:00 -0000 From: Daniel Jacobowitz To: Joel Brobecker Cc: Elena Zannoni , gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf-2] Fix for the null record problem Message-ID: <20040226032743.GA30615@nevyn.them.org> Mail-Followup-To: Joel Brobecker , Elena Zannoni , gdb-patches@sources.redhat.com References: <20040219140145.GB804@gnat.com> <16437.11835.435941.553479@localhost.redhat.com> <20040226023108.GF3425@gnat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20040226023108.GF3425@gnat.com> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-02/txt/msg00753.txt.bz2 On Wed, Feb 25, 2004 at 06:31:08PM -0800, Joel Brobecker wrote: > > > This is a followup on the thread that started with: > > > > > > http://sources.redhat.com/ml/gdb-patches/2004-02/msg00058.html > > > > > > The test proposed under that thread was dropped because an empty > > > struct is not legal C. However, it is legal in Ada, and I've seen > > > a message saying that it is also legal in C++. > > > > Seriously, I'd like to see a testcase that FAIL->PASS with this patch. > > Can somebody get a C++ testcase, at least? > > > > the patch looks sensible, but I would like to see the testcase go in > > at the same time, or we'll forget. > > I tried to update one of the C++ testcase to include an empty struct, > but my C++ is completely rusty. > > In class2.cc, I tried adding > > struct empty_struct {}; > > Is that a struct type definition or a class definition. In any case, > GDB has no trouble at all printing the description of this type: > > (gdb) ptype empty_struct > type = class empty_struct { > } > > Does anybody know of a way to produce the "" bug > with C++? Otherwise, there is my upcoming null_record.exp test, > but I need a bit more time before the first Ada testcase can be > committed. It occurs to me that C++ probably will not show the problem. The empty struct is legal, but has size 1; the language requires: struct empty_struct { } array[10]; assert (&array[0] != &array[1]); This is one of the many quirks of the GNU C extension in question. I'd like to have the empty struct test anyway. Remember to add a variable of that type if you add a type to class2.cc; or newer GCCs will just elide the type. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer