Nginx source compiled, dependent on Pcre and zlib
After downloading the source code, through the./configure--help can view the compilation options, in order to increase the GDB debugging information, using the./configure--with-cc-opt= '-g-o0 ' and make cflags= "-g-o0"
To facilitate debugging, you can start a worker process
Nginx also has support for GDB, with debug_points configuration items: Stop or abort, indicating that when a serious error is encountered,
The NGINGX process can stop living. If it is abort, you can set the build core file.
With respect to macros, macros are replaced directly by default, and if you change the-G to--ggdb3 at compile time, you can keep the macros, but the executable binaries are increased. Info Macro Ngx_ok/macro expand ngx_ok/p ngx_ok. If info is not found, you can load the list file and then execute the info command.
When compiling, you can add--with-debug to generate debug information.
Error log for configuration file: Error-log logs/error.log debug_http or other parameters, just print what you want.
Strace/pstack:strace-t-t-o-f-p shows the process call; Pstack displays the call stack.
All-in-one access to Nginx execution process: System tap;-finstrument-functions addr2line.sh;
Add pile debugging, embed your own pile function in the code to debug.
Write your own code, encapsulate HTTP messages, construct nginx anomaly scenes to observe.
Nginx Compilation and debugging