2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-22 09:58:01 +00:00

ovs-sandbox: Show the running program on xterm's title

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 <azhou@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Andy Zhou 2015-02-20 12:55:25 -08:00
parent 2d79a600a6
commit 4cf272aaf6

View File

@ -21,7 +21,9 @@ run() {
} }
run_xterm() { run_xterm() {
run xterm -e "$@" & title=$1;
shift
run xterm -T "$title" -e "$@" &
} }
rungdb() { rungdb() {
@ -33,7 +35,8 @@ rungdb() {
# Use "DISPLAY" variable to determine out if X is supported # Use "DISPLAY" variable to determine out if X is supported
if $under_gdb && [ "$DISPLAY" ]; then if $under_gdb && [ "$DISPLAY" ]; then
args=`echo $@ |sed s/--detach//g | sed s/--vconsole:off//g` 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 else
run $@ run $@
fi fi