stas 02/03/18 08:31:15
Modified: src/docs/2.0/devel/debug_c debug_c.pod
Added: src/docs/2.0/devel/debug_c/code .debug-modperl-xs
Log:
add another startup script for debugging XS modules
Revision Changes Path
1.5 +14 -1 modperl-docs/src/docs/2.0/devel/debug_c/debug_c.pod
Index: debug_c.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/devel/debug_c/debug_c.pod,v
retrieving revision 1.4
retrieving revision 1.5
diff -u -r1.4 -r1.5
--- debug_c.pod 18 Mar 2002 07:19:18 -0000 1.4
+++ debug_c.pod 18 Mar 2002 16:31:15 -0000 1.5
@@ -205,12 +205,25 @@
=over
-=item Debugging mod_perl Initialization
+=item * Debugging mod_perl Initialization
The F<code/.debug-modperl-init> startup script breaks at the
modperl_hook_init() function, which is useful for debugging code at
the modperl's initialization phase.
+=item * Debugging mod_perl XS Extensions
+
+The F<code/.debug-modperl-xs> startup script breaks at the
+mpxs_Apache__Filter_print() function implemented in
+I<xs/Apache/Filter/Apache__Filter.h>. This is an example of debugging
+code in XS Extensions. For this particular example the complete test
+case is:
+
+ % ddd -command=.debug-modperl-xs & \
+ t/TEST -v -run -ping=block filter/api
+
+When I<filter/api> test is running it calls
+mpxs_Apache__Filter_print() which is when the breakpoint is reached.
=back
1.1
modperl-docs/src/docs/2.0/devel/debug_c/code/.debug-modperl-xs
Index: .debug-modperl-xs
===================================================================
# This gdb startup script breaks at the mpxs_Apache__Filter_print()
# function from the XS code, as an example how you can debug the code
# in XS extensions.
#
# Invoke as:
# gdb -command=.debug-modperl-xs
# and then run:
# t/TEST -v -run -ping=block filter/api
#
# see ADJUST notes for things that may need to be adjusted
# ADJUST: the path to the httpd executable if needed
file /home/stas/httpd/worker/bin/httpd
handle SIGPIPE nostop
handle SIGPIPE pass
define myrun
tbreak main
break ap_run_pre_config
# ADJUST: the httpd.conf file's path if needed
# ADJUST: add -DPERL_USEITHREADS to debug threaded mpms
run -d `pwd`/t -f `pwd`/t/conf/httpd.conf \
-DONE_PROCESS -DNO_DETATCH -DAPACHE2
set auto-solib-add 0
continue
end
define gopoll
b apr_poll
continue
continue
end
# threads specific, for some reason needs to go through apr_poll many
# times before getting to the next breakpoint, so we skip these
define bring_me_there
# ignoring apr_poll (bp #3) 12 times
ignore 3 12
continue
end
define mybp
# load Apache/Filter.so
sharedlibrary Filter
b mpxs_Apache__Filter_print
end
myrun
gopoll
mybp
# ADJUST: uncomment for threaded mpm
#bring_me_there
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]