mac os x에서 apache module gdb debugging Web backend

attach는 일단 포기

Another technique is to use gdb to attach to the running process and then using "where" to print the backtrace, as in
    % gdb httpd 10623    GDB is free software and you are welcome to distribute copies of it     under certain conditions; type "show copying" to see the conditions.    There is absolutely no warranty for GDB; type "show warranty" for    details.    GDB 4.16.gnat.1.13 (sparc-sun-solaris2.5),     Copyright 1996 Free Software Foundation, Inc...
뭔가 다른 작업이 필요하네.

$ gdb /usr/sbin/httpd
GNU gdb 6.3.50-20050815 (Apple version gdb-1824) (Wed Feb  6 22:51:23 UTC 2013)
Copyright 2004 Free Software Foundation, Inc.

(gdb) b ap_process_request
Breakpoint 1 at 0x100037e03
(gdb) run -X -d /private/etc/apache2/
extra                  httpd.conf             httpd.conf.bak         httpd.conf.pre-update  magic                  mime.types             original               other                  users
(gdb) run -X -d /private/etc/apache2
Starting program: /usr/sbin/httpd -X -d /private/etc/apache2

(98)Address already in use: make_sock: could not bind to address
이 뜨면,

sudo /usr/sbin/apachectl stop

netstat -nlp 
해보기. mac에서는 p 빼고.

(48)address already in use make_sock could not bind to address
은 또 다른 에러네.

$ sudo lsof -i :9918

해봤자 아무것도 안나오네.

진짜 문제는 error_log에 찍힌
[Wed Apr 23 18:41:19 2014] [error] (13)Permission denied: could not create /private/var/run/

sudo gdb로 실행 되네.

새 request에 대한 내 모듈의 breakpoint도 걸린다.


댓글 입력 영역