Skip to contentSkip to conversation

How do you debug Xen?

DISCUSSION Emre Can Sezer 2 participants 4 messages Jan 9, 2009 – Jan 28, 2009

lore
Share & tools
lore
#0 lore raw

Hi,

I want to use a debugger to debug some code I wrote in the hypervisor. What is the best way to go about this? I would appreciate any links or info.

The only thing I found was enabling gdbstub and using gdb remotely via serial cable. Is there an example on how to set this up? The examples in kgdb website refer to linux, so I'm hoping to get something
more specific. I tried to look through the mailing list archives but
couldn't find anything but the patches.

And if I'm trying to debug a 64-bit Xen, can I do this from a 32-bit remote machine?

Thanks,

John

#1 lore raw

Debugging Xen via serial console

I'm trying to debug Xen remotely using serial port. I followed the instructions on the following post made in this xen-devel list:
http://lists.xensource.com/archives/html/xen-devel/2007-12/msg00678.html

I was able to connect gdb but I ran into a problem where even after I clear all the breakpoints, execution traps into gdb with SIGTRAP at restore_all_xen(). This only happens if I set a breakpoint and then try to continue after hitting the break point. If I simply connect gdb but continue without setting any breakpoints, everything is OK.

The post mentions some stability issues and I haven't seen any follow ups. Is this still a viable debugging method? Or is there some other method I should try?

Thanks in advance,

John

#2 lore raw

Re: Debugging Xen via serial console

Hi John,

The patches I submitted quickly fell out of sync with the 3.2 unstable branch at the time. I found a month or so later they stopped working, and I didnt have the time to keep them up to date.
For Xen debugging, have you tried the kdb branch maintained my Mukesh Rathor (Oracle)? I used this a few months ago and it seemed to work. The branch is off the mainline, however. Its usage is documented in the xen wiki pages, I believe.

If you would prefer to use gdb, the functionality should be easy to resurrect. There really wasnt much to it.
I would recommend using my serial port splitter (ssplitd.c), which I found easier to use and was complete in its implementation. I submitted all the changes in proper patch form after the posting you referenced above, if you are interested.

Dan.

Quoted 21 lines · Emre Can Sezer

I'm trying to debug Xen remotely using serial port. I followed the instructions on the following post made in this xen-devel list:
http://lists.xensource.com/archives/html/xen-devel/2007-12/msg00678.html

I was able to connect gdb but I ran into a problem where even after I clear all the breakpoints, execution traps into gdb with SIGTRAP at restore_all_xen(). This only happens if I set a breakpoint and then try to continue after hitting the break point. If I simply connect gdb but continue without setting any breakpoints, everything is OK.

The post mentions some stability issues and I haven't seen any follow ups.
Is this still a viable debugging method? Or is there some other method I
should try?

Thanks in advance,

John

Quoted 5 lines

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#3 lore raw

Re: Debugging Xen via serial console

Hi Dan,

I'm currently using your version of ssplitd as it is. I haven't tried kdb. For some reason I thought that was for debugging guest domains. I'll look into it. As for resurrecting the gdbstub, I'm *NOT* familiar enough with it to try it myself. I do have a few people here who might be though. I'll post something if we get it working.

Thanks,

John

Quoted 43 lines · Dan Doucette

Hi John,

The patches I submitted quickly fell out of sync with the 3.2 unstable branch at the time. I found a month or so later they stopped working, and I didnt have the time to keep them up to date.
For Xen debugging, have you tried the kdb branch maintained my Mukesh Rathor (Oracle)? I used this a few months ago and it seemed to work. The branch is off the mainline, however. Its usage is documented in the xen wiki pages, I believe.

If you would prefer to use gdb, the functionality should be easy to resurrect. There really wasnt much to it.
I would recommend using my serial port splitter (ssplitd.c), which I found easier to use and was complete in its implementation. I submitted all the changes in proper patch form after the posting you referenced above, if you are interested.

Dan.

On Wed, Jan 28, 2009 at 10:53 AM, Emre Can Sezer <[email protected] <mailto:[email protected]>> wrote:

I'm trying to debug Xen remotely using serial port. I followed the instructions on the following post made in this xen-devel list:
http://lists.xensource.com/archives/html/xen-devel/2007-12/msg00678.html

I was able to connect gdb but I ran into a problem where even after I clear all the breakpoints, execution traps into gdb with SIGTRAP at restore_all_xen(). This only happens if I set a breakpoint and then try to continue after hitting the break point.
If I simply connect gdb but continue without setting any
breakpoints, everything is OK.

The post mentions some stability issues and I haven't seen any follow ups. Is this still a viable debugging method? Or is there some other method I should try?

Thanks in advance,

John

_______________________________________________
Xen-devel mailing list
[email protected] <mailto:[email protected]>
http://lists.xensource.com/xen-devel