-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_gdb.sh
executable file
·58 lines (48 loc) · 1.37 KB
/
run_gdb.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/usr/bin/env bash
# Get the directory of this script.
CWD_SOURCE="${BASH_SOURCE[0]}"
while [ -h "$CWD_SOURCE" ]; do # resolve $SOURCE until the file is no longer a symlink
DIR="$( cd -P "$( dirname "$CWD_SOURCE" )" >/dev/null 2>&1 && pwd )"
CWD_SOURCE="$(readlink "$CWD_SOURCE")"
[[ $SCWD_OURCE != /* ]] && CWD_SOURCE="$DIR/$CWD_SOURCE" # if $SOURCE was a relative symlink, we need to resolve it relative to the path where the symlink file was located
done
CWD="$( cd -P "$( dirname "$CWD_SOURCE" )" >/dev/null 2>&1 && pwd )"
declare -a SOURCES_DIRS=(
"src/"
"src/common/"
"src/libvqdr/"
"src/libvqdr/function/"
"src/libvqdr/value/"
"src/libvqdr/operator/"
"build/libvqdr.so.p/"
"build/libvqdr.so.p/src/"
"build/libvqdr.so.p/src/utils/"
"build/libvqdr.so.p/src/libvqdr/"
"build/libvqdr.so.p/src/libvqdr/function/"
"build/libvqdr.so.p/src/libvqdr/operator/"
"build/libvqdr.so.p/src/libvqdr/value/"
"build/tests/"
"build/tests/test1.p/"
"build/tests/test2.p/"
"build/tests/utils/"
)
declare -a SOURCES_DIRS2=()
# build param string
PARAM_STR=""
for str in "${SOURCES_DIRS[@]}"; do
PARAM_STR+=" --directory "
PARAM_STR+="${str}"
done
for val in "${SOURCES_DIRS[@]}"
do
SOURCES_DIRS2+=("$CWD/$val")
done
# for val in "${SOURCES_DIRS2[@]}"
# do
# echo $val
# if [ ! -d $val ]
# then
# echo "could not find it."
# fi
# done
gdb $PARAM_STR $@