[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] Debugging Dom0 kernel over serial



On Wed, 6 Jun 2012 10:13:44 +0100
Ian Campbell <Ian.Campbell@xxxxxxxxxx> wrote:

> On Wed, 2012-06-06 at 00:24 +0100, James Paton wrote:
> > Hi,
> > 
> > Apologies if this is not the appropriate list, but I thought I
> > would have better luck here than on xen-users.
> > 
> > I'm a CS graduate student hacking on the xen-blkback driver and
> > would like to be able to debug it using gdb over serial. I have
> > spent a great deal of time on this with no success (more details
> > can be found at http://bit.ly/KMEF6o (Stack Overflow)). 
> > 
> > It eventually occurred to me that it might not even be possible to
> > do what I'm trying to do if Xen intercepts interrupts from the
> > serial port and tries to direct them to dom0 through some
> > unexpected channel. Then, after I've done `echo g
> > > /proc/sysrq_trigger`, the kernel debugger might not see the
> > > interrupt. Can anyone confirm or disconfirm this? 
> 
> It's not something I've ever tried but I expect that if you avoid
> console=com1 (or com*) on your hypervisor command line then the com
> port should be available for dom0 just like on native.
> 
> Alternatively you could perhaps separate the two by using com1 for Xen
> and com2/ttyS1 for dom0/kdb etc.
> 
> I've no idea if kdb would be expected to work over hvc*. I suspect
> you'd be treading fresh ground with that one...
> 
> I'd also start by taking virtual box out of the equation on the host
> side. Start by using a MacOS terminal emulator and checking that you
> can see the dom0 console messages and login via a getty running on
> ttyS0 before trying to hook up gdb.
> 
> > What is the usual procedure for debugging the Dom0 kernel?
> 
> Printk ;-)
> 
> Ian.


I wrote up a debugger for xen, also (mis)named kdb. It halts the 
system, lets you poke memory, data structs, set breakpoints, etc.
To use it, you must have prior experience of a kernel debugger. I
am attaching patch build for changeset 25287 in unstable tree, if you
wanna try it. Start with kdb/README.

Mukesh

Attachment: kdb.patch
Description: Text Data

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.