Fix long file name bug reported on SCO Open Desktop 2.0 by Ulf Lunde
authorJohn Gilmore <gnu@cygnus>
Fri, 5 Feb 1993 22:09:17 +0000 (22:09 +0000)
committerJohn Gilmore <gnu@cygnus>
Fri, 5 Feb 1993 22:09:17 +0000 (22:09 +0000)
<Ulf.Lunde@kvatro.no> and Dag H. Wanvik <Dag.H.Wanvik@kvatro.no>.

* coffread.c (getfilename):  Eliminate COFF_NO_LONG_FILE_NAMES
test, which is apparently left over from when we used native
include files and couldn't depend on the member names being there.
* tm-3b1.h, tm-altos.h, tm-i386v.h:  Don't set it.

ALso fix this in tm-i860.h which isn't ChangeLogged since it's sanitized out
for lack of paperwork.

gdb/ChangeLog
gdb/coffread.c
gdb/tm-3b1.h
gdb/tm-altos.h
gdb/tm-i386v.h
gdb/tm-i860.h

index 4cba34746f1f78f11fc703694a6d2dae2bbc53ae..38d678c5819aae3c0c1b2de5f52c591aa4d669ff 100644 (file)
@@ -1,3 +1,19 @@
+Fri Feb  5 14:01:22 1993  John Gilmore  (gnu@cygnus.com)
+
+       Fix long file name bug reported on SCO Open Desktop 2.0 by Ulf Lunde
+       <Ulf.Lunde@kvatro.no> and Dag H. Wanvik <Dag.H.Wanvik@kvatro.no>.
+         
+       * coffread.c (getfilename):  Eliminate COFF_NO_LONG_FILE_NAMES
+       test, which is apparently left over from when we used native
+       include files and couldn't depend on the member names being there.
+       * tm-3b1.h, tm-altos.h, tm-i386v.h:  Don't set it.
+
+Thu Feb  4 12:23:15 1993  Ian Lance Taylor  (ian@cygnus.com)
+
+       * mipsread.c: Major overhaul to use new BFD symbol table reading
+       routines.  Now swaps information as it is needed, rather than
+       swapping everything when the file is read.
+
 Thu Feb  4 01:52:36 1993  John Gilmore  (gnu@cygnus.com)
 
        * Makefile.in (TARDIRS):  Add sparclite demo dir.
