You are viewing a plain text version of this content. The canonical link for it is here.
Posted to modperl-cvs@perl.apache.org by st...@apache.org on 2003/03/01 08:06:49 UTC
cvs commit: modperl-docs/src/docs/2.0/devel/debug c.pod
stas 2003/02/28 23:06:48
Modified: src/docs/2.0/devel/debug c.pod
Log:
more various debug notes
Revision Changes Path
1.6 +51 -0 modperl-docs/src/docs/2.0/devel/debug/c.pod
Index: c.pod
===================================================================
RCS file: /home/cvs/modperl-docs/src/docs/2.0/devel/debug/c.pod,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -r1.5 -r1.6
--- c.pod 1 Mar 2003 06:49:21 -0000 1.5
+++ c.pod 1 Mar 2003 07:06:48 -0000 1.6
@@ -735,6 +735,57 @@
from reaping it. So, you could hit the clients/threads limit if you
segfault a lot.
+=head1 Debugging Threaded MPMs
+
+
+=head2 Useful Information from gdb Manual
+
+Debugging programs with multiple threads:
+http://sources.redhat.com/gdb/current/onlinedocs/gdb_5.html#SEC25
+
+Stopping and starting multi-thread programs:
+http://sources.redhat.com/gdb/current/onlinedocs/gdb_6.html#SEC40
+
+=head2 libpthread
+
+when using:
+
+ set auto-solib-add 0
+
+make sure to:
+
+ sharedlibrary libpthread
+
+(or whatever the shared library is used on your OS) without which you
+may have problems to debug the threaded mpm mod_perl.
+
+
+
+=head1 Defining and Using Custom gdb Macros
+
+GDB provides two ways to store sequences of commands for execution as
+a unit: user-defined commands and command files. See:
+http://sources.redhat.com/gdb/current/onlinedocs/gdb_21.html
+
+Apache 2.0 source comes with a nice pack of macros and can be found in
+I<httpd-2.0/.gdbinit>. To use it issue:
+
+ gdb> source /wherever/httpd-2.0/.gdbinit
+
+Now if for example you want to dump the contents of the bucket
+brigade, you can do:
+
+ gdb> dump_brigade my_brigade
+
+where C<my_brigade> is the pointer to the bucket brigade that you want
+to debug.
+
+mod_perl 1.0 has a similar file (I<modperl/.gdbinit>) mainly including
+handy macros for dumping Perl datastructures, however it works only
+with non-threaded Perls. But otherwise it's useful in debugging
+mod_perl 2.0 as well.
+
+
=head1 Expanding C Macros
Perl, mod_perl and httpd C code makes an extensive use of C macros,
Re: cvs commit: modperl-docs/src/docs/2.0/devel/debug c.pod
Posted by Stas Bekman <st...@stason.org>.
Geoffrey Young wrote:
>
>> +=head1 Defining and Using Custom gdb Macros
>
>
> cool. this partially answers one of my offline questions :)
that's why I've added it ;)
> just one thing...
>
>> +
>> +GDB provides two ways to store sequences of commands for execution as
>> +a unit: user-defined commands and command files. See:
>> +http://sources.redhat.com/gdb/current/onlinedocs/gdb_21.html
>> +
>> +Apache 2.0 source comes with a nice pack of macros and can be found in
>> +I<httpd-2.0/.gdbinit>. To use it issue:
>> +
>> + gdb> source /wherever/httpd-2.0/.gdbinit
>> +
>> +Now if for example you want to dump the contents of the bucket
>> +brigade, you can do:
>> +
>> + gdb> dump_brigade my_brigade
>> +
>> +where C<my_brigade> is the pointer to the bucket brigade that you want
>> +to debug.
>
>
> where can you find a list of the name of the brigades? say I want to
> dump all the output filters - what are they called or, better, where do
> I look for them?
just like inside a perl debugger, you have to be inside a scope which has
them. So if for example you want to dump output filters, you could break at:
modperl_wbucket_pass once you hit that bp, do:
gdb> dump_filters *(wb->filters)
of course there are many other places where you could do that (most inside
apache core).
Let me know if this clarifies the issue.
__________________________________________________________________
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
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org
Re: cvs commit: modperl-docs/src/docs/2.0/devel/debug c.pod
Posted by Geoffrey Young <ge...@modperlcookbook.org>.
> +=head1 Defining and Using Custom gdb Macros
cool. this partially answers one of my offline questions :)
just one thing...
> +
> +GDB provides two ways to store sequences of commands for execution as
> +a unit: user-defined commands and command files. See:
> +http://sources.redhat.com/gdb/current/onlinedocs/gdb_21.html
> +
> +Apache 2.0 source comes with a nice pack of macros and can be found in
> +I<httpd-2.0/.gdbinit>. To use it issue:
> +
> + gdb> source /wherever/httpd-2.0/.gdbinit
> +
> +Now if for example you want to dump the contents of the bucket
> +brigade, you can do:
> +
> + gdb> dump_brigade my_brigade
> +
> +where C<my_brigade> is the pointer to the bucket brigade that you want
> +to debug.
where can you find a list of the name of the brigades? say I want to
dump all the output filters - what are they called or, better, where
do I look for them?
--Geoff
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@perl.apache.org
For additional commands, e-mail: dev-help@perl.apache.org