* tm-sparc.h, dbxread.c (read_ofile_symtab): Install Jim Wilson's
authorStu Grossman <grossman@cygnus>
Fri, 25 Sep 1992 22:59:27 +0000 (22:59 +0000)
committerStu Grossman <grossman@cygnus>
Fri, 25 Sep 1992 22:59:27 +0000 (22:59 +0000)
fix to differentiate between gcc1 & gcc2 compiled files so that we
can debug calls that pass structs as args correctly.
* symmisc.c (dump_symtab):  If block was compiled with gcc, say
so, and what version.

gdb/ChangeLog
gdb/dbxread.c
gdb/tm-sparc.h

index f6518b90b236129872fe5355eeb84bba8dbe34ba..d21de67bfed0575630c8d80a52378f702da3ce28 100644 (file)
@@ -1,5 +1,11 @@
 Fri Sep 25 15:13:44 1992  Stu Grossman  (grossman at cygnus.com)
 
+       * tm-sparc.h, dbxread.c (read_ofile_symtab):  Install Jim Wilson's
+       fix to differentiate between gcc1 & gcc2 compiled files so that we
+       can debug calls that pass structs as args correctly.
+       * symmisc.c (dump_symtab):  If block was compiled with gcc, say
+       so, and what version.
+
        * remote.c (remote_wait):  Make regs be char to avoid picayune
        ANSI compiler warnings.
 
index b97e50c30602676448a19a5713f1bbbb3a9d6b29..c14d865341e62ee8dd9da0447df066c008039d88 100644 (file)
@@ -1468,10 +1468,14 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
 
       SET_NAMESTRING ();
 
-      processing_gcc_compilation =
-       (bufp->n_type == N_TEXT
-        && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0
-            || strcmp(namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0));
+      processing_gcc_compilation = 0;
+      if (bufp->n_type == N_TEXT)
+       {
+         if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0)
+           processing_gcc_compilation = 1;
+         else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)
+           processing_gcc_compilation = 2;
+       }
 
       /* Try to select a C++ demangling based on the compilation unit
         producer. */
@@ -1479,7 +1483,7 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
       if (processing_gcc_compilation)
        {
 #if 1    /* Works, but is experimental.  -fnf */
-         if (current_demangling_style == auto_demangling)
+         if (AUTO_DEMANGLING)
            {
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
@@ -1523,18 +1527,22 @@ read_ofile_symtab (objfile, sym_offset, sym_size, text_offset, text_size,
       }
       /* We skip checking for a new .o or -l file; that should never
          happen in this routine. */
-      else if (type == N_TEXT
-              && (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0
-                  || strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0))
+      else if (type == N_TEXT)
        {
          /* I don't think this code will ever be executed, because
             the GCC_COMPILED_FLAG_SYMBOL usually is right before
             the N_SO symbol which starts this source file.
             However, there is no reason not to accept
             the GCC_COMPILED_FLAG_SYMBOL anywhere.  */
-         processing_gcc_compilation = 1;
+
+         processing_gcc_compilation = 0;
+         if (strcmp (namestring, GCC_COMPILED_FLAG_SYMBOL) == 0)
+           processing_gcc_compilation = 1;
+         else if (strcmp (namestring, GCC2_COMPILED_FLAG_SYMBOL) == 0)
+           processing_gcc_compilation = 2;
+
 #if 1    /* Works, but is experimental.  -fnf */
-         if (current_demangling_style == auto_demangling)
+         if (AUTO_DEMANGLING)
            {
              set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
            }
@@ -1958,11 +1966,11 @@ process_one_symbol (type, desc, valu, name, section_offsets, objfile)
     case N_OPT:                        /* Solaris 2:  Compiler options */
       if (name)
        {
-         if (!strcmp (name, GCC2_COMPILED_FLAG_SYMBOL))
+         if (strcmp (name, GCC2_COMPILED_FLAG_SYMBOL) == 0)
            {
-             processing_gcc_compilation = 1;
+             processing_gcc_compilation = 2;
 #if 1        /* Works, but is experimental.  -fnf */
-             if (current_demangling_style == auto_demangling)
+             if (AUTO_DEMANGLING)
                {
                  set_demangling_style (GNU_DEMANGLING_STYLE_STRING);
                }
@@ -2045,16 +2053,16 @@ copy_pending (beg, begi, end)
    adjusted for elf details. */
 
 void
-DEFUN(elfstab_build_psymtabs, (objfile, section_offsets, mainline, 
+elfstab_build_psymtabs (objfile, section_offsets, mainline, 
                               staboffset, stabsize,
-                              stabstroffset, stabstrsize),
-      struct objfile *objfile AND
-      struct section_offsets *section_offsets AND
-      int mainline AND
-      unsigned int staboffset AND
-      unsigned int stabsize AND
-      unsigned int stabstroffset AND
-      unsigned int stabstrsize)
+                              stabstroffset, stabstrsize)
+      struct objfile *objfile;
+      struct section_offsets *section_offsets;
+      int mainline;
+      unsigned int staboffset;
+      unsigned int stabsize;
+      unsigned int stabstroffset;
+      unsigned int stabstrsize;
 {
   int val;
   bfd *sym_bfd = objfile->obfd;
index 8e06165ca474a96b9d019ff2a402f4eb0141cd37..25fc6d3314097ef48e2aca51f525262fb8b29d48 100644 (file)
@@ -30,13 +30,13 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.  */
    (a lie, and a serious one since we don't know which register to
    use), and a LOC_REGISTER saying that the struct is in a register
    (sort of a lie, but fixable with REG_STRUCT_HAS_ADDR).  Gcc version
-   two (as of 1.92) behaves like sun cc, but I don't know how we can
-   distinguish between gcc version 1 and gcc version 2.
+   two (as of 1.92) behaves like sun cc.  REG_STRUCT_HAS_ADDR is smart
+   enough to distinguish between Sun cc, gcc version 1 and gcc version 2.
 
    This still doesn't work if the argument is not one passed in a
    register (i.e. it's the 7th or later argument).  */
-#define REG_STRUCT_HAS_ADDR(gcc_p) (!(gcc_p))
-#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (!(gcc_p))
+#define REG_STRUCT_HAS_ADDR(gcc_p) (gcc_p != 1)
+#define STRUCT_ARG_SYM_GARBAGE(gcc_p) (gcc_p != 1)
 
 /* If Pcc says that a parameter is a short, it's a short.  This is
    because the parameter does get passed in in a register as an int,
This page took 0.0409350000000001 seconds and 4 git commands to generate.