Mirror of the gdb mailing list
 help / color / mirror / Atom feed
* Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
@ 2002-06-02 14:36 H . J . Lu
  2002-06-02 18:00 ` Daniel Jacobowitz
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 14:36 UTC (permalink / raw)
  To: GDB, gcc

When I tried to debug gcc 3.1.1 on Linux/mips, I got

# gdb xgcc
GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
...
DW_FORM_strp pointing outside of .debug_str section

gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
5.2 with gcc 3.1/3.2 running on any mips targets?


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 14:36 Does gdb 5.2 support gcc 3.1.1 on Linux/mips? H . J . Lu
@ 2002-06-02 18:00 ` Daniel Jacobowitz
  2002-06-02 19:43   ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-02 18:00 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB, gcc

On Sun, Jun 02, 2002 at 02:36:27PM -0700, H . J . Lu wrote:
> When I tried to debug gcc 3.1.1 on Linux/mips, I got
> 
> # gdb xgcc
> GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> ...
> DW_FORM_strp pointing outside of .debug_str section
> 
> gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> 5.2 with gcc 3.1/3.2 running on any mips targets?

My memory is hazy, but I believe this was a linker bug.  Are you using
a current version of ld?

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 18:00 ` Daniel Jacobowitz
@ 2002-06-02 19:43   ` H . J . Lu
  2002-06-02 22:01     ` Daniel Jacobowitz
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 19:43 UTC (permalink / raw)
  To: GDB, gcc

On Sun, Jun 02, 2002 at 09:00:03PM -0400, Daniel Jacobowitz wrote:
> On Sun, Jun 02, 2002 at 02:36:27PM -0700, H . J . Lu wrote:
> > When I tried to debug gcc 3.1.1 on Linux/mips, I got
> > 
> > # gdb xgcc
> > GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> > ...
> > DW_FORM_strp pointing outside of .debug_str section
> > 
> > gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> > 5.2 with gcc 3.1/3.2 running on any mips targets?
> 
> My memory is hazy, but I believe this was a linker bug.  Are you using
> a current version of ld?
> 

Yes.


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 19:43   ` H . J . Lu
@ 2002-06-02 22:01     ` Daniel Jacobowitz
  2002-06-02 22:05       ` H . J . Lu
  2002-06-02 23:30       ` Does gdb 5.2 support gcc 3.1.1 on Linux/mips? Jakub Jelinek
  0 siblings, 2 replies; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-02 22:01 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB, gcc

On Sun, Jun 02, 2002 at 07:43:26PM -0700, H . J . Lu wrote:
> On Sun, Jun 02, 2002 at 09:00:03PM -0400, Daniel Jacobowitz wrote:
> > On Sun, Jun 02, 2002 at 02:36:27PM -0700, H . J . Lu wrote:
> > > When I tried to debug gcc 3.1.1 on Linux/mips, I got
> > > 
> > > # gdb xgcc
> > > GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> > > ...
> > > DW_FORM_strp pointing outside of .debug_str section
> > > 
> > > gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> > > 5.2 with gcc 3.1/3.2 running on any mips targets?
> > 
> > My memory is hazy, but I believe this was a linker bug.  Are you using
> > a current version of ld?
> > 
> 
> Yes.

Then could you check if the produced binary is incorrect?  That error
usually indicates linker error.

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 22:01     ` Daniel Jacobowitz
@ 2002-06-02 22:05       ` H . J . Lu
  2002-06-02 22:09         ` Daniel Jacobowitz
  2002-06-02 23:30       ` Does gdb 5.2 support gcc 3.1.1 on Linux/mips? Jakub Jelinek
  1 sibling, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 22:05 UTC (permalink / raw)
  To: GDB, gcc

On Mon, Jun 03, 2002 at 01:01:01AM -0400, Daniel Jacobowitz wrote:
> On Sun, Jun 02, 2002 at 07:43:26PM -0700, H . J . Lu wrote:
> > On Sun, Jun 02, 2002 at 09:00:03PM -0400, Daniel Jacobowitz wrote:
> > > On Sun, Jun 02, 2002 at 02:36:27PM -0700, H . J . Lu wrote:
> > > > When I tried to debug gcc 3.1.1 on Linux/mips, I got
> > > > 
> > > > # gdb xgcc
> > > > GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> > > > ...
> > > > DW_FORM_strp pointing outside of .debug_str section
> > > > 
> > > > gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> > > > 5.2 with gcc 3.1/3.2 running on any mips targets?
> > > 
> > > My memory is hazy, but I believe this was a linker bug.  Are you using
> > > a current version of ld?
> > > 
> > 
> > Yes.
> 
> Then could you check if the produced binary is incorrect?  That error
> usually indicates linker error.

Did you imply gdb 5.2 worked fine for you with gcc 3.1.1 running on
your mips platform? My Linux/mipsel gcc 3.1.1 seems to work ok
otherwise:

http://gcc.gnu.org/ml/gcc-testresults/2002-06/msg00069.html


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 22:05       ` H . J . Lu
@ 2002-06-02 22:09         ` Daniel Jacobowitz
  2002-06-02 22:42           ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-02 22:09 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB, gcc

On Sun, Jun 02, 2002 at 10:05:34PM -0700, H . J . Lu wrote:
> On Mon, Jun 03, 2002 at 01:01:01AM -0400, Daniel Jacobowitz wrote:
> > On Sun, Jun 02, 2002 at 07:43:26PM -0700, H . J . Lu wrote:
> > > On Sun, Jun 02, 2002 at 09:00:03PM -0400, Daniel Jacobowitz wrote:
> > > > On Sun, Jun 02, 2002 at 02:36:27PM -0700, H . J . Lu wrote:
> > > > > When I tried to debug gcc 3.1.1 on Linux/mips, I got
> > > > > 
> > > > > # gdb xgcc
> > > > > GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> > > > > ...
> > > > > DW_FORM_strp pointing outside of .debug_str section
> > > > > 
> > > > > gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> > > > > 5.2 with gcc 3.1/3.2 running on any mips targets?
> > > > 
> > > > My memory is hazy, but I believe this was a linker bug.  Are you using
> > > > a current version of ld?
> > > > 
> > > 
> > > Yes.
> > 
> > Then could you check if the produced binary is incorrect?  That error
> > usually indicates linker error.
> 
> Did you imply gdb 5.2 worked fine for you with gcc 3.1.1 running on
> your mips platform? My Linux/mipsel gcc 3.1.1 seems to work ok
> otherwise:
> 
> http://gcc.gnu.org/ml/gcc-testresults/2002-06/msg00069.html

I haven't tried it in a while, but 3.1 snapshots worked fine with 5.2
release, yes.

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 22:09         ` Daniel Jacobowitz
@ 2002-06-02 22:42           ` H . J . Lu
  2002-06-02 23:03             ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 22:42 UTC (permalink / raw)
  To: GDB, gcc

[-- Attachment #1: Type: text/plain, Size: 1131 bytes --]

On Mon, Jun 03, 2002 at 01:09:06AM -0400, Daniel Jacobowitz wrote:
> > > 
> > > Then could you check if the produced binary is incorrect?  That error
> > > usually indicates linker error.
> > 
> > Did you imply gdb 5.2 worked fine for you with gcc 3.1.1 running on
> > your mips platform? My Linux/mipsel gcc 3.1.1 seems to work ok
> > otherwise:
> > 
> > http://gcc.gnu.org/ml/gcc-testresults/2002-06/msg00069.html
> 
> I haven't tried it in a while, but 3.1 snapshots worked fine with 5.2
> release, yes.
> 

I doubt it is a linker bug. I have a simple C file. I cross compiled
it to Linux/mipsel on Linux/x86 with gcc 3.1.1. I got

# gcc -g ~/tmp/s.c -o ~/tmp/s
# gcc -g ~/tmp/s.c -o ~/tmp/s.o -c
# readelf -dw ~/tmp/s.o > /dev/null
unsupported or unknown DW_CFA_17
# readelf -dw ~/tmp/s.o > /dev/null
unsupported or unknown DW_CFA_17
# gdb ~/tmp/s
...
DW_FORM_strp pointing outside of .debug_str section

It looks like a gcc/gas bug to me. Can you tell me what you get with
your gdb and readelf on the enclosed s.o and s as well as what you get
with s and s.o compiled from s.c with your gcc 3.1 mips compiler?

Thanks.


H.J.

[-- Attachment #2: s --]
[-- Type: application/octet-stream, Size: 15668 bytes --]

[-- Attachment #3: s.o --]
[-- Type: application/octet-stream, Size: 11612 bytes --]

[-- Attachment #4: s.c --]
[-- Type: text/plain, Size: 60 bytes --]

#include <stdio.h>

main ()
{
  printf ("hello world\n");
}

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 22:42           ` H . J . Lu
@ 2002-06-02 23:03             ` H . J . Lu
  2002-06-02 23:10               ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 23:03 UTC (permalink / raw)
  To: GDB, gcc; +Cc: binutils

On Sun, Jun 02, 2002 at 10:42:40PM -0700, H . J . Lu wrote:
> On Mon, Jun 03, 2002 at 01:09:06AM -0400, Daniel Jacobowitz wrote:
> > > > 
> > > > Then could you check if the produced binary is incorrect?  That error
> > > > usually indicates linker error.
> > > 
> > > Did you imply gdb 5.2 worked fine for you with gcc 3.1.1 running on
> > > your mips platform? My Linux/mipsel gcc 3.1.1 seems to work ok
> > > otherwise:
> > > 
> > > http://gcc.gnu.org/ml/gcc-testresults/2002-06/msg00069.html
> > 
> > I haven't tried it in a while, but 3.1 snapshots worked fine with 5.2
> > release, yes.
> > 
> 
> I doubt it is a linker bug. I have a simple C file. I cross compiled
> it to Linux/mipsel on Linux/x86 with gcc 3.1.1. I got
> 
> # gcc -g ~/tmp/s.c -o ~/tmp/s
> # gcc -g ~/tmp/s.c -o ~/tmp/s.o -c
> # readelf -dw ~/tmp/s.o > /dev/null
> unsupported or unknown DW_CFA_17
> # readelf -dw ~/tmp/s.o > /dev/null
> unsupported or unknown DW_CFA_17
> # gdb ~/tmp/s
> ...
> DW_FORM_strp pointing outside of .debug_str section
> 
> It looks like a gcc/gas bug to me. Can you tell me what you get with
> your gdb and readelf on the enclosed s.o and s as well as what you get
> with s and s.o compiled from s.c with your gcc 3.1 mips compiler?

DW_CFA_17 is DW_CFA_offset_extended_sf, which was added to gcc on
2002-01-30. I have verifed that gcc 3.1.1 does generate it for mips.
It looks like we have at least 2 bugs. First, readelf doesn't handle
DW_CFA_offset_extended_sf and maybe other DAWRF debug info generated
by gcc 3.1.1. Secondly, gdb 5.2 doesn't work with gcc 3.1.1 for
Linux/mips.


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 23:03             ` H . J . Lu
@ 2002-06-02 23:10               ` H . J . Lu
  2002-06-03  4:22                 ` Daniel Berlin
  2002-06-03  7:18                 ` Daniel Jacobowitz
  0 siblings, 2 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-02 23:10 UTC (permalink / raw)
  To: GDB, gcc; +Cc: binutils

On Sun, Jun 02, 2002 at 11:03:31PM -0700, H . J . Lu wrote:
> 
> DW_CFA_17 is DW_CFA_offset_extended_sf, which was added to gcc on
> 2002-01-30. I have verifed that gcc 3.1.1 does generate it for mips.
> It looks like we have at least 2 bugs. First, readelf doesn't handle
> DW_CFA_offset_extended_sf and maybe other DAWRF debug info generated
> by gcc 3.1.1. Secondly, gdb 5.2 doesn't work with gcc 3.1.1 for
> Linux/mips.

dwarf2cfi.c in gdb 5.2 seems to support DW_CFA_offset_extended_sf. But
that file is not used anywhere, at least not for Linux/x86 nor
Linux/mips. Did I miss something? Shouldn't we fix gdb 5.2 and
binutils for gcc 3.1.1?


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 22:01     ` Daniel Jacobowitz
  2002-06-02 22:05       ` H . J . Lu
@ 2002-06-02 23:30       ` Jakub Jelinek
  1 sibling, 0 replies; 29+ messages in thread
