Commit 2574bab3 authored by Pavel Vainerman's avatar Pavel Vainerman

(uniset-start): Сделал автоматическое определение местоположения

запускаемого файла при запуске через gdb.
parent 25ab0edf
......@@ -17,7 +17,7 @@ print_usage()
{
[ "$1" = 0 ] || exec >&2
cat <<EOF
Usage: ${0##*/} [options] programm
Usage: ${0##*/} [options] programm [arguments]
Valid options are:
-h, --help display help screen
......@@ -33,6 +33,9 @@ EOF
[ -n "$1" ] && exit "$1" || exit
}
[ -z "$1" ] && print_usage 1
#parse command line options
case "$1" in
-h|--help) print_usage 0;;
......@@ -47,15 +50,25 @@ shift
if [ -n "$DBG" ]
then
COMLINE="$* --uniset-port $OMNIPORT"
COMLINE="$* --uniset-port $OMNIPORT"
start_line=
[ "$DBG" == "mem" ] && start_line="valgrind --tool=memcheck --leak-check=full --trace-children=yes --log-file=valgrind.log $COMLINE"
[ "$DBG" == "call" ] && start_line="valgrind --tool=callgrind --trace-children=yes --log-file=valgrind.log $COMLINE"
[ "$DBG" == "cache" ] && start_line="valgrind --tool=cachegrind --trace-children=yes --log-file=valgrind.log $COMLINE"
[ "$DBG" == "hel" ] && start_line="valgrind --tool=helgrind --trace-children=yes --log-file=valgrind.log $COMLINE"
PROG=`basename $1`
if [ "$DBG" == "gdb" ]; then
start_line="gdb --args $COMLINE"
if [ -a "./.libs/lt-$PROG" ]; then
PROG="./.libs/lt-$PROG"
else
if [ -a "./.libs/$PROG" ]; then
PROG="./.libs/$PROG"
fi
fi
shift
start_line="gdb --args $PROG $* --uniset-port $OMNIPORT"
fi
echo Running "$start_line"
......
#!/bin/sh
uniset-start.sh -f ./uniset-mbtcpmaster \
./uniset-start.sh -g ./uniset-mbtcpmaster \
--confile test.xml \
--mbtcp-name MBMaster1 \
--smemory-id SharedMemory \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment