From owner-freebsd-current@FreeBSD.ORG Sun May 18 15:50:58 2003 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C061837B401; Sun, 18 May 2003 15:50:58 -0700 (PDT) Received: from salmon.maths.tcd.ie (salmon.maths.tcd.ie [134.226.81.11]) by mx1.FreeBSD.org (Postfix) with SMTP id 5D51B43F3F; Sun, 18 May 2003 15:50:57 -0700 (PDT) (envelope-from iedowse@maths.tcd.ie) Received: from walton.maths.tcd.ie by salmon.maths.tcd.ie with SMTP id ; 18 May 2003 23:50:56 +0100 (BST) To: obrien@freebsd.org In-Reply-To: Your message of "Sun, 18 May 2003 15:14:57 PDT." <20030518221457.GA4531@dragon.nuxi.com> Date: Sun, 18 May 2003 23:50:56 +0100 From: Ian Dowse Message-ID: <200305182350.aa53905@salmon.maths.tcd.ie> cc: current@freebsd.org Subject: Re: kgdb missing stack frames X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 May 2003 22:50:59 -0000 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 . */ #define SIGCONTEXT_PC_OFFSET 20