WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] debugging xen ....

To: Himanshu Raj <rhim@xxxxxxxxxxxxx>
Subject: Re: [Xen-devel] debugging xen ....
From: Tim Newsham <newsham@xxxxxxxx>
Date: Tue, 23 Aug 2005 21:30:54 -1000 (HST)
Cc: xen-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Wed, 24 Aug 2005 07:29:28 +0000
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20050823224145.GI29191@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20050823224145.GI29191@xxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
After looking around for a howto and asking ppl on IRC, I had to come back
to the forum for this - how to debug xen?

Basically, I would love to be able to step through the code using gdb connected
serially to another machine.

Is there some functionality like that in Xen. I also found some emails 
referencing
a XenDebugger-HowTo, however I couldn't find that file anywhere.

Run the build script in xen-unstable.hg/tools/debugger/gdb.
Install the gdbserver and gdb (I put them in /usr/local/bin
  as gdbserver-xen and xengdb).
Build your kernel with debug.  I use the flags
  "verbose=y domu_debug=y debug=y".  although I dont know if these
  are all required.
Start up your domain (I use vm-tools and do all the steps except
  the vm-pause step).
Run gdbserver.  I run "gdbserver-xen 127.0.0.1:9999 --attach $dom"
Run gdb.  I run "xengdb -x remgdb" where remgdb has the command
  "target remote 127.0.0.1:9999" in it.

Tada, you're in a debugger.

I use the following script to automate this tedious process:

--- deb.sh ---
#!/bin/sh

run()
{
        echo "$*"
        $* || (echo 'failed'; exit 1)
}

# vm-create isnt giving us the right answer...
dom=`vm-create`
echo dom is $dom

run vm-memory -m $dom 64m
run vm-memory -i $dom 64m
run vm-build.linux $dom /root/kernel

echo done $dom
gdbserver-xen 127.0.0.1:9999 --attach $dom &
sleep 1
xengdb -x /root/remgdb

run vm-pause -u $dom
--- end deb.sh ---

Himanshu Raj
PhD Student, GaTech (www.cc.gatech.edu/~rhim)

Hope this helps,
Tim Newsham
http://www.lava.net/~newsham/

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>