Should I be able to use gdb-5.0 (or even 19991004) to single-step into
and out of mod_perl-2.0's code? I see support for running the test
server under gdb, so I'm hopeful.  Running glibc-2.1.3 on va-linux's
tweaked RedHat 6.2, FWIW. Typical gdb-5.0 session below, the 19941004
gdb that came installed on his box behaves similarly.

The reason I'm going down this trail is to get more familiar with
mod_perl-2.0's internals. My puzzle du jour is why a
PerlOutputFilterHandler like

   sub handler {
       my $filter = shift ;

       my $r = $filter->r ;
       my $fn = $r->filename ;

       my $mtime = (stat $fn)[9] ;

       $filter->print(
           map "$_\n",
           $fn,
           $mtime,
           $r->mtime,
           scalar localtime $mtime,
           scalar localtime $filter->r->mtime,
       ) ;

       while ($filter->read(my $buffer, 1024)) {
           $filter->print(lc $buffer);
       }

       0;
   }

doesn't print the same mtime twice:

   /home/barries/2.0/www/htdocs/index.html.en
   988998777
   952717376
   Fri May  4 13:52:57 2001
   Fri Mar 10 14:42:56 2000
   ...snip...

- Barrie


[barries@//sizzle] www$ ~/gdb-5.0/gdb/b': ~/gdb-5.0/gdb/gdb bin/httpd
GNU gdb 5.0
Copyright 2000 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
(gdb) set args -D ONE_PROCESS
(gdb) list prefork.c:800
...snip...
(gdb) b 824
Breakpoint 1 at 0x8071b1e: file prefork.c, line 824.
(gdb) r
Starting program: /home/barries/2.0/www/bin/httpd -D ONE_PROCESS
[New Thread 1024 (runnable)]
mod_perl trace flags dump:
 d On  (directive processing)
 f On  (filters)
 g On  (Perl runtime interaction)
 h On  (handlers)
 i On  (interpreter pool management)
 m On  (memory allocations)
 s On  (perl sections)
 t On  (benchmark-ish timings)
modperl_config_dir_new: 0x810a964
modperl_cmd_output_filter_handlers: push @PerlOutputFilterHandler, Foo
modperl_handler_new: new handler Foo
modperl_cmd_push_handlers: created handler stack
modperl_cmd_push_handlers: pushed handler: Foo
[Switching to Thread 1024 (runnable)]

Breakpoint 1, child_main (child_num_arg=0) at prefork.c:824
824                 ap_process_connection(current_conn);
(gdb) s
ap_process_connection (c=0x810e404) at connection.c:212
212         ap_update_vhost_given_ip(c);
(gdb) n
214         ap_run_pre_connection(c);
(gdb) s
0x807a3f6 in ap_run_pre_connection (c=0x810e404) at connection.c:81
81      AP_IMPLEMENT_HOOK_RUN_ALL(int,pre_connection,(conn_rec *c),(c),OK,DECLINED)
(gdb) s
modperl_hook_pre_connection (c=0x810e404) at mod_perl.c:239
239         return modperl_input_filter_register_connection(c);
(gdb) s
modperl_input_filter_register_connection (c=0x810e404) at modperl_filter.c:392
392         modperl_config_dir_t *dcfg =
(gdb) n
396         if ((av = dcfg->handlers_per_dir[MP_INPUT_FILTER_HANDLER])) {
(gdb) n
419         MP_TRACE_h(MP_FUNC, "no InputFilter handlers configured (connection)\n");
(gdb) n
421         return DECLINED;
(gdb) s
422     }
(gdb) s
0x401d5310 in modperl_hook_pre_connection (c=0x810e404) at mod_perl.c:240
240     }
(gdb) s



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to