Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115684479
D40986.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D40986.diff
View Options
diff --git a/usr.sbin/bhyve/Makefile b/usr.sbin/bhyve/Makefile
--- a/usr.sbin/bhyve/Makefile
+++ b/usr.sbin/bhyve/Makefile
@@ -28,7 +28,6 @@
crc16.c \
ctl_scsi_all.c \
ctl_util.c \
- gdb.c \
hda_codec.c \
iov.c \
mem.c \
@@ -67,6 +66,14 @@
.include "${MACHINE_CPUARCH}/Makefile.inc"
+.if defined(BHYVE_GDB_SUPPORT)
+SRCS+= gdb.c
+CFLAGS+= -DBHYVE_GDB
+.ifdef GDB_LOG
+CFLAGS+=-DGDB_LOG
+.endif
+.endif
+
CFLAGS+=-I${.CURDIR} \
-I${.CURDIR}/../../contrib/lib9p \
-I${SRCTOP}/sys
@@ -102,10 +109,6 @@
CFLAGS+= -DBHYVE_SNAPSHOT
.endif
-.ifdef GDB_LOG
-CFLAGS+=-DGDB_LOG
-.endif
-
# Disable thread safety analysis since it only finds very simple bugs and
# yields many false positives.
NO_WTHREAD_SAFETY=
diff --git a/usr.sbin/bhyve/amd64/Makefile.inc b/usr.sbin/bhyve/amd64/Makefile.inc
--- a/usr.sbin/bhyve/amd64/Makefile.inc
+++ b/usr.sbin/bhyve/amd64/Makefile.inc
@@ -1,3 +1,5 @@
+BHYVE_GDB_SUPPORT=
+
SRCS+= \
atkbdc.c \
e820.c \
diff --git a/usr.sbin/bhyve/bhyverun.c b/usr.sbin/bhyve/bhyverun.c
--- a/usr.sbin/bhyve/bhyverun.c
+++ b/usr.sbin/bhyve/bhyverun.c
@@ -86,7 +86,9 @@
#include "amd64/e820.h"
#include "amd64/fwctl.h"
#endif
+#ifdef BHYVE_GDB
#include "gdb.h"
+#endif
#ifdef __amd64__
#include "amd64/ioapic.h"
#include "amd64/kernemu_dev.h"
@@ -463,7 +465,9 @@
#ifdef BHYVE_SNAPSHOT
checkpoint_cpu_add(vi->vcpuid);
#endif
+#ifdef BHYVE_GDB
gdb_cpu_add(vi->vcpu);
+#endif
vm_loop(vi->ctx, vi->vcpu);
@@ -757,6 +761,7 @@
fclose(fp);
}
+#ifdef BHYVE_GDB
static void
parse_gdb_options(const char *opt)
{
@@ -780,6 +785,7 @@
set_config_value("gdb.port", sport);
}
+#endif
static void
set_defaults(void)
@@ -852,9 +858,11 @@
errx(EX_USAGE, "invalid fwcfg item '%s'", optarg);
}
break;
+#ifdef BHYVE_GDB
case 'G':
parse_gdb_options(optarg);
break;
+#endif
case 'k':
parse_simple_config_file(optarg);
break;
@@ -1091,7 +1099,9 @@
if (get_config_bool("acpi_tables"))
vmgenc_init(ctx);
+#ifdef BHYVE_GDB
init_gdb(ctx);
+#endif
#ifdef __amd64__
if (lpc_bootrom()) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Apr 28, 2:48 AM (14 h, 47 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17824746
Default Alt Text
D40986.diff (2 KB)
Attached To
Mode
D40986: bhyve: Make gdb support optional
Attached
Detach File
Event Timeline
Log In to Comment