This is the mail archive of the gdb@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]

Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)


On Mon, Jun 03, 2002 at 07:40:58PM -0400, Daniel Jacobowitz wrote:
> > 
> > It turned out gas doesn't support dwarf debug info for Linux/mipsel
> > at all. ".file" and ".loc" don't do much for dwarf. Since no much
> > has been done for dwarf on Linux/mipsel, I am submitting this
> > patch to use stabs instead of DWARF on Linux/mipsel.
> 
> Please don't.  I'd rather turn off COFF debugging for Linux/mipsel,
> which I suggested the last time this came up (about a year ago).

COFF is OFF in binutils for Linux/mips. I even checked in a gcc patch
to disable COFF for Linux/mips.

> There's no good reason it won't work if we hook the DWARF-2 handlers up
> instead of the COFF ones - probably should tie that to MIPS_STAB_ELF.
> 

I tried a dirty, quick change enclosed. I still can't use gdb 5.2 to
debug gcc 3.1.1 on Linux/mipsel. I don't think it is a good idea to
make gcc 3.1.1 generate unusable debug info by default.. 


H.J.
----
--- gas/config/tc-mips.c.dwarf	Sat May 25 17:39:36 2002
+++ gas/config/tc-mips.c	Mon Jun  3 16:15:46 2002
@@ -80,6 +80,7 @@ static int mips_output_flavor () { retur
 
 #if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
 static char *mips_regmask_frag;
+#include "dwarf2dbg.h"
 #endif
 
 #define AT  1
@@ -885,7 +886,11 @@ static const pseudo_typeS mips_nonecoff_
   {"file", s_file, 0},
   {"fmask", s_mips_mask, 'F'},
   {"frame", s_mips_frame, 0},
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
+  {"loc", dwarf2_directive_loc, 0},
+#else
   {"loc", s_ignore, 0},
+#endif
   {"mask", s_mips_mask, 'R'},
   {"verstamp", s_ignore, 0},
   { NULL, NULL, 0 },
@@ -13041,8 +13046,24 @@ static void
 s_file (x)
      int x ATTRIBUTE_UNUSED;
 {
+#if defined (OBJ_ELF) || defined (OBJ_MAYBE_ELF)
+  static int first_file_directive;
+
+  /* Save the first .file directive we see, so that we can change our
+     minds about whether dwarf debugging should or shouldn't be
+     enabled.  */
+  if (! first_file_directive)
+    {
+      first_file_directive = 1;
+      get_number ();
+      s_app_file (0);
+    }
+  else
+    dwarf2_directive_file (0);
+#else
   get_number ();
   s_app_file (0);
+#endif
 }
 
 /* The .end directive.  */


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