diff options
author | neel <neel@FreeBSD.org> | 2013-03-28 18:03:39 +0000 |
---|---|---|
committer | neel <neel@FreeBSD.org> | 2013-03-28 18:03:39 +0000 |
commit | 901ef782ed69d267755f188d4a7e3ce88fc6bfec (patch) | |
tree | e50e2c3c0a19a06fc739b8d7c03ef52833b825cd | |
parent | 59a1dc12984eb27c79856a7c0268a833f914546d (diff) | |
download | FreeBSD-src-901ef782ed69d267755f188d4a7e3ce88fc6bfec.zip FreeBSD-src-901ef782ed69d267755f188d4a7e3ce88fc6bfec.tar.gz |
Add the "-g <gdport>" option to the vmrun.sh script that enables remote
debugging of the guest via kgdb.
See also: https://wiki.freebsd.org/BHyVe/gdb
Obtained from: NetApp
-rwxr-xr-x | share/examples/bhyve/vmrun.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/share/examples/bhyve/vmrun.sh b/share/examples/bhyve/vmrun.sh index 870c4dd..73a7162 100755 --- a/share/examples/bhyve/vmrun.sh +++ b/share/examples/bhyve/vmrun.sh @@ -39,11 +39,12 @@ DEFAULT_VIRTIO_DISK="./diskdev" DEFAULT_ISOFILE="./release.iso" usage() { - echo "Usage: vmrun.sh [-hai][-m <memsize>][-d <disk file>][-I <location of installation iso>][-t <tapdev>] <vmname>" + echo "Usage: vmrun.sh [-hai][-g <gdbport>][-m <memsize>][-d <disk file>][-I <location of installation iso>][-t <tapdev>] <vmname>" echo " -h: display this help message" echo " -a: force memory mapped local apic access" echo " -c: number of virtual cpus (default is ${DEFAULT_CPUS})" echo " -d: virtio diskdev file (default is ${DEFAULT_VIRTIO_DISK})" + echo " -g: listen for connection from kgdb at <gdbport>" echo " -i: force boot of the Installation CDROM image" echo " -I: Installation CDROM image location (default is ${DEFAULT_ISOFILE})" echo " -m: memory size in MB (default is ${DEFAULT_MEMSIZE}MB)" @@ -71,8 +72,9 @@ cpus=${DEFAULT_CPUS} virtio_diskdev=${DEFAULT_VIRTIO_DISK} tapdev=${DEFAULT_TAPDEV} apic_opt="" +gdbport=0 -while getopts haic:I:m:d:t: c ; do +while getopts haic:g:I:m:d:t: c ; do case $c in h) usage @@ -83,6 +85,8 @@ while getopts haic:I:m:d:t: c ; do d) virtio_diskdev=${OPTARG} ;; + g) gdbport=${OPTARG} + ;; i) force_install=1 ;; @@ -164,7 +168,8 @@ while [ 1 ]; do break fi - ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P -g 0 \ + ${FBSDRUN} -c ${cpus} -m ${memsize} ${apic_opt} -AI -H -P \ + -g ${gdbport} \ -s 0:0,hostbridge \ -s 1:0,virtio-net,${tapdev} \ -s 2:0,virtio-blk,${virtio_diskdev} \ |