This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

gcc 2.97 + gdb 5.0 + Solaris 2.8 = total confusion


I installed this version of gcc:

polya-6% gcc -v
Reading specs from /pkgs/gcc-2.96/lib/gcc-lib/sparc-sun-solaris2.8/2.97/specs
Configured with:  --prefix=/pkgs/gcc-2.96 --enable-checking=no
gcc version 2.97 20001012 (experimental)

with this version of gdb:

polya-8% gdb -v
GNU gdb 5.0
Copyright 2000 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 "sparc-sun-solaris2.8".

and I'm trying to debug a rather large program that gets a SIGSEGV
when _meroon.i is compiled and linked with

gcc -O0 -g -c _meroon.i
gcc -o meroon _meroon.o _meroon_.o libgambc.a -lnsl -lsocket -ldl -lcurses -lm -g

The problem is reported as

Program received signal SIGSEGV, Segmentation fault.
0x1233c8 in ___H__20___meroon (___ps=0x27beb8) at _meroon.i:48486
48486       ___r1 = ((((int) -5 << 2) + 2));
(gdb) list
48481   ___L5_copy_2d_instance_2d_slice_21_:
48482       if (!(___r1 == (((int) -1 << 2) + 2)))
48483       {
48484           goto ___L10_copy_2d_instance_2d_slice_21_;
48485       }
48486       ___r1 = ((((int) -5 << 2) + 2));
48487       if (___fp < ___ps->stack_trip)
48488       {
48489           ___ps->temp1 = ___start + ((2453 - 1 + 6) * 4 * 4);
48490           {

Now ___r1 looks a little crazy (wasn't it just confirmed to be equal
to -2?):

(gdb) info locals
___pc = 852798480
___start = 1975993
___temp = 2524065
___hp = (int *) 0x285234
___fp = (int *) 0x2bc9c0
___r0 = 1976713
___r1 = 2642475
___r2 = 68
___r3 = -6
___r4 = 2516577

etc.

and the assembly language looks fine:

	.stabn 68,0,48482,.LLM20239-___H__20___meroon
.LLM20239:
	ld	[%fp-48], %o0
	cmp	%o0, -2
	be	.LL8581
	nop
	.stabn 68,0,48484,.LLM20240-___H__20___meroon
.LLM20240:
	b	.LL8582
	 nop
.LL8581:
	.stabn 68,0,48486,.LLM20241-___H__20___meroon
.LLM20241:
	mov	-18, %o1                       <<<<<<<<<<< Here is the line
	st	%o1, [%fp-48]
	.stabn 68,0,48487,.LLM20242-___H__20___meroon
.LLM20242:
	ld	[%fp+68], %i0
	ld	[%i0], %i0
	ld	[%fp-40], %o0
	cmp	%o0, %i0
	bgeu	.LL2439
	nop

So I have no idea what's happening (note that it seems to load
___r1 from [%fp-48] just fine at line 48482).

Can anyone suggest anything that could allow me to get this program
to run on this OS?  I'm willing to try other versions of gcc and/or gdb

Brad Lucier

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]