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

next in thread | previous in thread | raw e-mail | index | archive | help
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.

> 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.

> 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.

-- 
John Baldwin



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