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