index 62e20d3c3512686016c4b5d6adc16677f8b1350b..f7a1b1601e35edf31e659a9ce740b909c12d84c0 100644 (file)
@@ -1013,7 +1013,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile)
 
           case C_STAT:
            if (cs->c_name[0] == '.') {
-                   if (strcmp (cs->c_name, ".text") == 0) {
+                   if (STREQ (cs->c_name, ".text")) {
                            /* FIXME:  don't wire in ".text" as section name
                                       or symbol name! */
                            if (++num_object_files == 1) {
@@ -1068,7 +1068,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile)
            break;
 
          case C_FCN:
-           if (strcmp (cs->c_name, ".bf") == 0)
+           if (STREQ (cs->c_name, ".bf"))
              {
                within_function = 1;
 
@@ -1091,7 +1091,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile)
                new->name = process_coff_symbol (&fcn_cs_saved,
                                                 &fcn_aux_saved, objfile);
              }
-           else if (strcmp (cs->c_name, ".ef") == 0)
+           else if (STREQ (cs->c_name, ".ef"))
              {
                      /* the value of .ef is the address of epilogue code;
                       * not useful for gdb
@@ -1137,7 +1137,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile)
            break;
 
          case C_BLOCK:
-           if (strcmp (cs->c_name, ".bb") == 0)
+           if (STREQ (cs->c_name, ".bb"))
              {
                new = (struct coff_context_stack *)
                            xmalloc (sizeof (struct coff_context_stack));
@@ -1151,7 +1151,7 @@ read_coff_symtab (symtab_offset, nsyms, objfile)
                new->name = 0;
                coff_local_symbols = 0;
              }
-           else if (strcmp (cs->c_name, ".eb") == 0)
+           else if (STREQ (cs->c_name, ".eb"))
              {
                new = coff_context_stack;
                if (new == 0 || depth != new->depth)
@@ -1366,6 +1366,10 @@ getsymname (symbol_entry)
   return result;
 }
 
+/* Extract the file name from the aux entry of a C_FILE symbol.  Return
+   only the last component of the name.  Result is in static storage and
+   is only good for temporary use.  */
+
 static char *
 getfilename (aux_entry)
     union internal_auxent *aux_entry;
@@ -1374,24 +1378,11 @@ getfilename (aux_entry)
   register char *temp;
   char *result;
 
-#ifndef COFF_NO_LONG_FILE_NAMES
-#if defined (x_zeroes)
-  /* Data General.  */
-  if (aux_entry->x_zeroes == 0)
-    strcpy (buffer, stringtab + aux_entry->x_offset);
-#else /* no x_zeroes */
   if (aux_entry->x_file.x_n.x_zeroes == 0)
     strcpy (buffer, stringtab + aux_entry->x_file.x_n.x_offset);
-#endif /* no x_zeroes */
   else
-#endif /* COFF_NO_LONG_FILE_NAMES */
     {
-#if defined (x_name)
-      /* Data General.  */
-      strncpy (buffer, aux_entry->x_name, FILNMLEN);
-#else
       strncpy (buffer, aux_entry->x_file.x_fname, FILNMLEN);
-#endif
       buffer[FILNMLEN] = '\0';
     }
   result = buffer;
@@ -1535,7 +1526,7 @@ patch_opaque_types (s)
          for (sym = opaque_type_chain[hash]; sym;)
            {
              if (name[0] == SYMBOL_NAME (sym)[0] &&
-                 !strcmp (name + 1, SYMBOL_NAME (sym) + 1))
+                 STREQ (name + 1, SYMBOL_NAME (sym) + 1))
                {
                  if (prev)
                    {
@@ -1574,14 +1565,16 @@ process_coff_symbol (cs, aux, objfile)
      struct objfile *objfile;
 {
   register struct symbol *sym
-    = (struct symbol *) obstack_alloc (&objfile->symbol_obstack, sizeof (struct symbol));
+    = (struct symbol *) obstack_alloc (&objfile->symbol_obstack,
+                                      sizeof (struct symbol));
   char *name;
   struct type *temptype;
 
   memset (sym, 0, sizeof (struct symbol));
   name = cs->c_name;
   name = EXTERNAL_NAME (name, objfile->obfd);
-  SYMBOL_NAME (sym) = obstack_copy0 (&objfile->symbol_obstack, name, strlen (name));
+  SYMBOL_NAME (sym) = obstack_copy0 (&objfile->symbol_obstack, name,
+                                    strlen (name));
 
   /* default assumptions */
   SYMBOL_VALUE (sym) = cs->c_value;
@@ -2135,10 +2128,10 @@ coff_read_enum_type (index, length, lastsym)
     }
   /* Is this Modula-2's BOOLEAN type?  Flag it as such if so. */
   if(TYPE_NFIELDS(type) == 2 &&
-     ((!strcmp(TYPE_FIELD_NAME(type,0),"TRUE") &&
-       !strcmp(TYPE_FIELD_NAME(type,1),"FALSE")) ||
-      (!strcmp(TYPE_FIELD_NAME(type,1),"TRUE") &&
-       !strcmp(TYPE_FIELD_NAME(type,0),"FALSE"))))
+     ((STREQ(TYPE_FIELD_NAME(type,0),"TRUE") &&
+       STREQ(TYPE_FIELD_NAME(type,1),"FALSE")) ||
+      (STREQ(TYPE_FIELD_NAME(type,1),"TRUE") &&
+       STREQ(TYPE_FIELD_NAME(type,0),"FALSE"))))
      TYPE_CODE(type) = TYPE_CODE_BOOL;
   return type;
 }
index 4bcf01fcb0f6b69b9cf11197bfa8b9ad2fec9d71..281b1d33e56dfeb26b3ad1180108cd70c3b46834 100644 (file)
@@ -1,5 +1,5 @@
-/* Parameters for targeting to a 3b1.
-   Copyright (C) 1986, 1987, 1989, 1991 Free Software Foundation, Inc.
+/* Parameters for targeting GDB to a 3b1.
+   Copyright 1986, 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -27,10 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define NAMES_HAVE_UNDERSCORE
 
-/* Debugger information will be in COFF format, without long filenames.  */
-
-#define COFF_NO_LONG_FILE_NAMES
-
 /* Address of end of stack space.  */
 
 #define STACK_END_ADDR 0x300000
index f3cc306b1b216699267f577ea5cb6db1bc23283f..bc0ca81028d50769b4be1303ce00676bb1813c8d 100644 (file)
@@ -1,5 +1,5 @@
-/* Definitions to make GDB run on an Altos 3068 (m68k running SVR2)
-   Copyright (C) 1987, 1989, 1991 Free Software Foundation, Inc.
+/* Target definitions for GDB on an Altos 3068 (m68k running SVR2)
+   Copyright 1987, 1989, 1991, 1993 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -27,10 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #undef NAMES_HAVE_UNDERSCORE
 
-/* COFF files don't have long filenames.  */
-
-#define COFF_NO_LONG_FILE_NAMES
-
 /* Address of end of stack space.  */
 
 /*#define STACK_END_ADDR (0xffffff)*/
index bfd0e35daa2dec64ae5838f4452f48b08e3e53cb..e317ca23cad4b18c0b31e42e0003cc7110b75c4e 100644 (file)
@@ -1,5 +1,5 @@
 /* Macro definitions for i386, Unix System V.
-   Copyright 1986, 1987, 1989, 1991, 1992 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1989, 1991, 1992, 1993 Free Software Foundation, Inc.
 
 This file is part of GDB.
 
@@ -27,12 +27,6 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
 
 #define TARGET_BYTE_ORDER LITTLE_ENDIAN
 
-/* define this if you don't have the extension to coff that allows
- * file names to appear in the string table
- * (aux.x_file.x_foff)
- */
-#define COFF_NO_LONG_FILE_NAMES
-
 /* turn this on when rest of gdb is ready */
 #define IEEE_FLOAT
 
index b26e205de866b5342170566ace530e3766930817..18ab9750366f51f1ec1cadd3ed32aa988cdc1490 100644 (file)
@@ -1,5 +1,5 @@
 /* Parameters for execution on the Intel I860 for GDB, the GNU debugger.
-   Copyright (C) 1986, 1987 Free Software Foundation, Inc.
+   Copyright 1986, 1987, 1993 Free Software Foundation, Inc.
 
 GDB is distributed in the hope that it will be useful, but WITHOUT ANY
 WARRANTY.  No author or distributor accepts responsibility to anyone
@@ -25,11 +25,6 @@ anyone else from sharing it farther.  Help stamp out software hoarding!
 #define HAVE_TERMIO
 #define vfork fork
 
-/* Debugger information will be in COFF format.  */
-
-/* #define COFF_FORMAT */
-#define COFF_NO_LONG_FILE_NAMES
-
 /* Offset from address of function to start of its code.
    Zero on most machines.  */