From dda17b3672f2c7f661699a69ea4462710a52480d Mon Sep 17 00:00:00 2001 From: Conrad Meyer Date: Thu, 17 Oct 2019 21:33:01 +0000 Subject: Implement NetGDB(4) NetGDB(4) is a component of a system using a panic-time network stack to remotely debug crashed FreeBSD kernels over the network, instead of traditional serial interfaces. There are three pieces in the complete NetGDB system. First, a dedicated proxy server must be running to accept connections from both NetGDB and gdb(1), and pass bidirectional traffic between the two protocols. Second, the NetGDB client is activated much like ordinary 'gdb' and similarly to 'netdump' in ddb(4) after a panic. Like other debugnet(4) clients (netdump(4)), the network interface on the route to the proxy server must be online and support debugnet(4). Finally, the remote (k)gdb(1) uses 'target remote :' (like any other TCP remote) to connect to the proxy server. The NetGDB v1 protocol speaks the literal GDB remote serial protocol, and uses a 1:1 relationship between GDB packets and sequences of debugnet packets (fragmented by MTU). There is no encryption utilized to keep debugging sessions private, so this is only appropriate for local segments or trusted networks. Submitted by: John Reimer (earlier version) Discussed some with: emaste, markj Relnotes: sure Differential Revision: https://reviews.freebsd.org/D21568 --- sys/sys/kdb.h | 3 +++ sys/sys/param.h | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) (limited to 'sys/sys') diff --git a/sys/sys/kdb.h b/sys/sys/kdb.h index 75f8343b8428..a70e88627718 100644 --- a/sys/sys/kdb.h +++ b/sys/sys/kdb.h @@ -31,6 +31,7 @@ #ifndef _SYS_KDB_H_ #define _SYS_KDB_H_ +#include #include struct pcb; @@ -61,6 +62,8 @@ struct kdb_dbbe { }; \ DATA_SET(kdb_dbbe_set, name##_dbbe) +SET_DECLARE(kdb_dbbe_set, struct kdb_dbbe); + extern u_char kdb_active; /* Non-zero while in debugger. */ extern int debugger_on_trap; /* enter the debugger on trap. */ extern struct kdb_dbbe *kdb_dbbe; /* Default debugger backend or NULL. */ diff --git a/sys/sys/param.h b/sys/sys/param.h index 561015c0568b..2c1f8b46305d 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -60,7 +60,7 @@ * in the range 5 to 9. */ #undef __FreeBSD_version -#define __FreeBSD_version 1300052 /* Master, propagated to newvers */ +#define __FreeBSD_version 1300053 /* Master, propagated to newvers */ /* * __FreeBSD_kernel__ indicates that this system uses the kernel of FreeBSD, -- cgit v1.2.3