Add "make pdf" and "make install-pdf", from Brooks Moses
[deliverable/binutils-gdb.git] / gdb / somread.c
index b58e69c7cade02f9da69a167cdad5ec829ee2be8..5f0c13b6011daac3d399b50dfa6953a10913719d 100644 (file)
@@ -1,6 +1,6 @@
 /* Read HP PA/Risc object files for GDB.
    Copyright (C) 1991, 1992, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002,
-   2004 Free Software Foundation, Inc.
+   2004, 2007 Free Software Foundation, Inc.
    Written by Fred Fish at Cygnus Support.
 
    This file is part of GDB.
@@ -88,15 +88,22 @@ som_symtab_read (bfd *abfd, struct objfile *objfile,
 
   number_of_symbols = bfd_get_symcount (abfd);
 
-  /* FIXME (alloca): could be quite large. */
-  buf = alloca (symsize * number_of_symbols);
+  /* Allocate a buffer to read in the debug info.
+     We avoid using alloca because the memory size could be so large
+     that we could hit the stack size limit.  */
+  buf = xmalloc (symsize * number_of_symbols);
+  make_cleanup (xfree, buf);
   bfd_seek (abfd, obj_som_sym_filepos (abfd), SEEK_SET);
   val = bfd_bread (buf, symsize * number_of_symbols, abfd);
   if (val != symsize * number_of_symbols)
     error (_("Couldn't read symbol dictionary!"));
 
-  /* FIXME (alloca): could be quite large. */
-  stringtab = alloca (obj_som_stringtab_size (abfd));
+  /* Allocate a buffer to read in the som stringtab section of
+     the debugging info.  Again, we avoid using alloca because
+     the data could be so large that we could potentially hit
+     the stack size limitat.  */
+  stringtab = xmalloc (obj_som_stringtab_size (abfd));
+  make_cleanup (xfree, stringtab);
   bfd_seek (abfd, obj_som_str_filepos (abfd), SEEK_SET);
   val = bfd_bread (stringtab, obj_som_stringtab_size (abfd), abfd);
   if (val != obj_som_stringtab_size (abfd))
@@ -353,9 +360,7 @@ som_symfile_read (struct objfile *objfile, int mainline)
   do_cleanups (back_to);
 
   /* Now read information from the stabs debug sections.
-     This is a no-op for SOM.
-     Perhaps it is intended for some kind of mixed STABS/SOM
-     situation? */
+     This is emitted by gcc.  */
   stabsect_build_psymtabs (objfile, mainline,
                           "$GDB_SYMBOLS$", "$GDB_STRINGS$", "$TEXT$");
 
@@ -364,9 +369,6 @@ som_symfile_read (struct objfile *objfile, int mainline)
      the DNTT, but is now done via the PXDB-built quick-lookup tables
      together with a scan of the GNTT. See hp-psymtab-read.c. */
   hpread_build_psymtabs (objfile, mainline);
-
-  /* Force hppa-tdep.c to re-read the unwind descriptors.  */
-  objfile->deprecated_obj_private = NULL;
 }
 
 /* Initialize anything that needs initializing when a completely new symbol
This page took 0.024429 seconds and 4 git commands to generate.