From: Michal Ostrowski Subject: Re: debugging xen .... Date: Mon, 29 Aug 2005 10:35:11 -0400 Message-ID: <20050829103511.34a4ca33@brick.watson.ibm.com> References: <20050823224145.GI29191@cc.gatech.edu> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============1748125159==" Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Mime-version: 1.0 Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org --===============1748125159== Content-Type: multipart/signed; boundary=Signature_Mon__29_Aug_2005_10_35_11_-0400_ZHD.mp4IQqpfieli; protocol="application/pgp-signature"; micalg=pgp-sha1 --Signature_Mon__29_Aug_2005_10_35_11_-0400_ZHD.mp4IQqpfieli Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable I've been trying this approach, trying xend tools and vm-tools. I actually make the most progress using xend tools. I'm able to create a domain (paused), set up the gdbserver, connect gdb and set a breakpoint. I can then unpause the domain and it runs until it hits the breakpoint I set (which is in netfront.c). However, when that breakpoint is hit, the domU kernel oopses, rather than re-directing the exception to the gdbserver. Did I miss something? (And with vm-tools when I unpause the domain I get one line of console output and that's all.) --=20 Michal Ostrowski On Tue, 23 Aug 2005 21:30:54 -1000 (HST) Tim Newsham wrote: > > After looking around for a howto and asking ppl on IRC, I had to come b= ack > > to the forum for this - how to debug xen? > > > > Basically, I would love to be able to step through the code using gdb c= onnected > > 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. >=20 > 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=3Dy domu_debug=3Dy debug=3Dy". 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. >=20 > Tada, you're in a debugger. >=20 > I use the following script to automate this tedious process: >=20 > --- deb.sh --- > #!/bin/sh >=20 > run() > { > echo "$*" > $* || (echo 'failed'; exit 1) > } >=20 > # vm-create isnt giving us the right answer... > dom=3D`vm-create` > echo dom is $dom >=20 > run vm-memory -m $dom 64m > run vm-memory -i $dom 64m > run vm-build.linux $dom /root/kernel >=20 > echo done $dom > gdbserver-xen 127.0.0.1:9999 --attach $dom & > sleep 1 > xengdb -x /root/remgdb >=20 > run vm-pause -u $dom > --- end deb.sh --- >=20 > > Himanshu Raj > > PhD Student, GaTech (www.cc.gatech.edu/~rhim) >=20 > Hope this helps, > Tim Newsham > http://www.lava.net/~newsham/ >=20 > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel --Signature_Mon__29_Aug_2005_10_35_11_-0400_ZHD.mp4IQqpfieli Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.5 (GNU/Linux) iD8DBQFDEx0fDMDCqU5zPMARAhWMAJ96+KTInH3fHgfedVcLtSQVoV4jlQCbBTve LIFc0BNxwBqHGJDZturCBoU= =6Tgn -----END PGP SIGNATURE----- --Signature_Mon__29_Aug_2005_10_35_11_-0400_ZHD.mp4IQqpfieli-- --===============1748125159== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --===============1748125159==--