Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 18 May 2003 23:50:56 +0100
From:      Ian Dowse <iedowse@maths.tcd.ie>
To:        obrien@freebsd.org
Cc:        current@freebsd.org
Subject:   Re: kgdb missing stack frames 
Message-ID:  <200305182350.aa53905@salmon.maths.tcd.ie>
In-Reply-To: Your message of "Sun, 18 May 2003 15:14:57 PDT." <20030518221457.GA4531@dragon.nuxi.com> 

next in thread | previous in thread | raw e-mail | index | archive | help
In message <20030518221457.GA4531@dragon.nuxi.com>, David O'Brien writes:
>
>This would give vendor differences I was trying to avoid.  I think this
is another way to fix the problem.  I haven't tested it, but if you have
>a chance before I do, want to give it a spin?

Thanks, to get it to work I had to include tm.h first, as otherwise
I got lots of warnings about the macros that are first defined in
fbsd-kgdb-i386.h being redefined later:

	In file included from tm.h:27,
			 from /usr/src/contrib/gdb/gdb/defs.h:968,
			 from /usr/src/contrib/gdb/gdb/annotate.c:22:
	/usr/src/contrib/gdb/gdb/config/i386/tm-i386.h:300:1: warning:
	    "FRAME_SAVED_PC" redefined
	In file included from nm.h:4,
			 from /usr/src/contrib/gdb/gdb/defs.h:960,
			 from /usr/src/contrib/gdb/gdb/annotate.c:22:
	/usr/src/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h:21:1: warning:
	     this is the location of the previous definition

I don't know whether including tm.h there is a reasonable thing to
do, but following patch seems to work. I've only tested it on the
i386, so I guess further changes will be needed for other architectures.

Ian

Index: Makefile
===================================================================
RCS file: /dump/FreeBSD-CVS/src/gnu/usr.bin/binutils/gdb/Makefile,v
retrieving revision 1.65
diff -u -r1.65 Makefile
--- Makefile	21 Mar 2003 00:30:53 -0000	1.65
+++ Makefile	18 May 2003 22:35:14 -0000
@@ -127,8 +127,10 @@
 .PRECIOUS: init.c
 
 nm.h:
-	echo '#include "${GDB_CPU}/nm-fbsd.h"'	>${.TARGET}
+	echo '#include "tm.h"'			>${.TARGET}
+	echo '#include "${GDB_CPU}/nm-fbsd.h"'	>>${.TARGET}
 	echo '#include "fbsd-kgdb.h"'		>>${.TARGET}
+	echo '#include "fbsd-kgdb-${TARGET_ARCH}.h"'	>>${.TARGET}
 
 .for H in tm-fbsd xm-${GDB_CPU}
 ${H:C/-.*$//}.h:
Index: fbsd-kgdb-i386.h
===================================================================
RCS file: /dump/FreeBSD-CVS/src/gnu/usr.bin/binutils/gdb/fbsd-kgdb-i386.h,v
retrieving revision 1.3
diff -u -r1.3 fbsd-kgdb-i386.h
--- fbsd-kgdb-i386.h	18 Sep 2002 16:20:49 -0000	1.3
+++ fbsd-kgdb-i386.h	18 May 2003 22:20:04 -0000
@@ -20,10 +20,8 @@
 #undef  FRAME_SAVED_PC
 #define FRAME_SAVED_PC(FRAME) \
   (kernel_debugging \
-    ? fbsd_kern_frame_saved_pc (FRAME) : \
-    (FRAME)->signal_handler_caller \
-      ? sigtramp_saved_pc (FRAME) \
-      : read_memory_integer ((FRAME)->frame + 4, 4))
+    ? fbsd_kern_frame_saved_pc (FRAME) \
+    : i386bsd_frame_saved_pc (FRAME))
 
 /* Offset to saved PC in sigcontext, from <sys/signal.h>.  */
 #define SIGCONTEXT_PC_OFFSET 20



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200305182350.aa53905>