Re: kgdb missing stack frames

From: Ian Dowse <iedowse_at_maths.tcd.ie>
Date: Sun, 18 May 2003 23:50:56 +0100
In message <20030518221457.GA4531_at_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
_at__at_ -127,8 +127,10 _at__at_
 .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
_at__at_ -20,10 +20,8 _at__at_
 #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
Received on Sun May 18 2003 - 13:50:58 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:37:08 UTC