Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 May 2008 17:29:35 +0200
From:      Juergen Lock <nox@jelal.kn-bremen.de>
To:        John Baldwin <jhb@freebsd.org>
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: kernel/kld debugging on amd64 (qemu gdbstub, gdbinit, asf(1)...)
Message-ID:  <20080501152935.GA2940@saturn.kn-bremen.de>
In-Reply-To: <200805011014.34348.jhb@freebsd.org>
References:  <20080501105138.GA30798@saturn.kn-bremen.de> <200805011014.34348.jhb@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thu, May 01, 2008 at 10:14:34AM -0400, John Baldwin wrote:
> On Thursday 01 May 2008 06:51:38 am Juergen Lock wrote:
> > Before I forget, here are some things I found out while debugging the
> > kqemu amd64 SMP issue...
> >
> > 1. I used a patched kgdb to be able to use it with qemu's gdbstub
> > (kgdb -r 127.1:1234 kernel.debug), that patch I already posted:
> > 	http://docs.freebsd.org/cgi/mid.cgi?20080304213153.GB15959
> > (Yeah you can also used regular gdb or gdb66 from ports with qemu's
> > gdbstub, but those don't understand kernel stack frames and maybe
> > other things...)
> 
> This patch just went into the tree (a variant of it) in the commits to kgdb in 
> HEAD earlier this week.
> 
Ah cool!

> > 2. the ps and kldstat macros from src/tools/debugscripts/gdbinit.kernel
> > (and probably others) use %08x for pointers, so on 64 bit archs like amd64
> > the upper half gets chopped off.  I didn't fix this correctly tho, but
> > instead defined my own ps64 and kldstat64 macros using %016lx...
> 
> Try using macros at www.freebsd.org/~jhb/gdb/gdb6 instead as they handle 
> 64-bit vs 32-bit.
> 
 Ah, good to know for next time...

> > 3. asf(1) also didn't work correctly for amd64 (bss and data were wrong),
> > here is the patch I ended up using: (maybe you want to ifdef for amd64
> > instead of checking for zero VMA tho)
> 
> I haven't seen this, but I also haven't used asf(8) on amd64.  You can grab 
> the kgdb sources from HEAD though and then you can use kgdb's native kld 
> support (i.e. add-kld and the shared library stuff) for remote targets to 
> load symbols.
> 
 OK, will try next time. :)

 Thanx,
	Juergen



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