From c295b2e5056e475702a492c520c17d47c9955e14 Mon Sep 17 00:00:00 2001 From: Joel Brobecker Date: Fri, 21 Sep 2007 18:01:26 +0000 Subject: [PATCH] * 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. --- gdb/ChangeLog | 13 +++++++++++++ gdb/buildsym.c | 7 +++---- gdb/coffread.c | 1 + gdb/config/powerpc/aix.mt | 1 - gdb/config/rs6000/tm-rs6000.h | 30 ------------------------------ gdb/dbxread.c | 1 + gdb/elfread.c | 1 + gdb/mipsread.c | 1 + gdb/somread.c | 1 + gdb/symfile.h | 5 +++++ gdb/xcoffread.c | 3 ++- 11 files changed, 28 insertions(+), 36 deletions(-) delete mode 100644 gdb/config/rs6000/tm-rs6000.h diff --git a/gdb/ChangeLog b/gdb/ChangeLog index c217f0cabfe..814fc5e1129 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,16 @@ +2007-09-21 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. + 2007-09-21 David Ung Maciej W. Rozycki diff --git a/gdb/buildsym.c b/gdb/buildsym.c index 547e7ca646b..d3af35e1d51 100644 --- a/gdb/buildsym.c +++ b/gdb/buildsym.c @@ -933,10 +933,9 @@ end_symtab (CORE_ADDR end_addr, struct objfile *objfile, int section) &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.) */ diff --git a/gdb/coffread.c b/gdb/coffread.c index 0276378996b..b767eaff713 100644 --- a/gdb/coffread.c +++ b/gdb/coffread.c @@ -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 */ }; diff --git a/gdb/config/powerpc/aix.mt b/gdb/config/powerpc/aix.mt index c18e4ba4f17..06a9984e06a 100644 --- a/gdb/config/powerpc/aix.mt +++ b/gdb/config/powerpc/aix.mt @@ -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 diff --git a/gdb/config/rs6000/tm-rs6000.h b/gdb/config/rs6000/tm-rs6000.h deleted file mode 100644 index 511c5347d67..00000000000 --- a/gdb/config/rs6000/tm-rs6000.h +++ /dev/null @@ -1,30 +0,0 @@ -/* Parameters for target execution on an RS6000, for GDB, the GNU debugger. - - Copyright 1986, 1987, 1989, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, - 1999, 2000, 2004, 2007 Free Software Foundation, Inc. - - Contributed by IBM Corporation. - - 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 3 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, see . */ - -/* In xcoff, we cannot process line numbers when we see them. This is - mainly because we don't know the boundaries of the include files. So, - we postpone that, and then enter and sort(?) the whole line table at - once, when we are closing the current symbol table in end_symtab(). */ - -#define PROCESS_LINENUMBER_HOOK() aix_process_linenos () -extern void aix_process_linenos (void); - diff --git a/gdb/dbxread.c b/gdb/dbxread.c index f0129f65987..95f8cd8bd74 100644 --- a/gdb/dbxread.c +++ b/gdb/dbxread.c @@ -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 */ }; diff --git a/gdb/elfread.c b/gdb/elfread.c index d139bdeb18d..9e3ed6cbad3 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -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 */ }; diff --git a/gdb/mipsread.c b/gdb/mipsread.c index 280e605749f..6f7cad89970 100644 --- a/gdb/mipsread.c +++ b/gdb/mipsread.c @@ -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 */ }; diff --git a/gdb/somread.c b/gdb/somread.c index 21281ef6e8a..b0b1615d818 100644 --- a/gdb/somread.c +++ b/gdb/somread.c @@ -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 */ }; diff --git a/gdb/symfile.h b/gdb/symfile.h index 49c12337b38..15f60cc988f 100644 --- a/gdb/symfile.h +++ b/gdb/symfile.h @@ -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 diff --git a/gdb/xcoffread.c b/gdb/xcoffread.c index 08e1de3e304..49bf023679a 100644 --- a/gdb/xcoffread.c +++ b/gdb/xcoffread.c @@ -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 */ }; -- 2.30.2