From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 6399 invoked by alias); 3 Aug 2002 03:10:11 -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 6388 invoked from network); 3 Aug 2002 03:10:09 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by sources.redhat.com with SMTP; 3 Aug 2002 03:10:09 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id 62863D2CBD; Fri, 2 Aug 2002 20:10:09 -0700 (PDT) Date: Fri, 02 Aug 2002 20:10:00 -0000 From: Joel Brobecker To: Andrew Cagney Cc: gdb-patches@sources.redhat.com Subject: Re: [RFA] Missing #include in objfiles.h? Message-ID: <20020803031009.GE3259@gnat.com> References: <20020801192836.GY683@gnat.com> <3D499E85.9080506@ges.redhat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="oyUTqETQ0mS9luUI" Content-Disposition: inline In-Reply-To: <3D499E85.9080506@ges.redhat.com> User-Agent: Mutt/1.4i X-SW-Source: 2002-08/txt/msg00064.txt.bz2 --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1519 On Thu, Aug 01, 2002 at 04:48:05PM -0400, Andrew Cagney wrote: > >I'm not sure if this is intended or not, but objfiles.h relies on > >symfile.h for the definition of certain structures. However, objfiles > >does not #include symfile. So my attempt to include objfiles without > >prior including symfile caused a compilation error. > > What exactly? A mindless grep suggests opaque references but not a hard > dependency. Adding an opaque ``struct sym_fns;'' to avoid an include is ok. Here are the fields in struct objfile that cause the compilation error: /* Vectors of all partial symbols read in from file. The actual data is stored in the psymbol_obstack. */ struct psymbol_allocation_list global_psymbols; struct psymbol_allocation_list static_psymbols; So the full definition is need for this file to compile. >2002-08-01 Joel Brobecker > > * objfiles.h: Add missing #include "symfile.h" > > * Makefile.in (objfiles_h): Add dependency on symfile.h and > dependents. > > >+ #include "symfile.h" > > Suggest a comment mentioning what was needed. The attached patch contains the suggested comment. > PS: I've this memory of, on true64 or hpux, there being a tangled mess > of includes that stopped the above from being added. That, however, is > a true64/hppa problem and is likely fixed by multi-arching. Just to be on the safe side, I have regression tested this patch on HP/UX 11.00, and Tru64 5.1A. No problem. -- Joel --oyUTqETQ0mS9luUI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="objfiles.h.diff" Content-length: 1679 Index: objfiles.h =================================================================== RCS file: /cvs/src/src/gdb/objfiles.h,v retrieving revision 1.14 diff -c -3 -p -r1.14 objfiles.h *** objfiles.h 29 Jul 2002 22:55:26 -0000 1.14 --- objfiles.h 3 Aug 2002 03:09:08 -0000 *************** *** 23,29 **** #if !defined (OBJFILES_H) #define OBJFILES_H ! #include "gdb_obstack.h" /* For obstack internals. */ struct bcache; /* This structure maintains information on a per-objfile basis about the --- 23,31 ---- #if !defined (OBJFILES_H) #define OBJFILES_H ! #include "gdb_obstack.h" /* For obstack internals. */ ! #include "symfile.h" /* For struct psymbol_allocation_list */ ! struct bcache; /* This structure maintains information on a per-objfile basis about the Index: Makefile.in =================================================================== RCS file: /cvs/src/src/gdb/Makefile.in,v retrieving revision 1.228 diff -c -3 -p -r1.228 Makefile.in *** Makefile.in 30 Jul 2002 19:59:06 -0000 1.228 --- Makefile.in 3 Aug 2002 03:09:10 -0000 *************** macrotab_h = macrotab.h *** 656,662 **** macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) memattr_h = memattr.h monitor_h = monitor.h ! objfiles_h = objfiles.h $(gdb_obstack_h) parser_defs_h = parser-defs.h $(doublest_h) ppc_tdep_h = ppc-tdep.h osabi.h regcache_h = regcache.h --- 656,662 ---- macroscope_h = macroscope.h $(macrotab_h) $(symtab_h) memattr_h = memattr.h monitor_h = monitor.h ! objfiles_h = objfiles.h $(gdb_obstack_h) $(symfile_h) parser_defs_h = parser-defs.h $(doublest_h) ppc_tdep_h = ppc-tdep.h osabi.h regcache_h = regcache.h --oyUTqETQ0mS9luUI--