From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21801 invoked by alias); 10 Jan 2004 18:36:26 -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 21790 invoked from network); 10 Jan 2004 18:36:25 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 10 Jan 2004 18:36:25 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AfNyA-00027Z-Em; Sat, 10 Jan 2004 13:36:22 -0500 Date: Sat, 10 Jan 2004 18:36:00 -0000 From: Daniel Jacobowitz To: Mark Kettenis Cc: gdb-patches@sources.redhat.com Subject: Re: [PATCH] Classify non-POD struct types more or less correctly on AMD64 Message-ID: <20040110183622.GA8108@nevyn.them.org> Mail-Followup-To: Mark Kettenis , gdb-patches@sources.redhat.com References: <200401101800.i0AI0Zm6026623@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401101800.i0AI0Zm6026623@elgar.kettenis.dyndns.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-01/txt/msg00266.txt.bz2 On Sat, Jan 10, 2004 at 07:00:35PM +0100, Mark Kettenis wrote: > This (together with the previous patch) fixes the problems I saw with > gdb.cp/bs15503.exp. The check for non-POD-ness isn't complete though. > I hope to revisit that later, after someone tells me how to properly > determine non-POD-ness. > > Mark > > P.S. The amd64_non_pod_p function should probably be moved to the > generic cod, but we can do that later. Does the x86-64 ABI really pass non-POD and POD types of the same size differently? If so, I hope the ABI defines non-POD rather than relying on the C++ definition, since we do not generally have enough information in the debug info to determine whether a type is POD. > + /* ??? A class with a base class certainly isn't POD, but does this > + catch all non-POD structure types? */ > + if (TYPE_CODE (type) == TYPE_CODE_STRUCT && TYPE_N_BASECLASSES (type) > 0) > + return 1; No, at least any type with explicitly declared methods is non-POD. For DWARF you can probably get this right by checking for a non-artificial method but for stabs you're SOL. I don't remember what other things determine POD-ness. I think private/public may also. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer