Debugging httpd

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Debugging httpd

Alexander Farber
Hi,

how could I please compile the in-tree Apache with -ggdb added and -O2 removed?

I've tried setting EXTRA_CFLAGS=-ggdb in src/Configuration, but that file seems
not to be used. Also I've tried looking at src/Makefile.bsd-wrapper
and the .included
/usr/share/mk/bsd.{own,obj,subdir}.mk, but couldn't find the right
setting anywhere yet

Regards
Alex

Reply | Threaded
Open this post in threaded view
|

Re: Debugging httpd

Alexander Farber
For the archives:

On 1/22/06, Alexander Farber <[hidden email]> wrote:
> how could I please compile the in-tree Apache with -ggdb added and -O2 removed?
>
> I've tried setting EXTRA_CFLAGS=-ggdb in src/Configuration,
> but that file seems not to be used.

    cd /usr/src/usr.sbin/httpd
    make -f Makefile.bsd-wrapper DEBUG=1 CFLAGS="-ggdb -O0" clean
    make -f Makefile.bsd-wrapper DEBUG=1 CFLAGS="-ggdb -O0" obj
    make -f Makefile.bsd-wrapper DEBUG=1 CFLAGS="-ggdb -O0" depend
    make -f Makefile.bsd-wrapper DEBUG=1 CFLAGS="-ggdb -O0"
    sudo make -f Makefile.bsd-wrapper DEBUG=1 CFLAGS="-ggdb -O0" install

This has even put the flags "-ggdb -O0" into /usr/sbin/apxs,
so that I was able to debug my Apache module in gdb right away.

Also I was wrong about src/Configuration not being used