mirror of
https://github.com/justinian/jsix.git
synced 2025-12-09 16:04:32 -08:00
[tools] Make qemu.sh debugcon output optional
I got sick of closing the debugcon window all the time when I only need it sometimes, so it's now gated behind the '-x' option to qemu.sh.
This commit is contained in:
27
qemu.sh
27
qemu.sh
@@ -9,6 +9,7 @@ gfx="-nographic"
|
|||||||
vga="-vga none"
|
vga="-vga none"
|
||||||
log=""
|
log=""
|
||||||
kvm=""
|
kvm=""
|
||||||
|
debugcon_cmd=""
|
||||||
cpu_features=",+pdpe1gb,+invtsc,+hypervisor,+x2apic,+xsavec,+xsaves,+xsaveopt"
|
cpu_features=",+pdpe1gb,+invtsc,+hypervisor,+x2apic,+xsavec,+xsaves,+xsaveopt"
|
||||||
cpu="Broadwell"
|
cpu="Broadwell"
|
||||||
smp=4
|
smp=4
|
||||||
@@ -36,8 +37,8 @@ while true; do
|
|||||||
;;
|
;;
|
||||||
-r | --remote)
|
-r | --remote)
|
||||||
shift
|
shift
|
||||||
vnchost="${1:-${VNCHOST:-localhost}}"
|
vnchost="${1:-${VNCHOST:-"localhost:5500"}}"
|
||||||
gfx="-vnc ${vnchost}:5500,reverse"
|
gfx="-vnc ${vnchost},reverse"
|
||||||
vga=""
|
vga=""
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
@@ -54,6 +55,10 @@ while true; do
|
|||||||
log="-d mmu,int,guest_errors -D jsix.log"
|
log="-d mmu,int,guest_errors -D jsix.log"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
|
-x | --debugcon)
|
||||||
|
debugcon_cmd="less --follow-name -R +F debugcon.log"
|
||||||
|
shift
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
if [ -d "$1" ]; then
|
if [ -d "$1" ]; then
|
||||||
build="$1"
|
build="$1"
|
||||||
@@ -74,29 +79,37 @@ fi
|
|||||||
|
|
||||||
if [[ -n $TMUX ]]; then
|
if [[ -n $TMUX ]]; then
|
||||||
cols=$(tput cols)
|
cols=$(tput cols)
|
||||||
|
log_width=100
|
||||||
|
|
||||||
if [[ -n $debug ]]; then
|
if [[ -n $debug ]]; then
|
||||||
log_width=100
|
log_cols=1
|
||||||
gdb_width=$(($cols - 2 * $log_width))
|
if [[ $debugcon_cmd ]]; then
|
||||||
|
log_cols=2
|
||||||
|
fi
|
||||||
|
|
||||||
debugcon_cmd="less --follow-name -r +F debugcon.log"
|
gdb_width=$(($cols - $log_cols * $log_width))
|
||||||
|
|
||||||
if (($gdb_width < 150)); then
|
if (($gdb_width < 150)); then
|
||||||
stack=1
|
stack=1
|
||||||
gdb_width=$(($cols - $log_width))
|
gdb_width=$(($cols - $log_width))
|
||||||
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
||||||
|
if [[ $debugcon_cmd ]]; then
|
||||||
tmux select-pane -t .left
|
tmux select-pane -t .left
|
||||||
tmux split-window -v "$debugcon_cmd"
|
tmux split-window -v "$debugcon_cmd"
|
||||||
tmux select-pane -t .right
|
fi
|
||||||
else
|
else
|
||||||
|
if [[ $debugcon_cmd ]]; then
|
||||||
tmux split-window -h -l $(($log_width + $gdb_width)) "$debugcon_cmd"
|
tmux split-window -h -l $(($log_width + $gdb_width)) "$debugcon_cmd"
|
||||||
|
fi
|
||||||
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
tmux split-window -h -l $gdb_width "gdb ${debugtarget}"
|
||||||
tmux select-pane -t .left
|
tmux select-pane -t .left
|
||||||
tmux select-pane -t .right
|
tmux select-pane -t .right
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
tmux split-window -h -l 100 "less --follow-name -r +F debugcon.log"
|
if [[ $debugcon_cmd ]]; then
|
||||||
|
tmux split-window -h -l $log_width "$debugcon_cmd"
|
||||||
tmux last-pane
|
tmux last-pane
|
||||||
|
fi
|
||||||
tmux split-window -l 10 "sleep 1; telnet localhost 45454"
|
tmux split-window -l 10 "sleep 1; telnet localhost 45454"
|
||||||
fi
|
fi
|
||||||
elif [[ $DESKTOP_SESSION = "i3" ]]; then
|
elif [[ $DESKTOP_SESSION = "i3" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user