From: Jakub Jelinek @ 2002-06-02 23:30 UTC (permalink / raw)
  To: H . J . Lu, GDB, gcc

On Mon, Jun 03, 2002 at 01:01:01AM -0400, Daniel Jacobowitz wrote:
> > > > # gdb xgcc
> > > > GNU gdb 5.2-0.5 (5.2.0_2002-05-23-cvs)
> > > > ...
> > > > DW_FORM_strp pointing outside of .debug_str section
> > > > 
> > > > gdb 5.2 works fine on Linux/x86 with gcc 3.1.1. Has anyone tried gdb
> > > > 5.2 with gcc 3.1/3.2 running on any mips targets?
> > > 
> > > My memory is hazy, but I believe this was a linker bug.  Are you using
> > > a current version of ld?
> > > 
> > 
> > Yes.
> 
> Then could you check if the produced binary is incorrect?  That error
> usually indicates linker error.

So far always when I saw this it was because of running gcc -S -g and then
running gcc -g on the resulting .s file (as --dwarf2 was passed to the
assembler, thus it basically had double debug info).

	Jakub


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 23:10               ` H . J . Lu
@ 2002-06-03  4:22                 ` Daniel Berlin
  2002-06-03  7:18                 ` Daniel Jacobowitz
  1 sibling, 0 replies; 29+ messages in thread
From: Daniel Berlin @ 2002-06-03  4:22 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB, gcc, binutils

On Sun, 2 Jun 2002, H . J . Lu wrote:

> On Sun, Jun 02, 2002 at 11:03:31PM -0700, H . J . Lu wrote:
> > 
> > DW_CFA_17 is DW_CFA_offset_extended_sf, which was added to gcc on
> > 2002-01-30. I have verifed that gcc 3.1.1 does generate it for mips.
> > It looks like we have at least 2 bugs. First, readelf doesn't handle
> > DW_CFA_offset_extended_sf and maybe other DAWRF debug info generated
> > by gcc 3.1.1. Secondly, gdb 5.2 doesn't work with gcc 3.1.1 for
> > Linux/mips.
> 
> dwarf2cfi.c in gdb 5.2 seems to support DW_CFA_offset_extended_sf. But
> that file is not used anywhere, at least not for Linux/x86 nor
> Linux/mips. Did I miss something?
It's only used by x86-64 at present.  I mentioned how to get other 
platforms to support dwarf2 frame unwinding in a thread last week, forget 
the subject line however.

 Shouldn't we fix gdb 5.2 and > binutils for gcc 
3.1.1? > 
> 
> H.J.
> 


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?
  2002-06-02 23:10               ` H . J . Lu
  2002-06-03  4:22                 ` Daniel Berlin
@ 2002-06-03  7:18                 ` Daniel Jacobowitz
  2002-06-03  8:55                   ` DW_CFA_def_cfa_offset_sf bug? (Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?) H . J . Lu
       [not found]                   ` <20020603092959.A27426@lucon.org>
  1 sibling, 2 replies; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-03  7:18 UTC (permalink / raw)
  To: H . J . Lu; +Cc: GDB, gcc, binutils

