From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17318 invoked by alias); 9 Apr 2003 21:22:04 -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 17296 invoked from network); 9 Apr 2003 21:22:04 -0000 Received: from unknown (HELO localhost.redhat.com) (207.219.125.105) by sources.redhat.com with SMTP; 9 Apr 2003 21:22:04 -0000 Received: from redhat.com (localhost [127.0.0.1]) by localhost.redhat.com (Postfix) with ESMTP id EAEA82B37; Wed, 9 Apr 2003 17:21:49 -0400 (EDT) Message-ID: <3E948EED.30801@redhat.com> Date: Wed, 09 Apr 2003 21:22:00 -0000 From: Andrew Cagney User-Agent: Mozilla/5.0 (X11; U; NetBSD macppc; en-US; rv:1.0.2) Gecko/20030223 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joel Brobecker Cc: David Carlton , gdb-patches@sources.redhat.com Subject: Re: [RFC] missing #include in frame.h? References: <20030409203842.GN1170@gnat.com> <20030409205611.GP1170@gnat.com> Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2003-04/txt/msg00181.txt.bz2 >> But shouldn't all .c files inculde defs.h first? (Indeed, that's what >> GDB Internals says.) Which file were you compiling when you got this >> error? Probably that file should be fixed to include defs.h before >> frame.h, instead of changing frame.h. > Ugh (excuse my French). If bla.h depends on defs.h, I think it is wrong > to ask all c files including bla.h to include defs.h first... But I come > from the Ada world, so maybe there is a good reason for this? GDB's coding standard stipulates that all .c files include "defs.h" first; all other .h files can assume this. > I dug a bit further, as my conclusions were a bit premature. Here is one > include stack example when this happens: > > In file included from breakpoint.h:25, > from gdbthread.h:29, > from config/nm-lynx.h:49, > from nm.h:24, > from defs.h:767, > from frame.c:23: > > I checked frame.c, and it does include defs.h before frame.h. What > actually happens is that nm.h is indirectly including frame.h before > defs.h has included gdbarch.h... (nm.h = config/i386/nm-i386lynx.h, > which is equivalent to config/nm-lynx.h). Officially, "tm.h" and "nm.h" and "xm.h" are going away. HP/UX's "tm.h" is even worse at this. My hunch is that, in reality, "nm.h" won't so much go away as be made an explicit include by the native files that actually need it. Andrew