Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFC/commit] Getting rid of tm-rs6000.h (PROCESS_LINENUMBER_HOOK)
Date: Thu, 20 Sep 2007 21:13:00 -0000	[thread overview]
Message-ID: <20070920211311.GA4363@adacore.com> (raw)
In-Reply-To: <20070920063714.GA16312@adacore.com>

[-- Attachment #1: Type: text/plain, Size: 1034 bytes --]

> 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  <brobecker@adacore.com>

        * 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

[-- Attachment #2: xcoff.diff --]
[-- Type: text/plain, Size: 5985 bytes --]

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

  parent reply	other threads:[~2007-09-20 21:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 23:15 Joel Brobecker
2007-09-20  6:10 ` Mark Kettenis
2007-09-20  6:37   ` Joel Brobecker
2007-09-20  9:04     ` Mark Kettenis
2007-09-20 21:13     ` Joel Brobecker [this message]
2007-09-21  7:48       ` Mark Kettenis
2007-09-21 18:03         ` Joel Brobecker
2007-10-02 17:38           ` Ulrich Weigand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20070920211311.GA4363@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox