From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 31993 invoked by alias); 26 Feb 2004 20:23:28 -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 31982 invoked from network); 26 Feb 2004 20:23:26 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (209.53.16.160) by sources.redhat.com with SMTP; 26 Feb 2004 20:23:26 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id B35CC47D62; Thu, 26 Feb 2004 12:23:17 -0800 (PST) Date: Thu, 26 Feb 2004 20:23:00 -0000 From: Joel Brobecker To: Michael Elizabeth Chastain Cc: ezannoni@redhat.com, gdb-patches@sources.redhat.com Subject: Re: [RFA/dwarf-2] Fix for the null record problem Message-ID: <20040226202317.GF1154@gnat.com> References: <20040226194953.AB5A74B104@berman.michael-chastain.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="ZfOjI3PrQbgiZnxM" Content-Disposition: inline In-Reply-To: <20040226194953.AB5A74B104@berman.michael-chastain.com> User-Agent: Mutt/1.4i X-SW-Source: 2004-02/txt/msg00773.txt.bz2 --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 630 > I like the idea, but there are two gotchas: > > . update the copyright year in class2.exp (sound of a club banging on my head) > . quote the '{' and '}' chars in class2.exp: > > "= \{\}" > > With these two changes, and if you re-test, then I approve the patch. Thanks. Here is what I ended up checking in. 2004-02-26 J. Brobecker * gdb.cp/class2.cc (empty): New class. (refer): New function. (main): Declare an object of type empty and use it. * gdb.cp/class2.exp: Print the value of an object of type empty. Re-tested on x86-linux. -- Joel --ZfOjI3PrQbgiZnxM Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="empty.diff" Content-length: 1562 Index: class2.cc =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/class2.cc,v retrieving revision 1.2 diff -u -r1.2 class2.cc --- class2.cc 11 Feb 2004 14:01:25 -0000 1.2 +++ class2.cc 26 Feb 2004 20:09:08 -0000 @@ -48,10 +48,19 @@ ; } +struct empty {}; + +// Stop the compiler from optimizing away data. +void refer (empty *) +{ + ; +} + int main (void) { A alpha, *aap, *abp; B beta, *bbp; + empty e; alpha.a1 = 100; beta.a1 = 200; beta.b1 = 201; beta.b2 = 202; @@ -59,6 +68,7 @@ aap = α refer (aap); abp = β refer (abp); bbp = β refer (bbp); + refer (&e); return 0; // marker return 0 } // marker close brace Index: class2.exp =================================================================== RCS file: /cvs/src/src/gdb/testsuite/gdb.cp/class2.exp,v retrieving revision 1.1 diff -u -r1.1 class2.exp --- class2.exp 25 Nov 2003 15:01:31 -0000 1.1 +++ class2.exp 26 Feb 2004 20:09:08 -0000 @@ -1,4 +1,4 @@ -# Copyright 2003 Free Software Foundation, Inc. +# Copyright 2003, 2004 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -113,3 +113,7 @@ gdb_test "print * (B *) abp" \ "= {.*a1 = 200.*b1 = 201.*b2 = 202}" \ "print * (B *) abp at marker return 0" + +# Printing the value of an object containing no data fields: + +gdb_test "p e" "= \{\}" "print object with no data fields" --ZfOjI3PrQbgiZnxM--