From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 30324 invoked by alias); 3 Jun 2002 23:51:10 -0000 Mailing-List: contact gdb-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sources.redhat.com Received: (qmail 30261 invoked from network); 3 Jun 2002 23:51:06 -0000 Received: from unknown (HELO sccrmhc03.attbi.com) (204.127.202.63) by sources.redhat.com with SMTP; 3 Jun 2002 23:51:06 -0000 Received: from ocean.lucon.org ([12.234.143.38]) by sccrmhc03.attbi.com (InterMail vM.4.01.03.27 201-229-121-127-20010626) with ESMTP id <20020603235102.VKAT20219.sccrmhc03.attbi.com@ocean.lucon.org>; Mon, 3 Jun 2002 23:51:02 +0000 Received: by ocean.lucon.org (Postfix, from userid 1000) id AA400125BB; Mon, 3 Jun 2002 16:51:01 -0700 (PDT) Date: Mon, 03 Jun 2002 16:51:00 -0000 From: "H . J . Lu" To: Jakub Jelinek , echristo@redhat.com, binutils@sources.redhat.com, GDB , gcc-patches@gcc.gnu.org Subject: Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS) Message-ID: <20020603165101.A2466@lucon.org> References: <20020602230331.A18107@lucon.org> <20020602231016.A18236@lucon.org> <20020603141808.GA24114@branoic.them.org> <20020603092959.A27426@lucon.org> <20020603104131.A28590@lucon.org> <20020603115703.A29881@lucon.org> <20020604003246.C20867@sunsite.ms.mff.cuni.cz> <20020603153716.A1294@lucon.org> <20020603162527.A2073@lucon.org> <20020603234058.GA2262@branoic.them.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <20020603234058.GA2262@branoic.them.org>; from drow@mvista.com on Mon, Jun 03, 2002 at 07:40:58PM -0400 X-SW-Source: 2002-06/txt/msg00032.txt.bz2 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. */