From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28190 invoked by alias); 17 May 2002 14:37:59 -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 28089 invoked from network); 17 May 2002 14:37:52 -0000 Received: from unknown (HELO cygnus.com) (205.180.83.203) by sources.redhat.com with SMTP; 17 May 2002 14:37:52 -0000 Received: from localhost.redhat.com (romulus.sfbay.redhat.com [172.16.27.251]) by runyon.cygnus.com (8.8.7-cygnus/8.8.7) with ESMTP id HAA01347; Fri, 17 May 2002 07:37:47 -0700 (PDT) Received: by localhost.redhat.com (Postfix, from userid 469) id 8D1B610FC9; Fri, 17 May 2002 10:37:15 -0400 (EDT) From: Elena Zannoni MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Message-ID: <15589.5531.423925.941457@localhost.redhat.com> Date: Fri, 17 May 2002 07:37:00 -0000 To: Michal Ludvig Cc: Elena Zannoni , GDB Patches Subject: Re: [RFA] dwarf2cfi cleanup + new file In-Reply-To: <3CE50246.1050903@suse.cz> References: <3CE50246.1050903@suse.cz> X-SW-Source: 2002-05/txt/msg00715.txt.bz2 Michal Ludvig writes: > Hi, > I have created new header file dwarf2read.h and put all extern > declarations from dwarf2read.c there. This eliminates the need of having > them in dwarf2cfi.c, so I deleted them from there as well. > > OK to commit? Almost. If we decide to introduce a dwarf2read.h file (I think this is a good idea) then we should also eliminate the extern's that are in symfile.h. I.e.: /* From dwarf2read.c */ extern int dwarf2_has_info (bfd * abfd); extern void dwarf2_build_psymtabs (struct objfile *, int); extern void dwarf2_build_frame_info (struct objfile *); The dwarf2_build_frame_info should definitely go in dwarf2cfi.h, since it's coming from dwarf2cfi.c, not dwarf2read.c. Then we should add the appropriate #include's to all the files that need these functions (not too many, luckily) and update the makefile dependencies. As far as dwarf2read.h, below: #include "bfd.h" #include "objfiles.h" Gdb is trying to get away from nested includes. These should go in the files that include dwarf2read.h. Thanks Elena > > 2002-05-17 Michal Ludvig > * dwarf2read.h: New file > * dwarf2read.c: Included dwarf2read.h > * dwarf2cfi.c: Ditto, removed extern declarations. > > Michal Ludvig > -- > * SuSE CR, s.r.o * mludvig@suse.cz > * +420 2 9654 5373 * http://www.suse.cz > /* Declarations of symbols exported from dwarf2read.c. > Copyright 2001, 2002 > Free Software Foundation, Inc. > Contributed by Michal Ludvig, SuSE Labs. > > This file is part of GDB. > > 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 > the Free Software Foundation; either version 2 of the License, or > (at your option) any later version. > > This program is distributed in the hope that it will be useful, > but WITHOUT ANY WARRANTY; without even the implied warranty of > MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the > GNU General Public License for more details. > > You should have received a copy of the GNU General Public License > along with this program; if not, write to the Free Software > Foundation, Inc., 59 Temple Place - Suite 330, > Boston, MA 02111-1307, USA. */ > > > #ifndef DWARF2READ_H > #define DWARF2READ_H > > #include "bfd.h" > #include "objfiles.h" > > extern file_ptr dwarf_frame_offset; > extern unsigned int dwarf_frame_size; > extern file_ptr dwarf_eh_frame_offset; > extern unsigned int dwarf_eh_frame_size; > > void dwarf2_build_psymtabs (struct objfile *objfile, int mainline); > int dwarf2_has_info (bfd *abfd); > char * dwarf2_read_section (struct objfile *objfile, file_ptr offset, > unsigned int size); > > #endif /* DWARF2READ_H */ > Index: dwarf2read.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2read.c,v > retrieving revision 1.49 > diff -c -3 -p -r1.49 dwarf2read.c > *** dwarf2read.c 28 Feb 2002 11:21:16 -0000 1.49 > --- dwarf2read.c 17 May 2002 13:09:18 -0000 > *************** > *** 37,42 **** > --- 37,43 ---- > #include "demangle.h" > #include "expression.h" > #include "filenames.h" /* for DOSish file names */ > + #include "dwarf2read.h" > > #include "language.h" > #include "complaints.h" > Index: dwarf2cfi.c > =================================================================== > RCS file: /cvs/src/src/gdb/dwarf2cfi.c,v > retrieving revision 1.1.2.2 > diff -c -3 -p -r1.1.2.2 dwarf2cfi.c > *** dwarf2cfi.c 14 May 2002 09:50:39 -0000 1.1.2.2 > --- dwarf2cfi.c 17 May 2002 13:09:18 -0000 > *************** > *** 28,33 **** > --- 28,34 ---- > #include "elf/dwarf2.h" > #include "inferior.h" > #include "regcache.h" > + #include "dwarf2read.h" > #include "dwarf2cfi.h" > > /* Common Information Entry - holds information that is shared among many > *************** static struct fde_array fde_chunks; > *** 184,199 **** > /* Obstack for allocating temporary storage used during unwind operations. */ > static struct obstack unwind_tmp_obstack; > > - extern file_ptr dwarf_frame_offset; > - extern unsigned int dwarf_frame_size; > - extern file_ptr dwarf_eh_frame_offset; > - extern unsigned int dwarf_eh_frame_size; > - > static char *dwarf_frame_buffer; > - > - > - extern char *dwarf2_read_section (struct objfile *objfile, file_ptr offset, > - unsigned int size); > > static struct fde_unit *fde_unit_alloc (void); > static struct cie_unit *cie_unit_alloc (void); > --- 185,191 ----