summaryrefslogtreecommitdiff
path: root/xnest.sh
diff options
context:
space:
mode:
Diffstat (limited to 'xnest.sh')
-rwxr-xr-xxnest.sh32
1 files changed, 15 insertions, 17 deletions
diff --git a/xnest.sh b/xnest.sh
index 58feed7..0f2ca5a 100755
--- a/xnest.sh
+++ b/xnest.sh
@@ -7,24 +7,23 @@
7disp_num=":1" # Which display do you want the xnest to be on? 7disp_num=":1" # Which display do you want the xnest to be on?
8 8
9main=$DISPLAY 9main=$DISPLAY
10display=" -display $disp_num"
11tmp=`mktemp` || exit 1 10tmp=`mktemp` || exit 1
12/bin/echo -e "run\nbt\nq\ny" > $tmp 11echo -e "run\nbt\nq\ny" > $tmp
13 12
14case "$@" in 13case "$1" in
15 "") action="gdb -x $tmp" ; main=$disp_num ; display="" ;; 14 "") action="gdb -x $tmp --args" ; main=$disp_num ;;
16 "-b") action="gdb -x $tmp" ; main=$disp_num ; display="" ;; 15 "-b") action="gdb -x $tmp --args" ; main=$disp_num ;;
17 "-c") action="cgdb" ; main=$disp_num ; display="" ;; 16 "-c") action="cgdb" ; main=$disp_num ;;
18 "-d") action="ddd -display $main" ; display="" ;; 17 "-d") action="ddd -display $main --args" ;;
19 "-e") action="" ;; 18 "-e") action="" ; e_args="-display $disp_num" ;;
20 "-g") action="gdb" ; main=$disp_num ; display="" ;; 19 "-g") action="gdb --args" ; main=$disp_num ;;
21 "-l") action="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --log-file=valgrind_log" ;; 20 "-l") action="valgrind --tool=memcheck --leak-check=yes --show-reachable=yes --log-file=valgrind_log" ;;
22 "-m") action="valgrind --tool=memcheck --log-file=valgrind_log" ;; 21 "-m") action="valgrind --tool=memcheck --log-file=valgrind_log" ;;
23 "-p") action="memprof --display=$main" ; main=$disp_num ; display="" ;; 22 "-p") action="memprof --display=$main" ; main=$disp_num ;;
24 "-r") action="memprof_raster --display=$main" ; main=$disp_num ; display="" ;; 23 "-r") action="memprof_raster --display=$main" ; main=$disp_num ;;
25 "-s") action="strace -F -o strace_log" ;; 24 "-s") action="strace -F -o strace_log" ;;
26 "-v") action="valkyrie -display $main" ; main=$disp_num ; display="" ;; 25 "-v") action="valkyrie -display $main" ; main=$disp_num ;;
27 *) echo -e "Usage : xnest.sh [option]" 26 *) echo -e "Usage : xnest.sh [debugger] ([enlightenment options])"
28 echo -e "\tdefault option is -b" 27 echo -e "\tdefault option is -b"
29 echo -e "\t-b use text debugger with auto backtrace\tgdb" 28 echo -e "\t-b use text debugger with auto backtrace\tgdb"
30 echo -e "\t-c use curses debugger\t\t\t\tcgdb" 29 echo -e "\t-c use curses debugger\t\t\t\tcgdb"
@@ -38,19 +37,18 @@ case "$@" in
38 echo -e "\t-s show syscalls\t\t\t\tstrace" 37 echo -e "\t-s show syscalls\t\t\t\tstrace"
39 echo -e "\t-v GUI memory check\t\t\t\tvalkyrie" 38 echo -e "\t-v GUI memory check\t\t\t\tvalkyrie"
40 echo -e "" 39 echo -e ""
41 echo -e "You need to add \"-display $disp_num\" as the run arguments for the GUI debugger."
42 echo -e "When you have finished with the text debugger, use the q command to quit." 40 echo -e "When you have finished with the text debugger, use the q command to quit."
43 echo -e "The valgrind options will leave a log file with a name beginning with valgrind_log" 41 echo -e "The valgrind options will leave a log file with a name beginning with valgrind_log"
44 exit 42 exit
45 ;; 43 ;;
46esac 44esac
47 45e_args="`echo -- $@ | cut -d' ' -f2-` $e_args"
48 46
49Xnest $disp_num -ac & 47Xnest $disp_num -ac &
50 48
51sleep 2 # Someone reported that it starts E before X has started properly. 49sleep 2 # Someone reported that it starts E before X has started properly.
52 50
53export DISPLAY=$main; export E_START="enlightenment_start"; $action enlightenment $display 51export DISPLAY=$main; export E_START="enlightenment_start"; $action enlightenment $e_args
54 52
55rm -f $tmp 53rm -f $tmp
56killall -TERM Xnest 54killall -TERM Xnest