hi,

i added a 'debug' target to apachectl for simplicity while debugging some
module stuff, just saves a couple keystrokes. thought people might find it
helpful. the diff to the 1.3.17 apachectl is attached.

basically, 'apachectl debug' starts httpd with -X, backgrounds the process,
and then runs gdb against httpd with the new pid.

josh
34a35,39
> # the path to gdb for debugging. starting using 'apachectl debug' will start
> # httpd with the -X flag, and then attach gdb to the new process, dropping you
> # right into the debugger.
> GDB='/usr/bin/gdb'
> #
77a83,99
>       debug)
>       if [ $RUNNING -eq 1 ]; then
>           echo "$0 $ARG: httpd (pid $PID) already running"
>           continue
>       fi
>       # run httpd with -X and background the process
>       if ($HTTPD -X &) ; then
>               # now obtain the PID of the new httpd process
>               DEBUG_PID=`cat $PIDFILE`
>           echo "$0 $ARG: httpd started"
>               # and start gdb
>               $GDB $HTTPD $DEBUG_PID
>       else
>           echo "$0 $ARG: httpd could not be started"
>           ERROR=3
>       fi
>       ;;
152c174
<       echo "usage: $0 
(start|stop|restart|fullstatus|status|graceful|configtest|help)"
---
>       echo "usage: $0 
>(start|debug|stop|restart|fullstatus|status|graceful|configtest|help)"
155a178
> debug    - start httpd with -X and attach gdb to the new process

Reply via email to