5 geo_default="800x600+0+0"
10 if [ `type $xserver &>/dev/null; echo $?` -ne 0 ]; then
12 if [ `type $xserver &>/dev/null; echo $?` -ne 0 ]; then
13 echo "Please install either Xephyr (recommended) or Xnest!"
20 option=`echo "'$arg'" | cut -d'=' -f1 | tr -d "'"`
21 value=`echo "'$arg'" | cut -d'=' -f2- | tr -d "'"`
22 if [ "$value" == "$option" ]; then
28 if [ -z "$value" ]; then
29 echo "Missing value for $option= !"
35 if [ -z "$value" ]; then
36 echo "Missing value for $option= !"
42 if [ -z "$value" ]; then
43 echo "Missing value for $option= !"
48 "--dbg-ecore-errors") export ECORE_ERROR_ABORT=1 ;;
49 "--dbg-ecore-noclean") export ECORE_NOCLEAN=1 ;;
50 "--dbg-redraw") export REDRAW_DEBUG=1 ;;
52 echo "Usage: $0 [DEBUG-OPTION] ..."
53 echo " --dbg-display=<NUMBER> = set the used display number"
54 echo " --dbg-geo=<WxH+X+Y> = set xserver geometry"
55 echo " --dbg-mode=<CHAR> = b: text debugger with auto backtrace (gdb)"
56 echo " c: curses debugger (cgdb)"
57 echo " d: GUI debugger (ddd)"
58 echo " e: no debugging"
59 echo " g: text debugger (gdb)"
60 echo " l: leak check (valgrind)"
61 echo " m: memory check (valgrind)"
62 echo " p: memory profiling (memprof)"
63 echo " r: raster's memory profiling (memprof_raster)"
64 echo " s: show syscalls (strace)"
65 echo " v: GUI memory check (valkyrie)"
66 echo " --dbg-ecore-errors = to cause ecore to abort on errors"
67 echo " --dbg-ecore-noclean = to cause ecore to not unload modules"
68 echo " --dbg-redraw = to cause redraw to happen slovly and obviously"
69 echo " --help = wysiwyg"
71 echo "Usage: $0 [ENLIGHTENMENT-OPTION] ..."
75 *) enlightenment_args="$enlightenment_args $arg" ;;
80 if [ -z "$dbg_display" ]; then
81 if [ -z "$DISPLAY" ]; then
82 echo "Couldn't read your \$DISPLAY env variable, are you running X?"
86 dcnt=`echo "$DISPLAY" | tr -d ':' | cut -d '.' -f1`
87 dbg_display=$(($dcnt+1))
89 if [ -z "$dbg_geo" ]; then
92 if [ -z "$debugger" ]; then
93 debugger=$debugger_default
98 if [ -z "$tmpfile" ]; then
99 echo "Can't create tmp file!"
102 echo -e "run\nbt\nq\ny" > $tmpfile
103 debugcmd="gdb -x $tmpfile --args"
105 "c") debugcmd="cgdb" ;;
106 "d") debugcmd="ddd -display $DISPLAY --args" ;;
108 "g") debugcmd="gdb --args" ;;
109 "l") debugcmd="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --log-file=valgrind_log" ;;
110 "m") debugcmd="valgrind --tool=memcheck --log-file=valgrind_log" ;;
111 "p") debugcmd="memprof --display=$DISPLAY" ;;
112 "r") debugcmd="memprof_raster --display=$DISPLAY" ;;
113 "s") debugcmd="strace -F -o strace_log" ;;
114 "v") debugcmd="valkyrie -display $DISPLAY" ;;
118 echo "- DISPLAY: $dbg_display"
119 echo "- XSERVER GEOMETRY: $dbg_geo"
120 echo -n "- DEBUGMODE: "
121 if [ "$debugcmd" ]; then
126 if [ "$enlightenment_args" ]; then
127 echo "- ENLIGHTENMENT ARGUMENTS: $enlightenment_args"
129 if [ "$ECORE_ERROR_ABORT" ]; then
130 echo "- ECORE ERROR ABORT"
132 if [ "$ECORE_NOCLEAN" ]; then
133 echo "- ECORE NOCLEAN"
135 if [ "$REDRAW_DEBUG" ]; then
136 echo "- REDRAW DEBUG"
138 echo "======================================================"
144 "Xephyr") $xserver :$dbg_display -ac -screen $dbg_geo & ;;
145 "Xnest") $xserver :$dbg_display -ac -geometry $dbg_geo & ;;
147 sleep 2 # Someone reported that it starts E before X has started properly.
149 export DISPLAY=":$dbg_display"
150 export E_START="enlightenment_start"
151 $debugcmd enlightenment $enlightenment_args
153 if [ "$tmpfile" ]; then
156 killall -TERM $xserver