]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
bhyve: Move the gdb_active check to gdb_cpu_suspend().
authorJohn Baldwin <jhb@FreeBSD.org>
Mon, 12 Apr 2021 18:43:34 +0000 (11:43 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Mon, 12 Apr 2021 18:43:34 +0000 (11:43 -0700)
commiteacc27affeff17beb3791793ba54458444df7135
tree4d9a07f4477a6d3366e2b165cf0d7d416d28b55b
parent600bd6ce0639c84b763516477250df5964e8edf6
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
usr.sbin/bhyve/gdb.c