Subject: Re: gdb fixed on alpha, status on mips?
To: Todd Vierling <tv@pobox.com>
From: Simon Burge <simonb@netbsd.org>
List: tech-toolchain
Date: 04/21/1999 10:49:05
Todd Vierling wrote:

> I've added a shockingly simple fix to gdb to enable shared object handling
> on alpha, so gdb is more-or-less working on alpha (and pullups have been
> submitted for 1.4).  There is still no single-step support, as there is an
> issue with licensing for the CMU-contributed code to do such, but
> breakpoints do work.
> 
> Now, as to the last known breakage (other than sparc64 or powerpc, which
> aren't implemented at all):  what's up with mips, if anything?

As a gdb weenie (I know "bt" and "print", and that gets me by), what can
I test?  As an example on my 1.4 build machine, and with Brian Grayson's
__builtin_return_address test program:

	mona:~ 20> gdb ./simpletest
	GNU gdb 4.17
	Copyright 1998 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 "mipsel--netbsd"...
	(gdb) break main
	Breakpoint 1 at 0x400f0c: file simpletest.c, line 10.
	(gdb) run
	Starting program: /home/simonb/./simpletest 

	Breakpoint 1, main (argc=1, argv=0x7ffff6a4) at simpletest.c:10
	10        a();
	(gdb) step
	a () at simpletest.c:12
	12      void a() {b();}
	(gdb) step
	b () at simpletest.c:13
	13      void b() {c();}
	(gdb) step
	c () at simpletest.c:14
	14      void c() {d();}
	(gdb) step

	Program received signal SIGSEGV, Segmentation fault.
	0x401348 in FramesOkay () at simpletest.c:43
	43        frameaddr[3]=(int)__builtin_frame_address(3);
	(gdb) quit
	The program is running.  Exit anyway? (y or n) y

and this seems to be where the program dies:

	mona:~ 24> ./simpletest
	Segmentation fault (core dumped)
	Exit 139
	mona:~ 25> gdb ./simpletest simpletest.core
	GNU gdb 4.17
	Copyright 1998 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 "mipsel--netbsd"...
	Core was generated by `simpletest'.
	Program terminated with signal 11, Segmentation fault.
	Reading symbols from /usr/libexec/ld.elf_so...done.
	Reading symbols from /usr/lib/libc.so.12...done.
	#0  0x401348 in FramesOkay () at simpletest.c:43
	43        frameaddr[3]=(int)__builtin_frame_address(3);
	(gdb) bt
	#0  0x401348 in FramesOkay () at simpletest.c:43
	#1  0x40118c in g () at simpletest.c:21
	#2  0x401134 in f () at simpletest.c:18
	#3  0x4010dc in e () at simpletest.c:16
	#4  0x401084 in d () at simpletest.c:15
	#5  0x40102c in c () at simpletest.c:14
	#6  0x400fd4 in b () at simpletest.c:13
	#7  0x400f7c in a () at simpletest.c:12
	#8  0x400f24 in main (argc=1, argv=0x7ffff6ac) at simpletest.c:10
	(gdb) quit

What can I do to help?

Simon.