DIVISION OF ENGINEERING AND APPLIED
SCIENCES
HARVARD UNIVERSITY
CS 161. Operating SystemsSpring 2005 Using screen(1) for Debugging
By Philip Zeyliger |
You're going to be spending a lot of time in front of GDB this semester. It's worthwhile to invest some time now into your environment. I found it frustrating to setup the two windows needed for connecting gdb to a kernel, so I used screen(1) to split one (bigger) terminal into two, thereby enabling me to interact with kernel and gdb in one window, like so:

bindkey -k k1 screen 1 bindkey -k k2 screen 2 bind q quit bind j focus down bind k focus up startup_message off deflogin off screen -t "sys161" 1 stuff "pushd ~/cs161/root^M" stuff "sys161 -w kernel^M" split focus down screen -t "GDB" 2 stuff "pushd ~/cs161/root^M" stuff "cs161-gdb kernel^M" sleep 1 stuff "db161^M"
cd /nfs/home/U/S/USERNAME/cs161/src/kern/compile/ASST5 define db161 target remote unix:/nfs/home/U/S/USERNAME/cs161/root/.sockets/gdb b panic end