Problems with IMachineDebugger

Discussion about using the VirtualBox API, Tutorials, Samples.
Post Reply
Wldz
Posts: 9
Joined: 31. Dec 2014, 02:39

Problems with IMachineDebugger

Post by Wldz »

Hello,
I just want to know how to initialize the IMachineDebugger object in java? As I am using Virtualbox API 4.3. I want to use dumpGuestCore method of this class. Please help me out.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Problems with IMachineDebugger

Post by noteirak »

Which type of bindings are you using (WebServices, XPCOM, MSCOM)?
Do you already have some code, even if it doesn't work?
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Wldz
Posts: 9
Joined: 31. Dec 2014, 02:39

Re: Problems with IMachineDebugger

Post by Wldz »

I am using XPCOM binding. I am just stuck here on the initialization step.

Code: Select all


        IMachineDebugger dump = new IMachineDebugger(null);
        dump.dumpGuestCore("wal", "s");

this what i am trying to do so far :(
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Problems with IMachineDebugger

Post by noteirak »

Ok, I understand the issue. You cannot create the object yourself, you need to retrieve it from the API objects. Have you read the introduction section in the SKDRef.pdf file that comes with the SDK? Esepcially section 10.3 which deals with Java specifics.
The IMachineDebugger can be obtained via the IConsole object, which is accessible via a mutable IMachine object from a ISession obejct. so in pseudo-code, it would look something like this :

Code: Select all

ISession sess = VirtualBoxManager.getSessionObject();
IMachine vm = IVirtualbox.getMachine();
vm.lock(sess,LockType.Shared);
IMachineDebugger dbg = sess.getMachine().getConsole().getDebugger();
// do stuff
sess.unlockVm(); // very important!
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Wldz
Posts: 9
Joined: 31. Dec 2014, 02:39

Re: Problems with IMachineDebugger

Post by Wldz »

Thanks for your help and yes I had gone that chapter but I will again look through it..
Wldz
Posts: 9
Joined: 31. Dec 2014, 02:39

Re: Problems with IMachineDebugger

Post by Wldz »

I am also facing some problems in opening the the dump file which I get using this method.

Code: Select all

dump.dumpGuestCore("/home/waleed/asdf","");
Can you tell me how to open this output file to whats really in there in the file.
noteirak
Site Moderator
Posts: 5229
Joined: 13. Jan 2012, 11:14
Primary OS: Debian other
VBox Version: OSE Debian
Guest OSses: Debian, Win 2k8, Win 7
Contact:

Re: Problems with IMachineDebugger

Post by noteirak »

I have no knowledge of the dump format. If you need a fast answer, I would suggest you ask on the dev IRC channel or the dev mailing list.
Else, devs tend to come read this forum from time to time.
Hyperbox - Virtual Infrastructure Manager - https://apps.kamax.lu/hyperbox/
Manage your VirtualBox infrastructure the free way!
Post Reply