* [RFC] mips gdb fails to detect o32
@ 2002-08-07 17:42 Michael Snyder
2002-08-07 17:46 ` Daniel Jacobowitz
2002-08-07 19:49 ` Andrew Cagney
0 siblings, 2 replies; 7+ messages in thread
From: Michael Snyder @ 2002-08-07 17:42 UTC (permalink / raw)
To: gdb-patches, cagney
[-- Attachment #1: Type: text/plain, Size: 513 bytes --]
Well, I just discovered that gdb is failing to detect the o32 abi
when debugging the output of the native Irix compiler. This patch
seems to help.
The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
then it must be o32. However, I've no idea if that's right --
I just know it works so far as I've been able to test it.
Unfortunately, I haven't been able to test it against EABI,
and I haven't been able to test it against gcc, because gcc
doesn't generate o32.
So... anybody have any better ideas?
[-- Attachment #2: patch3.diff --]
[-- Type: text/plain, Size: 696 bytes --]
2002-08-07 Michael Snyder <msnyder@redhat.com>
* mips-tdep.c (mips_gdbarch_init): Detect 032.
Index: mips-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/mips-tdep.c,v
retrieving revision 1.92
diff -p -r1.92 mips-tdep.c
*** mips-tdep.c 8 Aug 2002 00:26:51 -0000 1.92
--- mips-tdep.c 8 Aug 2002 00:33:15 -0000
*************** mips_gdbarch_init (struct gdbarch_info i
*** 4412,4417 ****
--- 4412,4419 ----
default:
if ((elf_flags & EF_MIPS_ABI2))
mips_abi = MIPS_ABI_N32;
+ else if ((elf_flags & EF_MIPS_ARCH) == E_MIPS_ARCH_2)
+ mips_abi = MIPS_ABI_O32;
else
mips_abi = MIPS_ABI_UNKNOWN;
break;
^ permalink raw reply [flat|nested] 7+ messages in thread* Re: [RFC] mips gdb fails to detect o32
2002-08-07 17:42 [RFC] mips gdb fails to detect o32 Michael Snyder
@ 2002-08-07 17:46 ` Daniel Jacobowitz
2002-08-07 17:57 ` Michael Snyder
2002-08-07 19:49 ` Andrew Cagney
1 sibling, 1 reply; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-08-07 17:46 UTC (permalink / raw)
To: gdb-patches
On Wed, Aug 07, 2002 at 05:23:43PM -0700, Michael Snyder wrote:
> Well, I just discovered that gdb is failing to detect the o32 abi
> when debugging the output of the native Irix compiler. This patch
> seems to help.
>
> The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
> then it must be o32. However, I've no idea if that's right --
> I just know it works so far as I've been able to test it.
>
> Unfortunately, I haven't been able to test it against EABI,
> and I haven't been able to test it against gcc, because gcc
> doesn't generate o32.
GCC does generate O32. GNU binutils won't use the ARCH/ABI bits in the
ELF header in a lot of cases, though; and it emits a better way to
identify the ABI.
I don't think keying off MIPS II makes a heck of a lot of sense here...
depending on what SGI's tools put out you might want to default to O32
if no ABI tag bits are present, but that's a little shadier.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] mips gdb fails to detect o32
2002-08-07 17:46 ` Daniel Jacobowitz
@ 2002-08-07 17:57 ` Michael Snyder
2002-08-07 18:01 ` Daniel Jacobowitz
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2002-08-07 17:57 UTC (permalink / raw)
To: Daniel Jacobowitz; +Cc: gdb-patches
Daniel Jacobowitz wrote:
>
> On Wed, Aug 07, 2002 at 05:23:43PM -0700, Michael Snyder wrote:
> > Well, I just discovered that gdb is failing to detect the o32 abi
> > when debugging the output of the native Irix compiler. This patch
> > seems to help.
> >
> > The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
> > then it must be o32. However, I've no idea if that's right --
> > I just know it works so far as I've been able to test it.
> >
> > Unfortunately, I haven't been able to test it against EABI,
> > and I haven't been able to test it against gcc, because gcc
> > doesn't generate o32.
>
> GCC does generate O32.
Really? How? It rejects "-mabi=o32".
> GNU binutils won't use the ARCH/ABI bits in the
> ELF header in a lot of cases, though; and it emits a better way to
> identify the ABI.
Can you be more specific?
>
> I don't think keying off MIPS II makes a heck of a lot of sense here...
> depending on what SGI's tools put out you might want to default to O32
> if no ABI tag bits are present, but that's a little shadier.
Andrew added code to make it default to n32 in Novermber 2000.
I wouldn't want to overrule him... ;-)
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] mips gdb fails to detect o32
2002-08-07 17:57 ` Michael Snyder
@ 2002-08-07 18:01 ` Daniel Jacobowitz
0 siblings, 0 replies; 7+ messages in thread
From: Daniel Jacobowitz @ 2002-08-07 18:01 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches
On Wed, Aug 07, 2002 at 05:38:39PM -0700, Michael Snyder wrote:
> Daniel Jacobowitz wrote:
> >
> > On Wed, Aug 07, 2002 at 05:23:43PM -0700, Michael Snyder wrote:
> > > Well, I just discovered that gdb is failing to detect the o32 abi
> > > when debugging the output of the native Irix compiler. This patch
> > > seems to help.
> > >
> > > The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
> > > then it must be o32. However, I've no idea if that's right --
> > > I just know it works so far as I've been able to test it.
> > >
> > > Unfortunately, I haven't been able to test it against EABI,
> > > and I haven't been able to test it against gcc, because gcc
> > > doesn't generate o32.
> >
> > GCC does generate O32.
>
> Really? How? It rejects "-mabi=o32".
I believe the GNU tools call it "32". Yep, that's right.
> > GNU binutils won't use the ARCH/ABI bits in the
> > ELF header in a lot of cases, though; and it emits a better way to
> > identify the ABI.
>
> Can you be more specific?
See the patch I added recently to recognize the ".mdebug.o32" and
similar sections; GCC emits these in every object file.
> > I don't think keying off MIPS II makes a heck of a lot of sense here...
> > depending on what SGI's tools put out you might want to default to O32
> > if no ABI tag bits are present, but that's a little shadier.
>
> Andrew added code to make it default to n32 in Novermber 2000.
> I wouldn't want to overrule him... ;-)
N32 makes more sense for IRIX anyway... there must be some marking
difference though. If N32 is marked and O32 isn't perhaps the default
should change after all.
--
Daniel Jacobowitz Carnegie Mellon University
MontaVista Software Debian GNU/Linux Developer
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] mips gdb fails to detect o32
2002-08-07 17:42 [RFC] mips gdb fails to detect o32 Michael Snyder
2002-08-07 17:46 ` Daniel Jacobowitz
@ 2002-08-07 19:49 ` Andrew Cagney
2002-08-07 20:00 ` Michael Snyder
1 sibling, 1 reply; 7+ messages in thread
From: Andrew Cagney @ 2002-08-07 19:49 UTC (permalink / raw)
To: Michael Snyder; +Cc: gdb-patches, cagney
> On Wed, Aug 07, 2002 at 05:23:43PM -0700, Michael Snyder wrote:
>
>> Well, I just discovered that gdb is failing to detect the o32 abi
>> when debugging the output of the native Irix compiler. This patch
>> seems to help.
>>
>> The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
>> then it must be o32. However, I've no idea if that's right --
>> I just know it works so far as I've been able to test it.
>>
>> Unfortunately, I haven't been able to test it against EABI,
>> and I haven't been able to test it against gcc, because gcc
>> doesn't generate o32.
>
>
> GCC does generate O32. GNU binutils won't use the ARCH/ABI bits in the
> ELF header in a lot of cases, though; and it emits a better way to
> identify the ABI.
>
> I don't think keying off MIPS II makes a heck of a lot of sense here...
> depending on what SGI's tools put out you might want to default to O32
> if no ABI tag bits are present, but that's a little shadier.
Um, won't the final:
if (mips_abi == MIPS_ABI_UNKNOWN)
mips_abi = MIPS_ABI_032;
kick in?
Andrew
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [RFC] mips gdb fails to detect o32
2002-08-07 19:49 ` Andrew Cagney
@ 2002-08-07 20:00 ` Michael Snyder
2002-08-07 20:11 ` Andrew Cagney
0 siblings, 1 reply; 7+ messages in thread
From: Michael Snyder @ 2002-08-07 20:00 UTC (permalink / raw)
To: Andrew Cagney; +Cc: gdb-patches, cagney
Andrew Cagney wrote:
>
> > On Wed, Aug 07, 2002 at 05:23:43PM -0700, Michael Snyder wrote:
> >
> >> Well, I just discovered that gdb is failing to detect the o32 abi
> >> when debugging the output of the native Irix compiler. This patch
> >> seems to help.
> >>
> >> The idea here is, if it's not n32, then if it is MIPS_ARCH_2,
> >> then it must be o32. However, I've no idea if that's right --
> >> I just know it works so far as I've been able to test it.
> >>
> >> Unfortunately, I haven't been able to test it against EABI,
> >> and I haven't been able to test it against gcc, because gcc
> >> doesn't generate o32.
> >
> >
> > GCC does generate O32. GNU binutils won't use the ARCH/ABI bits in the
> > ELF header in a lot of cases, though; and it emits a better way to
> > identify the ABI.
> >
> > I don't think keying off MIPS II makes a heck of a lot of sense here...
> > depending on what SGI's tools put out you might want to default to O32
> > if no ABI tag bits are present, but that's a little shadier.
>
> Um, won't the final:
>
> if (mips_abi == MIPS_ABI_UNKNOWN)
> mips_abi = MIPS_ABI_032;
>
> kick in?
No, not if MIPS_ABI_DEFAULT is defined....
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2002-08-08 3:11 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-08-07 17:42 [RFC] mips gdb fails to detect o32 Michael Snyder
2002-08-07 17:46 ` Daniel Jacobowitz
2002-08-07 17:57 ` Michael Snyder
2002-08-07 18:01 ` Daniel Jacobowitz
2002-08-07 19:49 ` Andrew Cagney
2002-08-07 20:00 ` Michael Snyder
2002-08-07 20:11 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox