* 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
@ 2001-07-26 14:42 Rainer Orth
2001-07-26 15:13 ` Elena Zannoni
2001-07-27 2:06 ` Eli Zaretskii
0 siblings, 2 replies; 10+ messages in thread
From: Rainer Orth @ 2001-07-26 14:42 UTC (permalink / raw)
To: gdb-patches
I just tried the current CVS version, configured on IRIX 6.2 for
mips-sgi-irix5.3, to allow debugging O32 binaries on IRIX 6 during my work
to re-integrate O32 ABI support for IRIX 6 into GCC.
gdb failed to link, though:
ld32: ERROR 33 : Unresolved text symbol "no_shared_libraries" -- 1st referenced by libgdb.a(remote.o).
The patch below fixes this.
Unfortunately, the resulting gdb does not work at all:
* Trying to debug a trivial hello world compiled with cc -32 -g (i.e. with
mdebug debugging information) lets gdb abort with an internal error:
% cc -32 -g -o hello-cc hello.c
% gdb/gdb ./hello-cc
GNU gdb 2001-07-26-cvs (MI_OUT)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix5.3".../vol/gnu/src/gdb/src/gdb/mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
* Trying the same thing with a gcc-compiled binary (using gas, so stabs are
in use) is not much better:
% gcc -g -o hello-gcc hello.c
% gdb/gdb ./hello-gcc
GNU gdb 2001-07-26-cvs (MI_OUT)
Copyright 2001 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "mips-sgi-irix5.3"...
(gdb) b main
Breakpoint 1 at 0x400c44: file /homes/ro/src/c/test/hello.c, line 7.
(gdb) run
Starting program: /vol/gcc/obj/gdb/5.3/./hello-gcc
/vol/gnu/src/gdb/src/gdb/regcache.c:281: gdb-internal-error: legacy_read_register_gen: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
Both programs can be debugged with gdb 5.0 ;-(
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
Thu Jul 26 23:27:26 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
* config/mips/irix5.mh (NATDEPFILES): Add solib.o.
Index: config/mips/irix5.mh
===================================================================
RCS file: /cvs/src/src/gdb/config/mips/irix5.mh,v
retrieving revision 1.2
diff -u -p -r1.2 irix5.mh
--- irix5.mh 2000/06/12 06:09:05 1.2
+++ irix5.mh 2001/07/26 21:31:57
@@ -2,7 +2,7 @@
XDEPFILES=
XM_FILE= xm-irix5.h
NAT_FILE= nm-irix5.h
-NATDEPFILES= fork-child.o irix5-nat.o corelow.o procfs.o \
+NATDEPFILES= fork-child.o solib.o irix5-nat.o corelow.o procfs.o \
proc-api.o proc-events.o proc-flags.o proc-why.o
XM_CLIBS=-lbsd -lsun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-26 14:42 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3 Rainer Orth
@ 2001-07-26 15:13 ` Elena Zannoni
2001-07-27 2:06 ` Eli Zaretskii
1 sibling, 0 replies; 10+ messages in thread
From: Elena Zannoni @ 2001-07-26 15:13 UTC (permalink / raw)
To: Rainer Orth; +Cc: gdb-patches
Rainer Orth writes:
> I just tried the current CVS version, configured on IRIX 6.2 for
> mips-sgi-irix5.3, to allow debugging O32 binaries on IRIX 6 during my work
> to re-integrate O32 ABI support for IRIX 6 into GCC.
>
> gdb failed to link, though:
>
> ld32: ERROR 33 : Unresolved text symbol "no_shared_libraries" -- 1st referenced by libgdb.a(remote.o).
>
> The patch below fixes this.
>
> Unfortunately, the resulting gdb does not work at all:
>
> * Trying to debug a trivial hello world compiled with cc -32 -g (i.e. with
> mdebug debugging information) lets gdb abort with an internal error:
>
> % cc -32 -g -o hello-cc hello.c
> % gdb/gdb ./hello-cc
> GNU gdb 2001-07-26-cvs (MI_OUT)
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "mips-sgi-irix5.3".../vol/gnu/src/gdb/src/gdb/mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
>
For ths particualr error, can you take a look at the threads:
http://sources.redhat.com/ml/gdb-patches/2001-05/msg00178.html
http://sources.redhat.com/ml/gdb-patches/2001-05/msg00187.html A
similar problem was reported but a fix was not generated. Hopefully
the discussion there that can help pinpoint your problem.
What are the sections in your file?
> * Trying the same thing with a gcc-compiled binary (using gas, so stabs are
> in use) is not much better:
>
> % gcc -g -o hello-gcc hello.c
> % gdb/gdb ./hello-gcc
> GNU gdb 2001-07-26-cvs (MI_OUT)
> Copyright 2001 Free Software Foundation, Inc.
> GDB is free software, covered by the GNU General Public License, and you are
> welcome to change it and/or distribute copies of it under certain conditions.
> Type "show copying" to see the conditions.
> There is absolutely no warranty for GDB. Type "show warranty" for details.
> This GDB was configured as "mips-sgi-irix5.3"...
> (gdb) b main
> Breakpoint 1 at 0x400c44: file /homes/ro/src/c/test/hello.c, line 7.
> (gdb) run
> Starting program: /vol/gcc/obj/gdb/5.3/./hello-gcc
> /vol/gnu/src/gdb/src/gdb/regcache.c:281: gdb-internal-error: legacy_read_register_gen: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
>
This seems to be a bogus regnumber that is outside the range defined
for your target.
Elena
> Both programs can be debugged with gdb 5.0 ;-(
>
> Rainer
>
> -----------------------------------------------------------------------------
> Rainer Orth, Faculty of Technology, Bielefeld University
>
> Email: ro@TechFak.Uni-Bielefeld.DE
>
>
> Thu Jul 26 23:27:26 2001 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
>
> * config/mips/irix5.mh (NATDEPFILES): Add solib.o.
>
> Index: config/mips/irix5.mh
> ===================================================================
> RCS file: /cvs/src/src/gdb/config/mips/irix5.mh,v
> retrieving revision 1.2
> diff -u -p -r1.2 irix5.mh
> --- irix5.mh 2000/06/12 06:09:05 1.2
> +++ irix5.mh 2001/07/26 21:31:57
> @@ -2,7 +2,7 @@
> XDEPFILES=
> XM_FILE= xm-irix5.h
> NAT_FILE= nm-irix5.h
> -NATDEPFILES= fork-child.o irix5-nat.o corelow.o procfs.o \
> +NATDEPFILES= fork-child.o solib.o irix5-nat.o corelow.o procfs.o \
> proc-api.o proc-events.o proc-flags.o proc-why.o
>
> XM_CLIBS=-lbsd -lsun
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-26 14:42 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3 Rainer Orth
2001-07-26 15:13 ` Elena Zannoni
@ 2001-07-27 2:06 ` Eli Zaretskii
2001-07-27 4:55 ` Rainer Orth
1 sibling, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2001-07-27 2:06 UTC (permalink / raw)
To: ro; +Cc: gdb-patches
> From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
> Date: Thu, 26 Jul 2001 23:42:41 +0200 (MEST)
>
> I just tried the current CVS version, configured on IRIX 6.2 for
> mips-sgi-irix5.3, to allow debugging O32 binaries on IRIX 6 during my work
> to re-integrate O32 ABI support for IRIX 6 into GCC.
Is there any reason why you didn't use mips-sgi-irix6 configuration?
Since you want to debug on Irix 6.x, that sounds like The Right Way,
no?
As a bonus, you'd have this problem solved, because I already bumped
into it when I tried to build a native Irix 6 GDB.
The CVS version should build and work when configured as
mips-sgi-irix6, but I only tested that with n32 and -64 executables
(the latter is _known_ to be broken for now, see NEWS, but GDB never
supported -64 anyway). So it's possible that o32 has some issues, but
I did try not to break it when I fixed n32 support on Irix 6.
> diff -u -p -r1.2 irix5.mh
> --- irix5.mh 2000/06/12 06:09:05 1.2
> +++ irix5.mh 2001/07/26 21:31:57
> @@ -2,7 +2,7 @@
> XDEPFILES=
> XM_FILE= xm-irix5.h
> NAT_FILE= nm-irix5.h
> -NATDEPFILES= fork-child.o irix5-nat.o corelow.o procfs.o \
> +NATDEPFILES= fork-child.o solib.o irix5-nat.o corelow.o procfs.o \
> proc-api.o proc-events.o proc-flags.o proc-why.o
You will see that this patch is already there in irix6.mh.
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-27 2:06 ` Eli Zaretskii
@ 2001-07-27 4:55 ` Rainer Orth
2001-07-27 7:25 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2001-07-27 4:55 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii writes:
> Is there any reason why you didn't use mips-sgi-irix6 configuration?
> Since you want to debug on Irix 6.x, that sounds like The Right Way,
> no?
I had supposed (incorrectly, it seems) that, like GCC, GDB only supported
either the O32 (in the IRIX 5 configuration) or N32/N64 (in the IRIX 6
configuration) ABIs.
> The CVS version should build and work when configured as
> mips-sgi-irix6, but I only tested that with n32 and -64 executables
> (the latter is _known_ to be broken for now, see NEWS, but GDB never
> supported -64 anyway). So it's possible that o32 has some issues, but
> I did try not to break it when I fixed n32 support on Irix 6.
While a mips-sgi-irix6.2 configuration is able to debug the O32-with-stabs
hello-gcc that fails in the mips-sgi-irix5.3 configuration, the
O32-with-mdebug binary still triggers the same internal error reported with
my patch.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-27 4:55 ` Rainer Orth
@ 2001-07-27 7:25 ` Eli Zaretskii
2001-07-27 7:28 ` Rainer Orth
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2001-07-27 7:25 UTC (permalink / raw)
To: ro; +Cc: gdb-patches
> From: Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
> Date: Fri, 27 Jul 2001 13:55:17 +0200 (MEST)
>
> While a mips-sgi-irix6.2 configuration is able to debug the O32-with-stabs
> hello-gcc that fails in the mips-sgi-irix5.3 configuration, the
> O32-with-mdebug binary still triggers the same internal error reported with
> my patch.
Which message is that, this:
/vol/gnu/src/gdb/src/gdb/regcache.c:281: gdb-internal-error: legacy_read_register_gen: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
or this:
/vol/gnu/src/gdb/src/gdb/mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
I'd expect the former not to appear (that was one of the bugs I fixed
in the Irix 6.x config).
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-27 7:25 ` Eli Zaretskii
@ 2001-07-27 7:28 ` Rainer Orth
0 siblings, 0 replies; 10+ messages in thread
From: Rainer Orth @ 2001-07-27 7:28 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: gdb-patches
Eli Zaretskii writes:
> Which message is that, this:
>
> /vol/gnu/src/gdb/src/gdb/regcache.c:281: gdb-internal-error: legacy_read_register_gen: Assertion `regnum >= 0 && regnum < (NUM_REGS + NUM_PSEUDO_REGS)' failed.
>
> or this:
>
> /vol/gnu/src/gdb/src/gdb/mdebugread.c:2443: gdb-internal-error: sect_index_data not initialized
This one, which also occured for the O32/mdebug hello-cc when using the
mips-sgi-irix5.3 configuration.
> I'd expect the former not to appear (that was one of the bugs I fixed
> in the Irix 6.x config).
Right, that one happened only when trying to debug a O32/stabs binary with
the mips-sgi-irix5.3 gdb.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
@ 2001-07-30 13:14 Rainer Orth
2001-07-31 1:40 ` Eli Zaretskii
0 siblings, 1 reply; 10+ messages in thread
From: Rainer Orth @ 2001-07-30 13:14 UTC (permalink / raw)
To: Elena Zannoni; +Cc: gdb-patches
[For some reason, I didn't get a copy of this message, but only found it in
the mailing list archive.]
Elena Zannoni writes:
> For ths particualr error, can you take a look at the threads:
> http://sources.redhat.com/ml/gdb-patches/2001-05/msg00178.html
> http://sources.redhat.com/ml/gdb-patches/2001-05/msg00187.html A
> similar problem was reported but a fix was not generated. Hopefully
> the discussion there that can help pinpoint your problem.
Indeed, and I have already re-discovered this problem on Tru64 UNIX, see PR
gdb/182. What's the problem with the fix above? Without it, gdb on Tru64
UNIX is practically unusable.
The problem with O32/mdebug on IRIX is similar: the binary in question has
no data section, and running the mips-sgi-irix5.3 gdb under gdb reveals
that the value of the symbol that causes the internal error reported is
just the address of the .rodata section.
The problem seems to be that mdebugread.c first uses SC_IS_DATA() to
determine what section a symbol belongs to (which allows .data, .sdata,
.rodata etc. sections), and than only uses SECT_OFF_DATA, which only works
for the .data section.
Here's readelf -S output for reference:
There are 20 section headers, starting at offset 0x6538:
Section Headers:
[Nr] Name Type Addr Off Size ES Flg Lk Inf Al
[ 0] NULL 00000000 000000 000000 00 0 0 0
[ 1] .interp PROGBITS 00400134 000134 000013 00 A 0 0 4
[ 2] .MIPS.options MIPS_OPTIONS 00400148 000148 000080 00 Ao 0 0 8
[ 3] .reginfo MIPS_REGINFO 004001c8 0001c8 000018 18 A 0 0 4
[ 4] .dynamic DYNAMIC 004001e0 0001e0 000100 08 A 6 0 4
[ 5] .liblist MIPS_LIBLIST 004002e0 0002e0 000014 14 A 6 1 4
[ 6] .dynstr STRTAB 004002f4 0002f4 00017f 00 A 0 0 4
[ 7] .hash HASH 00400474 000474 0001b8 04 A 8 0 4
[ 8] .dynsym DYNSYM 0040062c 00062c 0002c0 10 A 6 4 4
[ 9] .MIPS.symlib MIPS_SYMBOL_LIB 004008ec 0008ec 00002c 01 A 8 5 1
[10] .msym MIPS_MSYM 00400918 000918 000160 08 A 6 0 4
[11] .MIPS.stubs PROGBITS 00400a78 000a78 000044 04 AX 0 0 4
[12] .text PROGBITS 00400ac0 000ac0 000180 01 AX 0 0 16
[13] .init PROGBITS 00400c40 000c40 000020 01 AX 0 0 16
[14] .rodata PROGBITS 10004000 004000 000010 01 WA 0 0 16
[15] .got PROGBITS 10004010 004010 00006c 04 WAp 0 0 4
[16] .bss NOBITS 1000407c 00407c 00000c 00 WA 0 0 4
[17] .mdebug MIPS_DEBUG 00000000 005000 001464 01 0 0 4
[18] .compact_rel PROGBITS 00000000 006464 000030 00 0 0 4
[19] .shstrtab STRTAB 00000000 006494 0000a4 00 0 0 0
Key to Flags:
W (write), A (alloc), X (execute), M (merge), S (strings)
I (info), L (link order), G (group), x (unknown)
O (extra OS processing required) o (OS specific), p (processor specific)
> This seems to be a bogus regnumber that is outside the range defined
> for your target.
As Eli Zaretskii already pointed out, this error does not occur in a
mips-sgi-irix6.2 configuration. Nonetheless the fix should probably go
into the mips-sgi-irix5.3 config, too.
Rainer
-----------------------------------------------------------------------------
Rainer Orth, Faculty of Technology, Bielefeld University
Email: ro@TechFak.Uni-Bielefeld.DE
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-30 13:14 Rainer Orth
@ 2001-07-31 1:40 ` Eli Zaretskii
2001-07-31 8:19 ` Andrew Cagney
0 siblings, 1 reply; 10+ messages in thread
From: Eli Zaretskii @ 2001-07-31 1:40 UTC (permalink / raw)
To: Rainer Orth; +Cc: Elena Zannoni, gdb-patches
On Mon, 30 Jul 2001, Rainer Orth wrote:
> > This seems to be a bogus regnumber that is outside the range defined
> > for your target.
>
> As Eli Zaretskii already pointed out, this error does not occur in a
> mips-sgi-irix6.2 configuration. Nonetheless the fix should probably go
> into the mips-sgi-irix5.3 config, too.
I don't have access to Irix 5.x to test that. If someone could see
that the change I made for Irix 6.x works on 5.x with both GCC and the
native compiler, I agree that we should commit the same change in
mips-sgi-irix5 config. (The reason that I'm hesitant is that Irix 5.x
configuration was obviously working at some point, unlike Irix 6.x
which I invented. So I think we had better be sure we don't break
anything with that change.)
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-31 1:40 ` Eli Zaretskii
@ 2001-07-31 8:19 ` Andrew Cagney
2001-10-14 13:59 ` Andrew Cagney
0 siblings, 1 reply; 10+ messages in thread
From: Andrew Cagney @ 2001-07-31 8:19 UTC (permalink / raw)
To: Eli Zaretskii; +Cc: Rainer Orth, Elena Zannoni, gdb-patches
> On Mon, 30 Jul 2001, Rainer Orth wrote:
>
>
>> > This seems to be a bogus regnumber that is outside the range defined
>> > for your target.
>
>>
>> As Eli Zaretskii already pointed out, this error does not occur in a
>> mips-sgi-irix6.2 configuration. Nonetheless the fix should probably go
>> into the mips-sgi-irix5.3 config, too.
>
>
> I don't have access to Irix 5.x to test that. If someone could see
> that the change I made for Irix 6.x works on 5.x with both GCC and the
> native compiler, I agree that we should commit the same change in
> mips-sgi-irix5 config. (The reason that I'm hesitant is that Irix 5.x
> configuration was obviously working at some point, unlike Irix 6.x
> which I invented. So I think we had better be sure we don't break
> anything with that change.)
I do now ....
Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3
2001-07-31 8:19 ` Andrew Cagney
@ 2001-10-14 13:59 ` Andrew Cagney
0 siblings, 0 replies; 10+ messages in thread
From: Andrew Cagney @ 2001-10-14 13:59 UTC (permalink / raw)
To: Andrew Cagney; +Cc: Eli Zaretskii, Rainer Orth, Elena Zannoni, gdb-patches
FYI,
I'm going to drop this on the floor. The access I have is so unreliable
as to not be worth having.
Andrew
> On Mon, 30 Jul 2001, Rainer Orth wrote:
>
>
>> This seems to be a bogus regnumber that is outside the range defined
>> for your target.
>
>
> As Eli Zaretskii already pointed out, this error does not occur in a
> mips-sgi-irix6.2 configuration. Nonetheless the fix should probably go
> into the mips-sgi-irix5.3 config, too.
>
>
> I don't have access to Irix 5.x to test that. If someone could see
> that the change I made for Irix 6.x works on 5.x with both GCC and the
> native compiler, I agree that we should commit the same change in
> mips-sgi-irix5 config. (The reason that I'm hesitant is that Irix 5.x
> configuration was obviously working at some point, unlike Irix 6.x
> which I invented. So I think we had better be sure we don't break
> anything with that change.)
>
>
> I do now ....
>
> Andrew
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2001-10-14 13:59 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-07-26 14:42 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3 Rainer Orth
2001-07-26 15:13 ` Elena Zannoni
2001-07-27 2:06 ` Eli Zaretskii
2001-07-27 4:55 ` Rainer Orth
2001-07-27 7:25 ` Eli Zaretskii
2001-07-27 7:28 ` Rainer Orth
2001-07-30 13:14 Rainer Orth
2001-07-31 1:40 ` Eli Zaretskii
2001-07-31 8:19 ` Andrew Cagney
2001-10-14 13:59 ` Andrew Cagney
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox