From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 8227 invoked by alias); 4 Dec 2009 12:43:24 -0000 Received: (qmail 8212 invoked by uid 22791); 4 Dec 2009 12:43:22 -0000 X-SWARE-Spam-Status: No, hits=0.4 required=5.0 tests=AWL,BAYES_00,KAM_STOCKTIP X-Spam-Check-By: sourceware.org Received: from mel.act-europe.fr (HELO mel.act-europe.fr) (212.99.106.210) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Dec 2009 12:43:16 +0000 Received: from localhost (localhost [127.0.0.1]) by filtered-smtp.eu.adacore.com (Postfix) with ESMTP id 45192290012 for ; Fri, 4 Dec 2009 13:43:14 +0100 (CET) Received: from mel.act-europe.fr ([127.0.0.1]) by localhost (smtp.eu.adacore.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id fcNxlUbprxHa for ; Fri, 4 Dec 2009 13:43:13 +0100 (CET) Received: from ulanbator.act-europe.fr (ulanbator.act-europe.fr [10.10.1.67]) by mel.act-europe.fr (Postfix) with ESMTP id 92AFB290001 for ; Fri, 4 Dec 2009 13:43:13 +0100 (CET) Received: by ulanbator.act-europe.fr (Postfix, from userid 501) id 5C5F712537A4; Fri, 4 Dec 2009 13:43:27 +0100 (CET) Date: Fri, 04 Dec 2009 12:43:00 -0000 From: Tristan Gingold To: gdb-patches@sourceware.org Subject: [RFA] Pass all symfile flags to sym_read. Message-ID: <20091204124327.GA5714@ulanbator.act-europe.fr> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.3i X-IsSubscribed: yes Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-12/txt/msg00048.txt.bz2 Hi This is preliminary work to make sym_read handles separate debug files. This is trivially done as mainline is not read anymore. Tristan. 2009-12-02 Tristan Gingold * symfile.h (struct sym_fns): Adjust comment on sym_read. * symfile.c (syms_from_objfile): Pass all symfile flags to sym_read. * dbxread.c (dbx_symfile_read): Rename mainline to symfile_flags, adjust header comment. * elfread.c (elf_symfile_read): Ditto. * somread.c (som_symfile_read): Ditto. * xcoffread.c (xcoff_initial_scan): Ditto. * coffread.c (coff_symfile_read): Rename mainline to symfile_flags. * machoread.c (macho_symfile_read): Ditto. * mipsread.c (mipscoff_symfile_read): Ditto. --- gdb/coffread.c | 2 +- gdb/dbxread.c | 7 ++----- gdb/elfread.c | 5 +---- gdb/machoread.c | 2 +- gdb/mipsread.c | 2 +- gdb/somread.c | 5 +---- gdb/symfile.c | 2 +- gdb/symfile.h | 7 +++---- gdb/xcoffread.c | 5 ++--- 9 files changed, 13 insertions(+), 24 deletions(-) diff --git a/gdb/coffread.c b/gdb/coffread.c index 1f71db2..3f5ff96 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -501,7 +501,7 @@ static bfd *symfile_bfd; /* Read a symbol file, after initialization by coff_symfile_init. */ static void -coff_symfile_read (struct objfile *objfile, int mainline) +coff_symfile_read (struct objfile *objfile, int symfile_flags) { struct coff_symfile_info *info; struct dbx_symfile_info *dbxinfo; diff --git a/gdb/dbxread.c b/gdb/dbxread.c index 3efaa65..0c89ccf 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -520,13 +520,10 @@ record_minimal_symbol (char *name, CORE_ADDR address, int type, /* Scan and build partial symbols for a symbol file. We have been initialized by a call to dbx_symfile_init, which put all the relevant info into a "struct dbx_symfile_info", - hung off the objfile structure. - - MAINLINE is true if we are reading the main symbol - table (as opposed to a shared lib or dynamically loaded file). */ + hung off the objfile structure. */ static void -dbx_symfile_read (struct objfile *objfile, int mainline) +dbx_symfile_read (struct objfile *objfile, int symfile_flags) { bfd *sym_bfd; int val; diff --git a/gdb/elfread.c b/gdb/elfread.c index f9052c1..dd844fc 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -576,9 +576,6 @@ elf_symtab_read (struct objfile *objfile, int type, in each section. We simplify it down to a single offset for all symbols. FIXME. - MAINLINE is true if we are reading the main symbol - table (as opposed to a shared lib or dynamically loaded file). - This function only does the minimum work necessary for letting the user "name" things symbolically; it does not read the entire symtab. Instead, it reads the external and static symbols and puts them in partial @@ -600,7 +597,7 @@ elf_symtab_read (struct objfile *objfile, int type, capability even for files compiled without -g. */ static void -elf_symfile_read (struct objfile *objfile, int mainline) +elf_symfile_read (struct objfile *objfile, int symfile_flags) { bfd *abfd = objfile->obfd; struct elfinfo ei; diff --git a/gdb/machoread.c b/gdb/machoread.c index 081027f..a449963 100644 --- a/gdb/machoread.c +++ b/gdb/machoread.c @@ -574,7 +574,7 @@ macho_check_dsym (struct objfile *objfile) } static void -macho_symfile_read (struct objfile *objfile, int mainline) +macho_symfile_read (struct objfile *objfile, int symfile_flags) { bfd *abfd = objfile->obfd; struct cleanup *back_to; diff --git a/gdb/mipsread.c b/gdb/mipsread.c index a84003f..cac10e6 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -67,7 +67,7 @@ mipscoff_symfile_init (struct objfile *objfile) /* Read a symbol file from a file. */ static void -mipscoff_symfile_read (struct objfile *objfile, int mainline) +mipscoff_symfile_read (struct objfile *objfile, int symfile_flags) { bfd *abfd = objfile->obfd; struct cleanup *back_to; diff --git a/gdb/somread.c b/gdb/somread.c index d519d2c..04f0684 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -292,9 +292,6 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, SECTION_OFFSETS is a set of offsets to apply to relocate the symbols in each section. This is ignored, as it isn't needed for SOM. - MAINLINE is true if we are reading the main symbol - table (as opposed to a shared lib or dynamically loaded file). - This function only does the minimum work necessary for letting the user "name" things symbolically; it does not read the entire symtab. Instead, it reads the external and static symbols and puts them in partial @@ -315,7 +312,7 @@ som_symtab_read (bfd *abfd, struct objfile *objfile, capability even for files compiled without -g. */ static void -som_symfile_read (struct objfile *objfile, int mainline) +som_symfile_read (struct objfile *objfile, int symfile_flags) { bfd *abfd = objfile->obfd; struct cleanup *back_to; diff --git a/gdb/symfile.c b/gdb/symfile.c index b635691..6e1b915 100644 --- a/gdb/symfile.c +++ b/gdb/symfile.c @@ -886,7 +886,7 @@ syms_from_objfile (struct objfile *objfile, init_objfile_sect_indices (objfile); } - (*objfile->sf->sym_read) (objfile, mainline); + (*objfile->sf->sym_read) (objfile, add_flags); /* Discard cleanups as symbol reading was successful. */ diff --git a/gdb/symfile.h b/gdb/symfile.h index 40f7db7..cca7cba 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -132,11 +132,10 @@ struct sym_fns void (*sym_init) (struct objfile *); - /* sym_read (objfile, mainline) Reads a symbol file into a psymtab + /* sym_read (objfile, symfile_flags) Reads a symbol file into a psymtab (or possibly a symtab). OBJFILE is the objfile struct for the - file we are reading. MAINLINE is 1 if this is the main symbol - table being read, and 0 if a secondary symbol file (e.g. shared - library or dynamically loaded file) is being read. */ + file we are reading. SYMFILE_FLAGS are the flags passed to + symbol_fil_add & co. */ void (*sym_read) (struct objfile *, int); diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 35d8f1d..01dffab 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -2868,11 +2868,10 @@ xcoff_get_toc_offset (struct objfile *objfile) SECTION_OFFSETS contains offsets relative to which the symbols in the various sections are (depending where the sections were actually loaded). - MAINLINE is true if we are reading the main symbol - table (as opposed to a shared lib or dynamically loaded file). */ +*/ static void -xcoff_initial_scan (struct objfile *objfile, int mainline) +xcoff_initial_scan (struct objfile *objfile, int symfile_flags) { bfd *abfd; int val; -- 1.6.2