gdb/fortran: Implement la_print_typedef for Fortran
[external/binutils.git] / gdb / buildsym.c
index 50f0f42..8e05706 100644 (file)
    along with this program.  If not, see <http://www.gnu.org/licenses/>.  */
 
 #include "defs.h"
-
-/* Standard C++ includes.  */
-#include <algorithm>
-
-/* Local non-gdb includes.  */
-#include "addrmap.h"
-#include "bfd.h"
-#include "block.h"
 #include "buildsym-legacy.h"
-#include "complaints.h"
-#include "cp-support.h"
-#include "demangle.h"
-#include "dictionary.h"
-#include "expression.h"
-#include "filenames.h"
+#include "bfd.h"
 #include "gdb_obstack.h"
+#include "symtab.h"
+#include "symfile.h"
+#include "objfiles.h"
 #include "gdbtypes.h"
+#include "complaints.h"
+#include "expression.h"                /* For "enum exp_opcode" used by...  */
+#include "filenames.h"         /* For DOSish file names.  */
 #include "macrotab.h"
-#include "objfiles.h"
-#include "symfile.h"
-#include "symtab.h"
+#include "demangle.h"          /* Needed by SYMBOL_INIT_DEMANGLED_NAME.  */
+#include "block.h"
+#include "cp-support.h"
+#include "dictionary.h"
+#include "addrmap.h"
+#include <algorithm>
 
 /* For cleanup_undefined_stabs_types and finish_global_stabs (somewhat
    questionable--see comment where we call them).  */
@@ -1035,9 +1031,8 @@ buildsym_compunit::end_symtab_with_blockvector (struct block *static_block,
     {
       /* Reallocate the dirname on the symbol obstack.  */
       const char *comp_dir = m_comp_dir.get ();
-      COMPUNIT_DIRNAME (cu)
-       = (const char *) obstack_copy0 (&m_objfile->objfile_obstack,
-                                       comp_dir, strlen (comp_dir));
+      COMPUNIT_DIRNAME (cu) = obstack_strdup (&m_objfile->objfile_obstack,
+                                             comp_dir);
     }
 
   /* Save the debug format string (if any) in the symtab.  */