On Sun, Jun 02, 2002 at 11:10:16PM -0700, H . J . Lu wrote:
> On Sun, Jun 02, 2002 at 11:03:31PM -0700, H . J . Lu wrote:
> > 
> > DW_CFA_17 is DW_CFA_offset_extended_sf, which was added to gcc on
> > 2002-01-30. I have verifed that gcc 3.1.1 does generate it for mips.
> > It looks like we have at least 2 bugs. First, readelf doesn't handle
> > DW_CFA_offset_extended_sf and maybe other DAWRF debug info generated
> > by gcc 3.1.1. Secondly, gdb 5.2 doesn't work with gcc 3.1.1 for
> > Linux/mips.
> 
> dwarf2cfi.c in gdb 5.2 seems to support DW_CFA_offset_extended_sf. But
> that file is not used anywhere, at least not for Linux/x86 nor
> Linux/mips. Did I miss something? Shouldn't we fix gdb 5.2 and
> binutils for gcc 3.1.1?

GDB doesn't need the CFA info on MIPS (although I'll try soon to let
GDB use it).  Is that really what's making GDB choke?  Have you looked
at Jakub's suggestion about gas and -gdwarf-2?

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* DW_CFA_def_cfa_offset_sf bug? (Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?)
  2002-06-03  7:18                 ` Daniel Jacobowitz
@ 2002-06-03  8:55                   ` H . J . Lu
       [not found]                   ` <20020603092959.A27426@lucon.org>
  1 sibling, 0 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-03  8:55 UTC (permalink / raw)
  To: GDB, binutils

On Mon, Jun 03, 2002 at 10:18:10AM -0400, Daniel Jacobowitz wrote:
> On Sun, Jun 02, 2002 at 11:10:16PM -0700, H . J . Lu wrote:
> > On Sun, Jun 02, 2002 at 11:03:31PM -0700, H . J . Lu wrote:
> > > 
> > > DW_CFA_17 is DW_CFA_offset_extended_sf, which was added to gcc on
> > > 2002-01-30. I have verifed that gcc 3.1.1 does generate it for mips.
> > > It looks like we have at least 2 bugs. First, readelf doesn't handle
> > > DW_CFA_offset_extended_sf and maybe other DAWRF debug info generated
> > > by gcc 3.1.1. Secondly, gdb 5.2 doesn't work with gcc 3.1.1 for
> > > Linux/mips.
> > 
> > dwarf2cfi.c in gdb 5.2 seems to support DW_CFA_offset_extended_sf. But
> > that file is not used anywhere, at least not for Linux/x86 nor
> > Linux/mips. Did I miss something? Shouldn't we fix gdb 5.2 and
> > binutils for gcc 3.1.1?
> 
> GDB doesn't need the CFA info on MIPS (although I'll try soon to let
> GDB use it).  Is that really what's making GDB choke?  Have you looked
> at Jakub's suggestion about gas and -gdwarf-2?
> 

It has nothing to do with gas and -gdwarf-2. I used "gcc -c". I am
trying to fix readelf first. While working on DW_CFA_def_cfa_offset_sf,
I found:

          case DW_CFA_def_cfa_offset_sf:
            uoffset = read_uleb128 (objfile->obfd, &insn_ptr);
		      ^^^^^^^^^^^^
            fs->cfa_offset = uoffset;
            /* cfa_how deliberately not set.  */
            break;

in dwarf2cfi.c in gdb 5.2. Shouldn't that be

          case DW_CFA_def_cfa_offset_sf:
            offset = read_sleb128 (objfile->obfd, &insn_ptr);
		     ^^^^^^^^^^^^
            fs->cfa_offset = offset;
            /* cfa_how deliberately not set.  */
            break;



H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
       [not found]                           ` <20020603153716.A1294@lucon.org>
