HomeFreeBSD

bhyve: Move the gdb_active check to gdb_cpu_suspend().

Description

bhyve: Move the gdb_active check to gdb_cpu_suspend().

The check needs to be in the public routine (gdb_cpu_suspend()), not
in the internal routine called from various places
(_gdb_cpu_suspend()). All the other callers of _gdb_cpu_suspend()
already check gdb_active, and this breaks the use of snapshots when
the debug server is not enabled since gdb_cpu_suspend() tries to lock
an uninitialized mutex.

Reported by: Darius Mihai, Elena Mihailescu
Reviewed by: elenamihailescu22_gmail.com
Fixes: 621b5090487de9fed1b503769702a9a2a27cc7bb
Differential Revision: https://reviews.freebsd.org/D29538

(cherry picked from commit eacc27affeff17beb3791793ba54458444df7135)