Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* 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
* 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

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-30 13:14 5.1 PATCH: Allow gdb to link on mips-sgi-irix5.3 Rainer Orth
2001-07-31  1:40 ` Eli Zaretskii
2001-07-31  8:19   ` Andrew Cagney
2001-10-14 13:59     ` Andrew Cagney
  -- strict thread matches above, loose matches on Subject: below --
2001-07-26 14:42 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

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