@ 2002-06-03 16:25                             ` H . J . Lu
  2002-06-03 16:41                               ` Daniel Jacobowitz
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 16:25 UTC (permalink / raw)
  To: Jakub Jelinek, echristo; +Cc: binutils, GDB, gcc-patches

[-- Attachment #1: Type: text/plain, Size: 1343 bytes --]

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.



H.J.

[-- Attachment #2: gcc-mips-stabs.patch --]
[-- Type: text/plain, Size: 452 bytes --]

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

^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 16:25                             ` PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS) H . J . Lu
@ 2002-06-03 16:41                               ` Daniel Jacobowitz
  2002-06-03 16:51                                 ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-03 16:41 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Jakub Jelinek, echristo, binutils, GDB, gcc-patches

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 16:41                               ` Daniel Jacobowitz
@ 2002-06-03 16:51                                 ` H . J . Lu
  2002-06-03 17:43                                   ` Richard Henderson
  2002-06-03 17:50                                   ` Eric Christopher
  0 siblings, 2 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 16:51 UTC (permalink / raw)
  To: Jakub Jelinek, echristo, binutils, GDB, gcc-patches

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.  */


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 16:51                                 ` H . J . Lu
@ 2002-06-03 17:43                                   ` Richard Henderson
  2002-06-03 19:52                                     ` Doug Evans
  2002-06-03 17:50                                   ` Eric Christopher
  1 sibling, 1 reply; 29+ messages in thread
From: Richard Henderson @ 2002-06-03 17:43 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Jakub Jelinek, echristo, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 04:51:01PM -0700, H . J . Lu 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.

These directives aren't required for proper operation.
If they're not present, then gcc will emit the data itself
with labels and offsets.

If there are any remaining binutils bugs, then they should
be fixed in binutils.  We can require a later binutils 
release for Linux/mipsel.


r~


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 16:51                                 ` H . J . Lu
  2002-06-03 17:43                                   ` Richard Henderson
@ 2002-06-03 17:50                                   ` Eric Christopher
  2002-06-03 18:03                                     ` H . J . Lu
  1 sibling, 1 reply; 29+ messages in thread
From: Eric Christopher @ 2002-06-03 17:50 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Jakub Jelinek, binutils, GDB, gcc-patches


> 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.. 
> 

Definitely not a huge fan of that patch. I have another one from Matt
Green (attached) that I'm not ecstatic about either, but also seems to
work. The correct answer is to make dwarf-2 work under mips. It may
require some reworking though.

-eric

-- 
I will not carve gods

        * config/obj-elf.h (ECOFF_DEBUGGING): Define as a tested of
        debug_type being DEBUG_ECOFF, in the non MIPS_STABS_ELF case.
        * config/tc-mips.c (mips_nonecoff_pseudo_table): Point "file" at
        s_mips_file() and "loc" at s_mips_loc().
        (s_file): Delete.
        (s_mips_file, s_mips_loc): New functions for ".file" and ".loc"
support.


Index: gas/config/obj-elf.h
===================================================================
RCS file: /cvs/src/src/gas/config/obj-elf.h,v
retrieving revision 1.15
diff -p -r1.15 obj-elf.h
*** gas/config/obj-elf.h        8 Aug 2001 13:11:58 -0000       1.15
--- gas/config/obj-elf.h        28 May 2002 18:08:22 -0000
*************** extern int alpha_flag_mdebug;
*** 51,57 ****
  #ifdef MIPS_STABS_ELF
  #define ECOFF_DEBUGGING 0
  #else
! #define ECOFF_DEBUGGING 1
  #endif /* MIPS_STABS_ELF */
  #endif /* TC_MIPS */
  
--- 51,57 ----
  #ifdef MIPS_STABS_ELF
  #define ECOFF_DEBUGGING 0
  #else
! #define ECOFF_DEBUGGING (debug_type == DEBUG_ECOFF)
  #endif /* MIPS_STABS_ELF */
  #endif /* TC_MIPS */
  
Index: gas/config/tc-mips.c
===================================================================
RCS file: /cvs/src/src/gas/config/tc-mips.c,v
retrieving revision 1.115
diff -p -r1.115 tc-mips.c
*** gas/config/tc-mips.c        4 Apr 2002 07:43:11 -0000       1.115
--- gas/config/tc-mips.c        28 May 2002 18:08:54 -0000
*************** static void s_mips_frame PARAMS ((int));
*** 749,755 ****
  static void s_mips_mask PARAMS ((int));
  static void s_mips_stab PARAMS ((int));
  static void s_mips_weakext PARAMS ((int));
! static void s_file PARAMS ((int));
  static int mips16_extended_frag PARAMS ((fragS *, asection *, long));
  static const char *mips_isa_to_str PARAMS ((int));
  static const char *mips_cpu_to_str PARAMS ((int));
--- 749,756 ----
  static void s_mips_mask PARAMS ((int));
  static void s_mips_stab PARAMS ((int));
  static void s_mips_weakext PARAMS ((int));
! static void s_mips_file PARAMS ((int));
! static void s_mips_loc PARAMS ((int));
  static int mips16_extended_frag PARAMS ((fragS *, asection *, long));
  static const char *mips_isa_to_str PARAMS ((int));
  static const char *mips_cpu_to_str PARAMS ((int));
*************** static const pseudo_typeS mips_nonecoff_
*** 882,891 ****
    {"end", s_mips_end, 0},
    {"endb", s_ignore, 0},
    {"ent", s_mips_ent, 0},
!   {"file", s_file, 0},
    {"fmask", s_mips_mask, 'F'},
    {"frame", s_mips_frame, 0},
!   {"loc", s_ignore, 0},
    {"mask", s_mips_mask, 'R'},
    {"verstamp", s_ignore, 0},
    { NULL, NULL, 0 },
--- 883,892 ----
    {"end", s_mips_end, 0},
    {"endb", s_ignore, 0},
    {"ent", s_mips_ent, 0},
!   {"file", s_mips_file, 0},
    {"fmask", s_mips_mask, 'F'},
    {"frame", s_mips_frame, 0},
!   {"loc", s_mips_loc, 0},
    {"mask", s_mips_mask, 'R'},
    {"verstamp", s_ignore, 0},
    { NULL, NULL, 0 },
*************** get_number ()
*** 12938,12948 ****
     is an initial number which is the ECOFF file index.  */
  
  static void
! s_file (x)
       int x ATTRIBUTE_UNUSED;
  {
!   get_number ();
!   s_app_file (0);
  }
  
  /* The .end directive.  */
--- 12939,12968 ----
     is an initial number which is the ECOFF file index.  */
  
  static void
! s_mips_file (x)
       int x ATTRIBUTE_UNUSED;
  {
!   if (ECOFF_DEBUGGING)
!     {
!       get_number ();
!       s_app_file (0);
!     }
!   else if (debug_type == DEBUG_DWARF2)
!     {
!       dwarf2_directive_file (0);
!     }
! }
! 
! /* The .loc directive, ignored for everything but DWARF2.  */
! 
! static void
! s_mips_loc (x)
!      int x ATTRIBUTE_UNUSED;
! {
!   if (debug_type == DEBUG_DWARF2)
!     {
!       dwarf2_directive_loc (0);
!     }
  }
  
  /* The .end directive.  */


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 17:50                                   ` Eric Christopher
@ 2002-06-03 18:03                                     ` H . J . Lu
  2002-06-03 18:29                                       ` Eric Christopher
  2002-06-03 18:40                                       ` Daniel Jacobowitz
  0 siblings, 2 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 18:03 UTC (permalink / raw)
  To: Eric Christopher; +Cc: Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 05:48:14PM -0700, Eric Christopher wrote:
> 
> > 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.. 
> > 
> 
> Definitely not a huge fan of that patch. I have another one from Matt
> Green (attached) that I'm not ecstatic about either, but also seems to
> work. The correct answer is to make dwarf-2 work under mips. It may
> require some reworking though.
> 

Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 18:03                                     ` H . J . Lu
@ 2002-06-03 18:29                                       ` Eric Christopher
  2002-06-03 19:47                                         ` H . J . Lu
  2002-06-03 18:40                                       ` Daniel Jacobowitz
  1 sibling, 1 reply; 29+ messages in thread
From: Eric Christopher @ 2002-06-03 18:29 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Jakub Jelinek, binutils, GDB, gcc-patches


> 
> Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?

a) I've not tested it. gcc passes testcases with DWARF2 as the default. 
b) dunno. see above :)

-eric

-- 
I will not carve gods


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 18:03                                     ` H . J . Lu
  2002-06-03 18:29                                       ` Eric Christopher
@ 2002-06-03 18:40                                       ` Daniel Jacobowitz
  2002-06-03 19:51                                         ` H . J . Lu
  2002-06-04 13:18                                         ` Eric Christopher
  1 sibling, 2 replies; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-03 18:40 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Eric Christopher, Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 06:03:51PM -0700, H . J . Lu wrote:
> On Mon, Jun 03, 2002 at 05:48:14PM -0700, Eric Christopher wrote:
> > 
> > > 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.. 
> > > 
> > 
> > Definitely not a huge fan of that patch. I have another one from Matt
> > Green (attached) that I'm not ecstatic about either, but also seems to
> > work. The correct answer is to make dwarf-2 work under mips. It may
> > require some reworking though.
> > 
> 
> Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?

It should, without breaking or affecting MIPS_STABS_ELF at all.

Eric, why don't you like it - or rather, what else do you think "making
dwarf-2 work under MIPS" means?  I think that was the only missing
detail.

(2.13 is on the horizon already; I'd really like this fixed)

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 18:29                                       ` Eric Christopher
@ 2002-06-03 19:47                                         ` H . J . Lu
  0 siblings, 0 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 19:47 UTC (permalink / raw)
  To: Eric Christopher; +Cc: Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 06:27:38PM -0700, Eric Christopher wrote:
> 
> > 
> > Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?
> 
> a) I've not tested it. gcc passes testcases with DWARF2 as the default. 
> b) dunno. see above :)
> 

It doesn't make much. "make check" from gcc 3.1.1 is ok on Linux/mipsel.
But debugging the binary generated by gcc 3.1.1 doesn't work.



H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 18:40                                       ` Daniel Jacobowitz
@ 2002-06-03 19:51                                         ` H . J . Lu
  2002-06-03 20:23                                           ` Daniel Jacobowitz
  2002-06-04 13:18                                         ` Eric Christopher
  1 sibling, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 19:51 UTC (permalink / raw)
  To: Eric Christopher, Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 09:40:00PM -0400, Daniel Jacobowitz wrote:
> On Mon, Jun 03, 2002 at 06:03:51PM -0700, H . J . Lu wrote:
> > On Mon, Jun 03, 2002 at 05:48:14PM -0700, Eric Christopher wrote:
> > > 
> > > > 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.. 
> > > > 
> > > 
> > > Definitely not a huge fan of that patch. I have another one from Matt
> > > Green (attached) that I'm not ecstatic about either, but also seems to
> > > work. The correct answer is to make dwarf-2 work under mips. It may
> > > require some reworking though.
> > > 
> > 
> > Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?
> 
> It should, without breaking or affecting MIPS_STABS_ELF at all.
> 
> Eric, why don't you like it - or rather, what else do you think "making
> dwarf-2 work under MIPS" means?  I think that was the only missing
> detail.

Well, binutils is currently broken on Linux/mips when gcc 3.1.1 is
used as I have reported.  How can you tell dwarf-2 works on mips?
I really like to see the whole thing get fixed. That is gcc 3.1.1
works on Linux/mips and binutils, including readelf, works with
gcc 3.1.1.


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 17:43                                   ` Richard Henderson
@ 2002-06-03 19:52                                     ` Doug Evans
  2002-06-03 19:54                                       ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: Doug Evans @ 2002-06-03 19:52 UTC (permalink / raw)
  To: Richard Henderson; +Cc: H . J . Lu, Jakub Jelinek, echristo, GDB

Richard Henderson writes:
 > On Mon, Jun 03, 2002 at 04:51:01PM -0700, H . J . Lu 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.
 > 
 > These directives aren't required for proper operation.
 > If they're not present, then gcc will emit the data itself
 > with labels and offsets.
 > 
 > If there are any remaining binutils bugs, then they should
 > be fixed in binutils.  We can require a later binutils 
 > release for Linux/mipsel.

fyi, heads up, and all that ...

See gdb pr 456 for a bug where gdb can handle .file/.loc but
can't handle the raw primitives emitted by gcc.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 19:52                                     ` Doug Evans
@ 2002-06-03 19:54                                       ` H . J . Lu
  2002-06-03 20:36                                         ` Richard Henderson
  0 siblings, 1 reply; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 19:54 UTC (permalink / raw)
  To: Doug Evans; +Cc: Richard Henderson, Jakub Jelinek, echristo, GDB

