diff options
Diffstat (limited to 'usr/src/cmd/bhyve/bhyverun.c')
-rw-r--r-- | usr/src/cmd/bhyve/bhyverun.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/usr/src/cmd/bhyve/bhyverun.c b/usr/src/cmd/bhyve/bhyverun.c index e3c56bdbd0..18bfda76f0 100644 --- a/usr/src/cmd/bhyve/bhyverun.c +++ b/usr/src/cmd/bhyve/bhyverun.c @@ -1337,8 +1337,20 @@ main(int argc, char *argv[]) if (dbg_port != 0) init_dbgport(dbg_port); +#ifdef __FreeBSD__ if (gdb_port != 0) init_gdb(ctx, gdb_port, gdb_stop); +#else + if (gdb_port < 0) { + /* + * Set up the internal gdb state needed for basic debugging, but + * skip the step of listening on a port for the GDB server. + */ + init_mdb(ctx, gdb_stop); + } else if (gdb_port != 0) { + init_gdb(ctx, gdb_port, gdb_stop); + } +#endif if (bvmcons) init_bvmcons(); |