Masato Taruishi
taru****@users*****
2004年 9月 8日 (水) 15:09:44 JST
=================================================================== RCS file: plugin/debug/attach,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- plugin/debug/attach 2004/09/08 04:25:41 1.1 +++ plugin/debug/attach 2004/09/08 06:09:44 1.2 @@ -5,6 +5,8 @@ eval `ultrapossum-config init` trap "`eval ultrapossum-config term`" 0 +DEBUGGER=${DEBUGGER:-gdb} + get_pid() { ( for p in $@ do @@ -23,22 +25,28 @@ } attach_process() { + if test "x$1" = "x"; then + echo "Can't detect which program to be run" 1>&2 + return 1 + fi if test "x$2" = "x"; then echo "No process found for $1" 1>&2 else - gdb "$1" "$2" + $DEBUGGER "$1" "$2" fi } case "x$1" in xslapd) pid=`slapd_pid` - attach_process $SLAPD $pid + SLAPD=`getvalue $ULTRAPOSSUMRUN SLAPD 2> /dev/null` + attach_process "$SLAPD" $pid ;; xslurpd) pid=`slurpd_pid` - attach_process $SLURPD $pid + SLURPD=`getvalue $ULTRAPOSSUMRUN SLURPD 2> /dev/null` + attach_process "$SLURPD" $pid ;; x)