On Mon, Jun 03, 2002 at 07:51:40PM -0700, Doug Evans wrote:
> Richard Henderson writes:
>  > On Mon, Jun 03, 2002 at 04:51:01PM -0700, H . J . Lu 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.
>  > 
>  > These directives aren't required for proper operation.
>  > If they're not present, then gcc will emit the data itself
>  > with labels and offsets.
>  > 
>  > If there are any remaining binutils bugs, then they should
>  > be fixed in binutils.  We can require a later binutils 
>  > release for Linux/mipsel.
> 
> fyi, heads up, and all that ...
> 
> See gdb pr 456 for a bug where gdb can handle .file/.loc but
> can't handle the raw primitives emitted by gcc.

FYI, I looked at the asm output from gcc 3.1.1 for Linux/mipsel.
It has .file/.loc.


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 19:51                                         ` H . J . Lu
@ 2002-06-03 20:23                                           ` Daniel Jacobowitz
  2002-06-03 20:28                                             ` H . J . Lu
  0 siblings, 1 reply; 29+ messages in thread
From: Daniel Jacobowitz @ 2002-06-03 20:23 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Eric Christopher, Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 07:51:13PM -0700, H . J . Lu wrote:
> On Mon, Jun 03, 2002 at 09:40:00PM -0400, Daniel Jacobowitz wrote:
> > On Mon, Jun 03, 2002 at 06:03:51PM -0700, H . J . Lu wrote:
> > > On Mon, Jun 03, 2002 at 05:48:14PM -0700, Eric Christopher wrote:
> > > > 
> > > > > 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.. 
> > > > > 
> > > > 
> > > > Definitely not a huge fan of that patch. I have another one from Matt
> > > > Green (attached) that I'm not ecstatic about either, but also seems to
> > > > work. The correct answer is to make dwarf-2 work under mips. It may
> > > > require some reworking though.
> > > > 
> > > 
> > > Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?
> > 
> > It should, without breaking or affecting MIPS_STABS_ELF at all.
> > 
> > Eric, why don't you like it - or rather, what else do you think "making
> > dwarf-2 work under MIPS" means?  I think that was the only missing
> > detail.
> 
> Well, binutils is currently broken on Linux/mips when gcc 3.1.1 is
> used as I have reported.  How can you tell dwarf-2 works on mips?
> I really like to see the whole thing get fixed. That is gcc 3.1.1
> works on Linux/mips and binutils, including readelf, works with
> gcc 3.1.1.

Well, it definitely fixes a problem.  What else is wrong?  I won't have
time to set up a toolchain for another few days.

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


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 20:23                                           ` Daniel Jacobowitz
@ 2002-06-03 20:28                                             ` H . J . Lu
  0 siblings, 0 replies; 29+ messages in thread
From: H . J . Lu @ 2002-06-03 20:28 UTC (permalink / raw)
  To: Eric Christopher, Jakub Jelinek, binutils, GDB, gcc-patches

On Mon, Jun 03, 2002 at 11:01:22PM -0400, Daniel Jacobowitz wrote:
> On Mon, Jun 03, 2002 at 07:51:13PM -0700, H . J . Lu wrote:
> > On Mon, Jun 03, 2002 at 09:40:00PM -0400, Daniel Jacobowitz wrote:
> > > On Mon, Jun 03, 2002 at 06:03:51PM -0700, H . J . Lu wrote:
> > > > On Mon, Jun 03, 2002 at 05:48:14PM -0700, Eric Christopher wrote:
> > > > > 
> > > > > > 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.. 
> > > > > > 
> > > > > 
> > > > > Definitely not a huge fan of that patch. I have another one from Matt
> > > > > Green (attached) that I'm not ecstatic about either, but also seems to
> > > > > work. The correct answer is to make dwarf-2 work under mips. It may
> > > > > require some reworking though.
> > > > > 
> > > > 
> > > > Does it really make dwarf-2 work? Does it break MIPS_STABS_ELF?
> > > 
> > > It should, without breaking or affecting MIPS_STABS_ELF at all.
> > > 
> > > Eric, why don't you like it - or rather, what else do you think "making
> > > dwarf-2 work under MIPS" means?  I think that was the only missing
> > > detail.
> > 
> > Well, binutils is currently broken on Linux/mips when gcc 3.1.1 is
> > used as I have reported.  How can you tell dwarf-2 works on mips?
> > I really like to see the whole thing get fixed. That is gcc 3.1.1
> > works on Linux/mips and binutils, including readelf, works with
> > gcc 3.1.1.
> 
> Well, it definitely fixes a problem.  What else is wrong?  I won't have
> time to set up a toolchain for another few days.

http://sources.redhat.com/ml/binutils/2002-06/msg00020.html
http://sources.redhat.com/ml/binutils/2002-06/msg00036.html
http://sources.redhat.com/ml/binutils/2002-06/msg00040.html
http://sources.redhat.com/ml/binutils/2002-06/msg00047.html


H.J.


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 19:54                                       ` H . J . Lu
@ 2002-06-03 20:36                                         ` Richard Henderson
  0 siblings, 0 replies; 29+ messages in thread
From: Richard Henderson @ 2002-06-03 20:36 UTC (permalink / raw)
  To: H . J . Lu; +Cc: Doug Evans, Jakub Jelinek, echristo, GDB

On Mon, Jun 03, 2002 at 07:53:58PM -0700, H . J . Lu wrote:
> FYI, I looked at the asm output from gcc 3.1.1 for Linux/mipsel.
> It has .file/.loc.

If it doesn't work, then we should improve the configure.in test.


r~


^ permalink raw reply	[flat|nested] 29+ messages in thread

* Re: PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS)
  2002-06-03 18:40                                       ` Daniel Jacobowitz
  2002-06-03 19:51                                         ` H . J . Lu
@ 2002-06-04 13:18                                         ` Eric Christopher
  1 sibling, 0 replies; 29+ messages in thread
