How to debug into my apache module built using a Makefile?

Posted by AJ on Stack Overflow See other posts from Stack Overflow or by AJ
Published on 2010-03-30T08:29:47Z Indexed on 2010/03/30 8:33 UTC
Read the original article Hit count: 319

Filed under:
|

Firstly, I come from Windows-VisualStudio-C++ background. Now I am developing in a Ubuntu environment.

With the help of a Makefile, I built a mymodule.so and copied it to the modules folder within apache. Now, it appears that the module is working fine. But I would like to debug into this module to understand it better.

  1. So, first, is there any way I can get something similar to the Visual Studio debugger type of feel while debugging this module?
  2. Now, i read that i can use gdb to debug into apache modules, can somebody tell me in detail how this is done or point me to some resource that does it.
  3. Ideally, i would like to single step and stuff. I am trying Code::Blocks IDE which has some debugging support. Using the IDE and custom make file, I build the module. Copied it to module location, but how do i debug.
  4. How do i hook to the apache process. Should I use Attach to Process. I tried that with the pid of httpd, but with no success.
  5. Also, while building is there some flag that i should set so that the .so file is debuggable?

I am pretty basic with Linux because i come from windows programming background. Kindly suggest how I go about this.

Thanks in advance, Arjun

© Stack Overflow or respective owner

Related posts about apache2

Related posts about debugging