Hi, I was just wondering if it is possible to debug a live Xen domain with mdb i.e. use mdb on a running domain? I know that it is possible to debug a domain with mdb using a crash dump. I couldn''t find anything about using mdb on a live domain though so I thought I''d ask here. -Padraig This message posted from opensolaris.org
Padraig O''Sullivan wrote:> Hi, > > I was just wondering if it is possible to debug a live Xen domain with > mdb i.e. use mdb on a running domain? > > I know that it is possible to debug a domain with mdb using a crash dump. > I couldn''t find anything about using mdb on a live domain though so I > thought I''d ask here.If you invoke # mdb -k in your desired domain without any other args, I would expect that you should be able to debug the live domain just as with a non-xVM installation. James C. McPherson -- Senior Kernel Software Engineer, Solaris Sun Microsystems http://blogs.sun.com/jmcp http://www.jmcp.homeunix.com/blog
Thanks for the reply but I don''t think I phrased my original question very well (apologies for that). I understand that I can use mdb as you stated inside a guest domain. My question is whether it is possible to use mdb on the control domain to debug a guest domain and do things like set a breakpoint on the domain being debugged (as 1 example of what should be possible if I could do this)? This could be a stupid question but I thought it would be a cool thing to try out. If there is some reason why it is not possible to do this, I''d appreciate if anyone could explain why to me. I don''t expect this to be possible if the guest domain is running Linux, Windows, etc. since I would be surprised if mdb supports these targets but in theory, I thought it could be possible to do if the guest domain is running Solaris. -Padraig This message posted from opensolaris.org
Padraig O''Sullivan wrote:> Thanks for the reply but I don''t think I phrased my original question very well (apologies for that). I understand that I can use mdb as you stated inside a guest domain. > > My question is whether it is possible to use mdb on the control domain to debug a guest domain and do things like set a breakpoint on the domain being debugged (as 1 example of what should be possible if I could do this)? This could be a stupid question but I thought it would be a cool thing to try out. If there is some reason why it is not possible to do this, I''d appreciate if anyone could explain why to me. >I don''t think you can debug a running domain from dom0 using mdb at this point. AFAIK, dom0 cannot freely access memory pages which belongs to a domU. Explicit access permission needs to be granted by the domU before dom0 can access the page (map it into dom0''s address space and write to it, say, set a break point). Max> I don''t expect this to be possible if the guest domain is running Linux, Windows, etc. since I would be surprised if mdb supports these targets but in theory, I thought it could be possible to do if the guest domain is running Solaris. > > -Padraig > > > This message posted from opensolaris.org > _______________________________________________ > xen-discuss mailing list > xen-discuss@opensolaris.org >
On Mon, Aug 25, 2008 at 10:06:58AM +0800, Max Zhen wrote:> > My question is whether it is possible to use mdb on the control domain to debug a guest domain and do things like set a breakpoint on the domain being debugged (as 1 example of what should be possible if I could do this)? This could be a stupid question but I thought it would be a cool thing to try out. If there is some reason why it is not possible to do this, I''d appreciate if anyone could explain why to me. > > > I don''t think you can debug a running domain from dom0 using mdb at this > point. > AFAIK, dom0 cannot freely access memory pages which belongs to a domU. > Explicit access permission needs to be granted by the domU before dom0 > can access the page (map it into dom0''s address space and write to it, > say, set a break point).Actually, this isn''t true: if it was, then virsh dump wouldn''t be able to work. dom0 can map all of a guest''s memory. Padraig: you''re right it would be a cool thing to do, and I''ve wanted this for quite a while. There''s actually not that many changes needed to mdb for this to happen. The code that understands how to bootstrap mdb into a Xen domain already exists (mdb_kb). The main missing part is an implementation of vread/write that knows to use the hypercall that maps in domU memory. regards john
Thanks for the info John. Thats awesome that its possible. It would be fun to play around with if it was possible in practice. In regards to making this happen, I need to do a project for a grad class on HPC I will be taking in the Fall and I think something like this would be really cool. Do you think there would be enough work in this to make it a semester long project? -Padraig This message posted from opensolaris.org