Skip to content

Commit

Permalink
ovs-sandbox: Show the running program on xterm's title
Browse files Browse the repository at this point in the history
When debugging multiple programs under GDB, it will be easier to
identify xterms with the program name displayed as title. Without
this patch, xterms will have the title of "gdb", which is the first
program the xterm executes. This change is useful for the next patch.

Signed-off-by: Andy Zhou <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
azhou-nicira committed Feb 23, 2015
1 parent 2d79a60 commit 4cf272a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tutorial/ovs-sandbox
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@ run() {
}

run_xterm() {
run xterm -e "$@" &
title=$1;
shift
run xterm -T "$title" -e "$@" &
}

rungdb() {
Expand All @@ -33,7 +35,8 @@ rungdb() {
# Use "DISPLAY" variable to determine out if X is supported
if $under_gdb && [ "$DISPLAY" ]; then
args=`echo $@ |sed s/--detach//g | sed s/--vconsole:off//g`
run_xterm gdb --args $args
xterm_title=$1
run_xterm $xterm_title gdb --args $args
else
run $@
fi
Expand Down

0 comments on commit 4cf272a

Please sign in to comment.