[vbox-dev] How to use GNU debugger on VBoxSVC ?

Frank Mehnert frank.mehnert at oracle.com
Mon May 11 07:41:01 UTC 2015


On Sunday 10 May 2015 12:17:35 Alexey Eromenko wrote:
> I have compiled VirtualBox with debug enabled:
> --build-debug
> $ gdb VBoxSVC
> But when trying to launch it, it exits.

don't forget to specify the path.

If VBoxSVC terminates immediately after you started it, there is most likely
another instance of VBoxSVC running. Make sure that VBoxSVC is not running
when you try this.

> user at debian7vm:~/VirtualBox-5.0.0_BETA2$ VirtualBox
> LOG_GROUP_MM='MM_HEAP' expects 'MM'
> Trace/breakpoint trap

In a debug build it's always preferable to start all builds with gdb. The
VBox code contains a lot of assertions and it is not unlikely that an
assertion is hit. This might or might not me a valid reason for a triggered

Therefore start VBoxSVC with gdb and start VirtualBox with gdb as well. If
you want to start a VM, do it directly with gdb ./VirtualBox --startvm ...
otherwise the VM process spawned by the VirtualBox selector is not started
with gdb. Once an assertion is hit, it might or might not make sense to
continue (gdb 'c' command).

Another mean to start a debug build is doing

  export VBOX_ASSERT=none

before you start anything. This will prevent the debug build to trigger
a breakpoint (which aborts the process if not started with gdb).

Kind regards,

Dr.-Ing. Frank Mehnert | Software Development Director, VirtualBox
ORACLE Deutschland B.V. & Co. KG | Werkstr. 24 | 71384 Weinstadt, Germany

ORACLE Deutschland B.V. & Co. KG
Hauptverwaltung: Riesstraße 25, D-80992 München
Registergericht: Amtsgericht München, HRA 95603

Komplementärin: ORACLE Deutschland Verwaltung B.V.
Hertogswetering 163/167, 3543 AS Utrecht, Niederlande
Handelsregister der Handelskammer Midden-Niederlande, Nr. 30143697
Geschäftsführer: Alexander van der Ven, Astrid Kepper, Val Maher

More information about the vbox-dev mailing list