This is the mail archive of the gdb-patches@sources.redhat.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[obish] Garbage collect main_func_{low,high}pc


While both set and relocated, they are never used. This deletes them.

committed,
Andrew
2004-09-01  Andrew Cagney  <cagney@gnu.org>

	* objfiles.h (struct entry_info): Delete fields main_func_lowpc
	and main_func_highpc.
	(INVALID_ENTRY_LOWPC, INVALID_ENTRY_HIGHPC): Delete macros.
	* objfiles.c (init_entry_point_info, objfile_relocate): Update
	* nlmread.c (nlm_symfile_read): Update.

Index: nlmread.c
===================================================================
RCS file: /cvs/src/src/gdb/nlmread.c,v
retrieving revision 1.13
diff -p -u -r1.13 nlmread.c
--- nlmread.c	10 Aug 2004 21:52:04 -0000	1.13
+++ nlmread.c	2 Sep 2004 03:04:08 -0000
@@ -177,7 +177,6 @@ nlm_symfile_read (struct objfile *objfil
   bfd *abfd = objfile->obfd;
   struct cleanup *back_to;
   CORE_ADDR offset;
-  struct symbol *mainsym;
 
   init_minimal_symbol_collection ();
   back_to = make_cleanup_discard_minimal_symbols ();
@@ -199,16 +198,6 @@ nlm_symfile_read (struct objfile *objfil
 
   stabsect_build_psymtabs (objfile, mainline, ".stab",
 			   ".stabstr", ".text");
-
-  mainsym = lookup_symbol (main_name (), NULL, VAR_DOMAIN, NULL, NULL);
-
-  if (mainsym
-      && SYMBOL_CLASS (mainsym) == LOC_BLOCK)
-    {
-      objfile->ei.main_func_lowpc = BLOCK_START (SYMBOL_BLOCK_VALUE (mainsym));
-      objfile->ei.main_func_highpc = BLOCK_END (SYMBOL_BLOCK_VALUE (mainsym));
-    }
-
   /* FIXME:  We could locate and read the optional native debugging format
      here and add the symbols to the minimal symbol table. */
 }
Index: objfiles.c
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.c,v
retrieving revision 1.54
diff -p -u -r1.54 objfiles.c
--- objfiles.c	10 Aug 2004 21:52:04 -0000	1.54
+++ objfiles.c	2 Sep 2004 03:04:08 -0000
@@ -250,8 +250,6 @@ init_entry_point_info (struct objfile *o
       /* Examination of non-executable.o files.  Short-circuit this stuff.  */
       objfile->ei.entry_point = INVALID_ENTRY_POINT;
     }
-  objfile->ei.main_func_lowpc = INVALID_ENTRY_LOWPC;
-  objfile->ei.main_func_highpc = INVALID_ENTRY_HIGHPC;
 }
 
 /* Get current entry point address.  */
@@ -647,12 +645,6 @@ objfile_relocate (struct objfile *objfil
       }
   }
 
-  if (objfile->ei.main_func_lowpc != INVALID_ENTRY_LOWPC)
-    {
-      objfile->ei.main_func_lowpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-      objfile->ei.main_func_highpc += ANOFFSET (delta, SECT_OFF_TEXT (objfile));
-    }
-
   /* Relocate breakpoints as necessary, after things are relocated. */
   breakpoint_re_set ();
 }
Index: objfiles.h
===================================================================
RCS file: /cvs/src/src/gdb/objfiles.h,v
retrieving revision 1.38
diff -p -u -r1.38 objfiles.h
--- objfiles.h	24 Jun 2004 20:42:42 -0000	1.38
+++ objfiles.h	2 Sep 2004 03:04:08 -0000
@@ -110,20 +110,6 @@ struct entry_info
 
 #define INVALID_ENTRY_POINT (~0)	/* ~0 will not be in any file, we hope.  */
 
-    /* Start (inclusive) and end (exclusive) of the user code main() function. */
-
-    CORE_ADDR main_func_lowpc;
-    CORE_ADDR main_func_highpc;
-
-/* Use these values when any of the above ranges is invalid.  */
-
-/* We use these values because it guarantees that there is no number that is
-   both >= LOWPC && < HIGHPC.  It is also highly unlikely that 3 is a valid
-   module or function start address (as opposed to 0).  */
-
-#define INVALID_ENTRY_LOWPC (3)
-#define INVALID_ENTRY_HIGHPC (1)
-
   };
 
 /* Sections in an objfile.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]