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

Daniel Jacobowitz drow@mvista.com
Mon Jun 3 16:41:00 GMT 2002


On Mon, Jun 03, 2002 at 04:25:27PM -0700, H . J . Lu wrote:
> On Mon, Jun 03, 2002 at 03:37:16PM -0700, H . J . Lu wrote:
> > On Tue, Jun 04, 2002 at 12:32:46AM +0200, Jakub Jelinek wrote:
> > > On Mon, Jun 03, 2002 at 11:57:03AM -0700, H . J . Lu wrote:
> > > > On Mon, Jun 03, 2002 at 10:41:31AM -0700, H . J . Lu wrote:
> > > > > 
> > > > > Jakub, I believe your patch
> > > > > 
> > > > > http://sources.redhat.com/ml/binutils/2001-11/msg00580.html
> > > > > 
> > > > > breaks ELF/MIPS since it didn't modify ELF/MIPS to support relocating
> > > > > STT_SECTION sym in SHF_MERGE section. As the result, the ELF/MIPS
> > > > > linker generates incorrect debug information. Could you please look
> > > > > into it?
> > > > > 
> > > > > BTW, I don't know if ELF/MIPS is the only broken target.
> > > > > 
> > > > > Thanks.
> > > > > 
> > > > > 
> > > > 
> > > > This patch makes gdb 5.2 happy. However, I have no ideas if it is
> > > > correct. Could someone please take a look?
> > > 
> > > If looks fine to me, if it works, I'm all for it.
> > > 
> > 
> > I was wrong to say gdb 5.2 was happy. It didn't complain now. But
> > I still can't debug Linux/mipsel binaries compled with gcc 3.1.1.
> > 
> > 
> 
> 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).
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.

> 2002-01-12  H.J. Lu <hjl@gnu.org>
> 
> 	* config/mips/linux.h (PREFERRED_DEBUGGING_TYPE): Set to
> 	DBX_DEBUG.
> 
> --- gcc/config/mips/linux.h.stabs	Fri Jan 11 09:30:08 2002
> +++ gcc/config/mips/linux.h	Sat Jan 12 10:50:10 2002
> @@ -289,3 +289,7 @@ void FN ()							\
>     it.  */
>  #undef ASM_OUTPUT_REG_PUSH
>  #undef ASM_OUTPUT_REG_POP
> +
> +/* Use stabs instead of DWARF debug format.  */
> +#undef PREFERRED_DEBUGGING_TYPE
> +#define PREFERRED_DEBUGGING_TYPE DBX_DEBUG


-- 
Daniel Jacobowitz                           Carnegie Mellon University
MontaVista Software                         Debian GNU/Linux Developer



More information about the Gdb mailing list