#!/bin/bash # Run a gdb session with a console attaced. [ -z "$3" ] && echo "usage: $0 [ ...]" && exit 1 echo This tty is `tty`. echo Starting console on $1, baudrate $2. ## This uses dtach + picocom. ## http://zwizwa.be/darcs/pool/bin/serial-attach # This is a loop as it will catch the C-c (trap ' ' 2; while sleep 1; do serial-attach $1 $2v; done) & # stty -F $1 $2 # cat $1 & shift shift "$@" echo Killing console. kill %1