Steve Waltner wrote:
>> You may find some useful notes here:
>> http://perl.apache.org/docs/2.0/devel/debug/c.html
>> There are for debugging mod_perl 2.0, but most of it applies to any
>> other shared C library.
>
>
> Thanks for the information but it still doesn't seem to be working
> correctly. If this is a topic that I should take over to a gdb mailing
> list, let me know. I started with a clean unpack of the Apache 2.0.49
> source tarball and configure it with the following command:
>
> ./configure --enable-maintainer-mode --with-ldap --enable-ldap
> --enable-auth-ldap --prefix=/tmp/apache-test
> make
> make install
> cp /tmp/httpd.conf /tmp/apache-test/conf/httpd.conf
[...]
> (gdb) run -k start
> Starting program: /tmp/apache-test/bin/httpd -k start
>
> Breakpoint 1, mod_auth_ldap_parse_url (cmd=0xffbffb78, config=0xea998,
> url=0xeaa80 "ldap://ldap.lsil.com/ou=lsil.com,o=LSI%20Logic?uid")
> at mod_auth_ldap.c:702
> 702 result = apr_ldap_url_parse(url, &(urld));
> (gdb) info shared
> From To Syms Read Shared Object Library
> 0xff3847f4 0xff3929d0 Yes /tmp/apache-test/lib/libaprutil-0.so.0
> 0xff20d5a0 0xff2cb564 Yes /usr/lib/libldap.so.5
> 0xff342638 0xff35aa48 Yes /tmp/apache-test/lib/libexpat.so.0
> 0xff1c8064 0xff1dd4e4 Yes /tmp/apache-test/lib/libapr-0.so.0
> 0xff3104bc 0xff310634 Yes /usr/lib/libsendfile.so.1
> 0xff1a2494 0xff1a51b8 Yes /usr/lib/librt.so.1
> 0xff171a40 0xff180f24 Yes /usr/lib/libm.so.1
> 0xff1535e0 0xff1595a4 Yes /usr/lib/libsocket.so.1
> 0xff0940f8 0xff10098c Yes /usr/lib/libnsl.so.1
> 0xff028ab8 0xff057134 Yes /usr/lib/libresolv.so.2
> 0xff0039f4 0xff003ffc Yes /usr/lib/libpthread.so.1
> 0xff3b0704 0xff3b075c Yes /usr/lib/libdl.so.1
> 0xfef1ca08 0xfef9f038 Yes /usr/lib/libc.so.1
> 0xfefd04f4 0xfefd1510 Yes /usr/lib/libmd5.so.1
> 0xfeee1a8c 0xfeee7dd4 Yes /usr/lib/libaio.so.1
> 0xfeec09a0 0xfeec2950 Yes /usr/lib/libmp.so.2
> 0xfeeb0420 0xfeeb34e8 Yes
> /usr/platform/SUNW,Ultra-Enterprise/lib/libc_psr.so.1
> 0xfee873b0 0xfee96100 Yes /usr/lib/libthread.so.1
> (gdb) b apr_ldap_url.c:255
> No line 255 in file "apr_ldap_url.c".
> (gdb) b ldap_url_parse_ext
> Function "ldap_url_parse_ext" not defined.
> Make breakpoint pending on future shared library load? (y or [n])
> (gdb) quit
> The program is running. Exit anyway? (y or n) y
> dumbo:/tmp/apache-test>
> =====================
>
> I haven't turned off the autoload shared libraries, so gdb does try to
> load debug symbols from the libaprutil file, but it still appears as
> though it's not working properly since I can't set a breakpoint in
> apr_ldap_url.c or step into the function.
>
> Looking at the output of make, it appears as though the build process
> does the needed debugging flags...
right
> make[3]: Entering directory `/tmp/httpd-2.0.49/srclib/apr-util'
> /bin/bash /tmp/httpd-2.0.49/srclib/apr/libtool --silent --mode=link gcc
> -g -O2 -Wall -Wmissing-prototypes -Wstrict-prototypes
[...]
> encoding/apr_base64.lo hooks/apr_hooks.lo ldap/apr_ldap_compat.lo
> ldap/apr_ldap_url.lo
.lo gets linked alright, but it doesn't have any symbols:
httpd-2.0/srclib> nm apr-util/ldap/apr_ldap*o
The explanation comes from:
#if APR_HAS_LDAP
#if !APR_HAS_LDAP_URL_PARSE
in apr_ldap_url.c and the header file apr_ldap_url.h:
#if APR_HAS_LDAP
#if APR_HAS_LDAP_URL_PARSE
#define apr_ldap_url_desc_t LDAPURLDesc
#define apr_ldap_is_ldap_url(url) ldap_is_ldap_url(url)
#define apr_ldap_is_ldaps_url(url) ldap_is_ldaps_url(url)
#define apr_ldap_is_ldapi_url(url) ldap_is_ldapi_url(url)
#define apr_ldap_url_parse(url, ludpp) ldap_url_parse(url, ludpp)
#define apr_ldap_free_urldesc(ludp) ldap_free_urldesc(ludp)
#else /* ! APR_HAS_LDAP_URL_PARSE */
So you have the implementation elsewhere. ldap_url_parse_ext doesn't exist at
all. You need to break at: ldap_url_parse or similar, I can't see
ldap_url_parse_ext there.
Though I'm not sure who links against libldap (neither libaprutil nor httpd
are linked against it on my machine), I will leave it here for you to discover
that. ldd and nm, should help you to discover that.
--
__________________________________________________________________
Stas Bekman JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/ mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org http://ticketmaster.com
|