From: Eric Christopher @ 2002-06-04 13:18 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: H . J . Lu, Jakub Jelinek, binutils, GDB, gcc-patches


> 
> It should, without breaking or affecting MIPS_STABS_ELF at all.
> 
> Eric, why don't you like it - or rather, what else do you think "making
> dwarf-2 work under MIPS" means?  I think that was the only missing
> detail.
> 

I thought that dwarf2_emit_insn was necessary to get .file/.loc working
properly. So that would need to go into probably append_insn ().

> (2.13 is on the horizon already; I'd really like this fixed)
> 

I agree.

-- 
I will not carve gods


^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2002-06-04 20:18 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-06-02 14:36 Does gdb 5.2 support gcc 3.1.1 on Linux/mips? H . J . Lu
2002-06-02 18:00 ` Daniel Jacobowitz
2002-06-02 19:43   ` H . J . Lu
2002-06-02 22:01     ` Daniel Jacobowitz
2002-06-02 22:05       ` H . J . Lu
2002-06-02 22:09         ` Daniel Jacobowitz
2002-06-02 22:42           ` H . J . Lu
2002-06-02 23:03             ` H . J . Lu
2002-06-02 23:10               ` H . J . Lu
2002-06-03  4:22                 ` Daniel Berlin
2002-06-03  7:18                 ` Daniel Jacobowitz
2002-06-03  8:55                   ` DW_CFA_def_cfa_offset_sf bug? (Re: Does gdb 5.2 support gcc 3.1.1 on Linux/mips?) H . J . Lu
     [not found]                   ` <20020603092959.A27426@lucon.org>
     [not found]                     ` <20020603104131.A28590@lucon.org>
     [not found]                       ` <20020603115703.A29881@lucon.org>
     [not found]                         ` <20020604003246.C20867@sunsite.ms.mff.cuni.cz>
     [not found]                           ` <20020603153716.A1294@lucon.org>
2002-06-03 16:25                             ` PATCH: Use stabs for Linux/mips (Re: binutils is broken on ELF/MIPS) H . J . Lu
2002-06-03 16:41                               ` Daniel Jacobowitz
2002-06-03 16:51                                 ` H . J . Lu
2002-06-03 17:43                                   ` Richard Henderson
2002-06-03 19:52                                     ` Doug Evans
2002-06-03 19:54                                       ` H . J . Lu
2002-06-03 20:36                                         ` Richard Henderson
2002-06-03 17:50                                   ` Eric Christopher
2002-06-03 18:03                                     ` H . J . Lu
2002-06-03 18:29                                       ` Eric Christopher
2002-06-03 19:47                                         ` H . J . Lu
2002-06-03 18:40                                       ` Daniel Jacobowitz
2002-06-03 19:51                                         ` H . J . Lu
2002-06-03 20:23                                           ` Daniel Jacobowitz
2002-06-03 20:28                                             ` H . J . Lu
2002-06-04 13:18                                         ` Eric Christopher
2002-06-02 23:30       ` Does gdb 5.2 support gcc 3.1.1 on Linux/mips? Jakub Jelinek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox