summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMiculcy Brian <morlenxus@gmx.net>2010-04-15 19:38:23 +0000
committerMiculcy Brian <morlenxus@gmx.net>2010-04-15 19:38:23 +0000
commit661a028125077378210124ce55353bcb75530b98 (patch)
tree87764ae85b566164d10d7611421759b495ead500
parent8093b22d11a40710ed907c1cb36be27010ed8433 (diff)
xnest.sh allows to use xnest and also xephyr, so new name is xdebug.sh
SVN revision: 48039
-rwxr-xr-xxnest.sh149
1 files changed, 0 insertions, 149 deletions
diff --git a/xnest.sh b/xnest.sh
deleted file mode 100755
index a14a4fe..0000000
--- a/xnest.sh
+++ /dev/null
@@ -1,149 +0,0 @@
1#!/usr/bin/env bash
2
3
4debugger_default="b"
5xnest_geo_default="800x600+0+0"
6
7
8if [ `type Xnest &>/dev/null; echo $?` -ne 0 ]; then
9 echo "Please install Xnest!"
10 exit 1
11fi
12
13
14echo
15for arg in $@; do
16 option=`echo "'$arg'" | cut -d'=' -f1 | tr -d "'"`
17 value=`echo "'$arg'" | cut -d'=' -f2- | tr -d "'"`
18 if [ "$value" == "$option" ]; then
19 value=""
20 fi
21
22 case $option in
23 "--dbg-display")
24 if [ -z "$value" ]; then
25 echo "Missing value for $option= !"
26 exit 1
27 fi
28 xnest_display=$value
29 ;;
30 "--dbg-xnest-geo")
31 if [ -z "$value" ]; then
32 echo "Missing value for $option= !"
33 exit 1
34 fi
35 xnest_geo=$value
36 ;;
37 "--dbg-mode")
38 if [ -z "$value" ]; then
39 echo "Missing value for $option= !"
40 exit 1
41 fi
42 debugger=$value
43 ;;
44 "--dbg-ecore-errors") export ECORE_ERROR_ABORT=1 ;;
45 "--dbg-ecore-noclean") export ECORE_NOCLEAN=1 ;;
46 "--dbg-redraw") export REDRAW_DEBUG=1 ;;
47 "--help")
48 echo "Usage: $0 [DEBUG-OPTION] ..."
49 echo " --dbg-display=<NUMBER> = set the used display number"
50 echo " --dpg-xnest-geo=<WxH+X+Y> = set xnest geometry"
51 echo " --dbg-mode=<CHAR> = b: text debugger with auto backtrace (gdb)"
52 echo " c: curses debugger (cgdb)"
53 echo " d: GUI debugger (ddd)"
54 echo " e: no debugging"
55 echo " g: text debugger (gdb)"
56 echo " l: leak check (valgrind)"
57 echo " m: memory check (valgrind)"
58 echo " p: memory profiling (memprof)"
59 echo " r: raster's memory profiling (memprof_raster)"
60 echo " s: show syscalls (strace)"
61 echo " v: GUI memory check (valkyrie)"
62 echo " --dbg-ecore-errors = to cause ecore to abort on errors"
63 echo " --dbg-ecore-noclean = to cause ecore to not unload modules"
64 echo " --dbg-redraw = to cause redraw to happen slovly and obviously"
65 echo " --help = wysiwyg"
66 echo
67 echo "Usage: $0 [ENLIGHTENMENT-OPTION] ..."
68 enlightenment --help
69 exit 0
70 ;;
71 *) enlightenment_args="$enlightenment_args $arg" ;;
72 esac
73done
74
75
76if [ -z "$xnest_display" ]; then
77 if [ -z "$DISPLAY" ]; then
78 echo "Couldn't read your \$DISPLAY env variable, are you running X?"
79 exit 1
80 fi
81
82 dcnt=`echo "$DISPLAY" | tr -d ':' | cut -d '.' -f1`
83 xnest_display=$(($dcnt+1))
84fi
85if [ -z "$xnest_geo" ]; then
86 xnest_geo=$xnest_geo_default
87fi
88if [ -z "$debugger" ]; then
89 debugger=$debugger_default
90fi
91case $debugger in
92 "b")
93 tmpfile=`mktemp`
94 if [ -z "$tmpfile" ]; then
95 echo "Can't create tmp file!"
96 exit 1
97 fi
98 echo -e "run\nbt\nq\ny" > $tmpfile
99 debugcmd="gdb -x $tmpfile --args"
100 ;;
101 "c") debugcmd="cgdb" ;;
102 "d") debugcmd="ddd -display $DISPLAY --args" ;;
103 "e") debugcmd="" ;;
104 "g") debugcmd="gdb --args" ;;
105 "l") debugcmd="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --log-file=valgrind_log" ;;
106 "m") debugcmd="valgrind --tool=memcheck --log-file=valgrind_log" ;;
107 "p") debugcmd="memprof --display=$DISPLAY" ;;
108 "r") debugcmd="memprof_raster --display=$DISPLAY" ;;
109 "s") debugcmd="strace -F -o strace_log" ;;
110 "v") debugcmd="valkyrie -display $DISPLAY" ;;
111esac
112
113
114echo "- DISPLAY: $xnest_display"
115echo "- XNEST GEOMETRY: $xnest_geo"
116echo -n "- DEBUGMODE: "
117if [ "$debugcmd" ]; then
118 echo "$debugcmd"
119else
120 echo "NONE"
121fi
122if [ "$enlightenment_args" ]; then
123 echo "- ENLIGHTENMENT ARGUMENTS: $enlightenment_args"
124fi
125if [ "$ECORE_ERROR_ABORT" ]; then
126 echo "- ECORE ERROR ABORT"
127fi
128if [ "$ECORE_NOCLEAN" ]; then
129 echo "- ECORE NOCLEAN"
130fi
131if [ "$REDRAW_DEBUG" ]; then
132 echo "- REDRAW DEBUG"
133fi
134echo "======================================================"
135echo
136sleep 1
137
138
139Xnest :$xnest_display -ac -geometry $xnest_geo &
140sleep 2 # Someone reported that it starts E before X has started properly.
141
142export DISPLAY=":$xnest_display"
143export E_START="enlightenment_start"
144$debugcmd enlightenment $enlightenment_args
145
146if [ "$tmpfile" ]; then
147 rm "$tmpfile"
148fi
149killall -TERM Xnest