用GDB调试NGINX

来源:互联网 发布:柳州金刚网络 编辑:程序博客网 时间:2024/06/05 21:59

首先configure加上参数--with-debug。

然后cd objs,修改Makefile,定义CFLAGS =  -pipe  -g -O0 -fno-inline -W -Wall -Wpointer-arith -Wno-unused-parameter -Werror。

最后make && sudo make install。

进入/usr/local/nginx(或者其他自定义目录),修改conf/nginx.conf,加入三行:

[delphi] view plaincopy
  1. master_process  off;  
  2. daemon  off;  
  3.   
  4. error_log  logs/error.log debug;  

启动gdb调试:sudo gdb sbin/nginx。

Enjoy it!

0 0
原创粉丝点击