From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 15892 invoked by alias); 20 Sep 2007 21:13:25 -0000 Received: (qmail 15878 invoked by uid 22791); 20 Sep 2007 21:13:23 -0000 X-Spam-Check-By: sourceware.org Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 20 Sep 2007 21:13:16 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id 958CC2AB754; Thu, 20 Sep 2007 17:13:14 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id tg9aLVltWSGz; Thu, 20 Sep 2007 17:13:14 -0400 (EDT) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 142CC2AB68D; Thu, 20 Sep 2007 17:13:14 -0400 (EDT) Received: by joel.gnat.com (Postfix, from userid 1000) id D77EBE7B58; Thu, 20 Sep 2007 14:13:11 -0700 (PDT) Date: Thu, 20 Sep 2007 21:13:00 -0000 From: Joel Brobecker To: Mark Kettenis Cc: gdb-patches@sourceware.org Subject: Re: [RFC/commit] Getting rid of tm-rs6000.h (PROCESS_LINENUMBER_HOOK) Message-ID: <20070920211311.GA4363@adacore.com> References: <20070918231448.GS29127@adacore.com> <200709200610.l8K6AeV1018876@brahms.sibelius.xs4all.nl> <20070920063714.GA16312@adacore.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="+HP7ph2BbKc20aGI" Content-Disposition: inline In-Reply-To: <20070920063714.GA16312@adacore.com> User-Agent: Mutt/1.4.2.2i 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: 2007-09/txt/msg00270.txt.bz2 --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 1034 > What do you think about adding a new method inside struct sym_fns: > > void (*sym_read_linetable) (void) > > It would be null for all object formats except XCOFF. > > I'll experiment with that... Thanks for your feedback! Here is a patch that implements exactly this. 2007-09-20 Joel Brobecker * symfile.h (struct sym_fns): Add new field sym_read_linetable. * coffread.c, dbxread.c, elfread.c, mipsread.c somread.c: Adjust the struct sym_fns object accordingly by setting the new field to NULL. * xcoffread.c (aix_process_linenos): Make static. (xcoff_sym_fns): Set new field to aix_process_linenos. * buildsym.c (end_symtab): Replace call to PROCESS_LINENUMBER_HOOK by call to new the new sym_fns sym_read_linetable function. * config/powerpc/aix.mt (DEPRECATED_TM_FILE): Delete. * config/rs6000/tm-rs6000.h: Delete. Tested on powerpc-aix and x86-linux, no regression. Does it look good? Thank you, -- Joel --+HP7ph2BbKc20aGI Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="xcoff.diff" Content-length: 5985 Index: symfile.h =================================================================== RCS file: /cvs/src/src/gdb/symfile.h,v retrieving revision 1.40 diff -u -p -r1.40 symfile.h --- symfile.h 23 Aug 2007 18:08:42 -0000 1.40 +++ symfile.h 20 Sep 2007 21:07:30 -0000 @@ -157,6 +157,11 @@ struct sym_fns struct symfile_segment_data *(*sym_segments) (bfd *abfd); + /* This function should read the linetable from the objfile when + the line table cannot be read while processing the debugging + information. */ + void (*sym_read_linetable) (void); + /* Finds the next struct sym_fns. They are allocated and initialized in whatever module implements the functions pointed to; an initializer calls add_symtab_fns to add them to the global Index: coffread.c =================================================================== RCS file: /cvs/src/src/gdb/coffread.c,v retrieving revision 1.74 diff -u -p -r1.74 coffread.c --- coffread.c 23 Aug 2007 18:08:27 -0000 1.74 +++ coffread.c 20 Sep 2007 20:22:11 -0000 @@ -2100,6 +2100,7 @@ static struct sym_fns coff_sym_fns = default_symfile_offsets, /* sym_offsets: xlate external to internal form */ default_symfile_segments, /* sym_segments: Get segment information from a file. */ + NULL, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: dbxread.c =================================================================== RCS file: /cvs/src/src/gdb/dbxread.c,v retrieving revision 1.86 diff -u -p -r1.86 dbxread.c --- dbxread.c 23 Aug 2007 18:08:28 -0000 1.86 +++ dbxread.c 20 Sep 2007 20:22:26 -0000 @@ -3513,6 +3513,7 @@ static struct sym_fns aout_sym_fns = default_symfile_offsets, /* sym_offsets: parse user's offsets to internal form */ default_symfile_segments, /* sym_segments: Get segment information from a file. */ + NULL, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: elfread.c =================================================================== RCS file: /cvs/src/src/gdb/elfread.c,v retrieving revision 1.62 diff -u -p -r1.62 elfread.c --- elfread.c 23 Aug 2007 18:08:28 -0000 1.62 +++ elfread.c 20 Sep 2007 20:22:33 -0000 @@ -813,6 +813,7 @@ static struct sym_fns elf_sym_fns = default_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */ elf_symfile_segments, /* sym_segments: Get segment information from a file. */ + NULL, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: mipsread.c =================================================================== RCS file: /cvs/src/src/gdb/mipsread.c,v retrieving revision 1.24 diff -u -p -r1.24 mipsread.c --- mipsread.c 23 Aug 2007 18:08:36 -0000 1.24 +++ mipsread.c 20 Sep 2007 20:23:19 -0000 @@ -394,6 +394,7 @@ static struct sym_fns ecoff_sym_fns = default_symfile_offsets, /* sym_offsets: dummy FIXME til implem sym reloc */ default_symfile_segments, /* sym_segments: Get segment information from a file. */ + NULL, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: somread.c =================================================================== RCS file: /cvs/src/src/gdb/somread.c,v retrieving revision 1.37 diff -u -p -r1.37 somread.c --- somread.c 23 Aug 2007 18:08:38 -0000 1.37 +++ somread.c 20 Sep 2007 20:23:42 -0000 @@ -438,6 +438,7 @@ static struct sym_fns som_sym_fns = som_symfile_offsets, /* sym_offsets: Translate ext. to int. relocation */ default_symfile_segments, /* sym_segments: Get segment information from a file. */ + NULL, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: xcoffread.c =================================================================== RCS file: /cvs/src/src/gdb/xcoffread.c,v retrieving revision 1.54 diff -u -p -r1.54 xcoffread.c --- xcoffread.c 23 Aug 2007 18:08:47 -0000 1.54 +++ xcoffread.c 20 Sep 2007 20:24:11 -0000 @@ -727,7 +727,7 @@ return_after_cleanup: memset (&main_subfile, '\0', sizeof (struct subfile)); } -void +static void aix_process_linenos (void) { /* process line numbers and enter them into line vector */ @@ -3012,6 +3012,7 @@ static struct sym_fns xcoff_sym_fns = xcoff_symfile_offsets, /* sym_offsets: xlate offsets ext->int form */ default_symfile_segments, /* sym_segments: Get segment information from a file. */ + aix_process_linenos, /* sym_read_linetable */ NULL /* next: pointer to next struct sym_fns */ }; Index: buildsym.c =================================================================== RCS file: /cvs/src/src/gdb/buildsym.c,v retrieving revision 1.50 diff -u -p -r1.50 buildsym.c --- buildsym.c 23 Aug 2007 18:08:26 -0000 1.50 +++ buildsym.c 20 Sep 2007 20:22:08 -0000 @@ -933,10 +933,9 @@ end_symtab (CORE_ADDR end_addr, struct o &objfile->objfile_obstack); } -#ifndef PROCESS_LINENUMBER_HOOK -#define PROCESS_LINENUMBER_HOOK() -#endif - PROCESS_LINENUMBER_HOOK (); /* Needed for xcoff. */ + /* Read the line table if it has to be read separately. */ + if (objfile->sf->sym_read_linetable != NULL) + objfile->sf->sym_read_linetable (); /* Now create the symtab objects proper, one for each subfile. */ /* (The main file is the last one on the chain.) */ Index: config/powerpc/aix.mt =================================================================== RCS file: /cvs/src/src/gdb/config/powerpc/aix.mt,v retrieving revision 1.9 diff -u -p -r1.9 aix.mt --- config/powerpc/aix.mt 10 Feb 2006 20:56:15 -0000 1.9 +++ config/powerpc/aix.mt 20 Sep 2007 20:24:17 -0000 @@ -1,4 +1,3 @@ # Target: PowerPC running AIX TDEPFILES= rs6000-tdep.o rs6000-aix-tdep.o \ xcoffread.o ppc-sysv-tdep.o solib.o solib-svr4.o -DEPRECATED_TM_FILE= config/rs6000/tm-rs6000.h --+HP7ph2BbKc20aGI--