httpd-modules-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ricardo13 <ricardoogra...@gmail.com>
Subject Re: How do I debug a module ?
Date Fri, 24 Jul 2009 10:00:46 GMT

hi,

The GDB session is very large.

machine@tkt-test:/usr/local/apache2$ sudo gdb bin/httpd
GNU gdb 6.8-debian
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
(gdb) b ap_process_request
Breakpoint 1 at 0x80b0fe9: file http_request.c, line 276.
(gdb) run -X -d /usr/local/apache
Starting program: /usr/local/apache2/bin/httpd -X -d /usr/local/apache
[Thread debugging using libthread_db enabled]
httpd: Could not open configuration file /usr/local/apache/conf/httpd.conf:
No such file or directory

Program exited with code 01.
(gdb) run -X -d /usr/local/apache2
Starting program: /usr/local/apache2/bin/httpd -X -d /usr/local/apache2
[Thread debugging using libthread_db enabled]
[New Thread 0xb7d58940 (LWP 4129)]
[New Thread 0xb7cdbb90 (LWP 4131)]
[New Thread 0xb74dab90 (LWP 4132)]
[New Thread 0xb6cd9b90 (LWP 4133)]
[New Thread 0xb64d8b90 (LWP 4134)]
[New Thread 0xb5cd7b90 (LWP 4135)]
[New Thread 0xb54d6b90 (LWP 4136)]
[New Thread 0xb4cd5b90 (LWP 4137)]
[New Thread 0xb44d4b90 (LWP 4138)]
[New Thread 0xb3cd3b90 (LWP 4139)]
[New Thread 0xb34d2b90 (LWP 4140)]
[New Thread 0xb2cd1b90 (LWP 4141)]
[New Thread 0xb24d0b90 (LWP 4142)]
[New Thread 0xb1ccfb90 (LWP 4143)]
[New Thread 0xb14ceb90 (LWP 4144)]
[New Thread 0xb0ccdb90 (LWP 4145)]
[New Thread 0xb04ccb90 (LWP 4146)]
[New Thread 0xafccbb90 (LWP 4147)]
[New Thread 0xaf4cab90 (LWP 4148)]
[New Thread 0xaecc9b90 (LWP 4149)]
[New Thread 0xae4c8b90 (LWP 4150)]
[New Thread 0xadcc7b90 (LWP 4151)]
[New Thread 0xad4c6b90 (LWP 4152)]
[New Thread 0xaccc5b90 (LWP 4153)]
[New Thread 0xac4c4b90 (LWP 4154)]
[New Thread 0xabcc3b90 (LWP 4155)]
[New Thread 0xab4c2b90 (LWP 4156)]
[New Thread 0xaacc1b90 (LWP 4157)]
[Thread 0xb7cdbb90 (LWP 4131) exited]
[Switching to Thread 0xabcc3b90 (LWP 4155)]

/* Here, I request the webpage */

Breakpoint 1, ap_process_request (r=0xa12e048) at http_request.c:276
276	    if (ap_extended_status)
(gdb) n
259	{
(gdb) n
276	    if (ap_extended_status)
(gdb) n
278	    access_status = ap_run_quick_handler(r, 0);  /* Not a look-up
request */
(gdb) n
279	    if (access_status == DECLINED) {
(gdb) n
280	        access_status = ap_process_request_internal(r);
(gdb) n
281	        if (access_status == OK) {
(gdb) n
282	            access_status = ap_invoke_handler(r);
(gdb) n
286	    if (access_status == DONE) {
(gdb) n
291	    if (access_status == OK) {
(gdb) n
292	        ap_finalize_request_protocol(r);
(gdb) n
222	    conn_rec *c = r->connection;
(gdb) n
226	    bb = apr_brigade_create(r->pool, c->bucket_alloc);
(gdb) n
235	    if (r->connection->keepalive != AP_CONN_CLOSE) {
(gdb) n
236	        if (ap_get_brigade(r->input_filters, bb, AP_MODE_EATCRLF,
(gdb) n
238	            c->data_in_input_filters = 0;  /* we got APR_EOF or an error
*/
(gdb) n
246	        e = apr_bucket_flush_create(c->bucket_alloc);
(gdb) n
254	        APR_BRIGADE_INSERT_HEAD(bb, e);
(gdb) n
255	        ap_pass_brigade(r->connection->output_filters, bb);
(gdb) n
307	    ap_update_child_status(r->connection->sbh, SERVER_BUSY_LOG, r);
(gdb) n
308	    ap_run_log_transaction(r);
(gdb) n
309	    if (ap_extended_status)
(gdb) n
311	}
(gdb) n
ap_process_http_connection (c=0xa127968) at http_core.c:192
192	        if (ap_extended_status)
(gdb) n
195	        if (c->keepalive != AP_CONN_KEEPALIVE || c->aborted)
(gdb) n
198	        ap_update_child_status(c->sbh, SERVER_BUSY_KEEPALIVE, r);
(gdb) n
199	        apr_pool_destroy(r->pool);
(gdb) n
201	        if (ap_graceful_stop_signalled())
(gdb) n
204	        if (!csd) {
(gdb) n
205	            csd = ap_get_module_config(c->conn_config, &core_module);
(gdb) n
207	        apr_socket_opt_set(csd, APR_INCOMPLETE_READ, 1);
(gdb) n
208	        apr_socket_timeout_set(csd, c->base_server->keep_alive_timeout);
(gdb) n
183	    while ((r = ap_read_request(c)) != NULL) {
(gdb) n
213	}
(gdb) 
worker_thread (thd=0xa0dabc8, dummy=0xa1270b0) at worker.c:548
548	        ap_lingering_close(current_conn);
(gdb) 
898	        worker_sockets[thread_slot] = NULL;
(gdb) 
899	        requests_this_child--; /* FIXME: should be synchronized - aaron
*/
(gdb) 
898	        worker_sockets[thread_slot] = NULL;
(gdb) 
900	        apr_pool_clear(ptrans);
(gdb) 
901	        last_ptrans = ptrans;
(gdb) 
845	    while (!workers_may_exit) {
(gdb) 
846	        if (!is_idle) {
(gdb) 
847	            rv = ap_queue_info_set_idle(worker_queue_info, last_ptrans);
(gdb) 
849	            if (rv != APR_SUCCESS) {
(gdb) 
847	            rv = ap_queue_info_set_idle(worker_queue_info, last_ptrans);
(gdb) 
849	            if (rv != APR_SUCCESS) {
(gdb) 
854	                break;
(gdb) 
859	        ap_update_child_status_from_indexes(process_slot, thread_slot,
SERVER_READY, NULL);
(gdb) 
864	        rv = ap_queue_pop(worker_queue, &csd, &ptrans);
(gdb) 
859	        ap_update_child_status_from_indexes(process_slot, thread_slot,
SERVER_READY, NULL);
(gdb) 
861	        if (workers_may_exit) {
(gdb) 
864	        rv = ap_queue_pop(worker_queue, &csd, &ptrans);
(gdb) 

/* Here, I request webpage again */
[Switching to Thread 0xab4c2b90 (LWP 4156)]

Breakpoint 1, ap_process_request (r=0xa13c080) at http_request.c:276
276	    if (ap_extended_status)
(gdb) 
259	{
(gdb) 

My module calls mod_teste !!!

Thank you
Ricardo



Tom Evans-3 wrote:
> 
> On Thu, 2009-07-23 at 11:51 -0700, ricardo13 wrote:
>> hi,
>> 
>> Thank you for reply.
>> 
>> I'm following this  http://httpd.apache.org/dev/debugging.html website
>> website for debugging. I run command 'n' in GDB and doesn't show my
>> module.
>> 
>> It show me about worker.c, http_request.c, but nothing about my module.
>> What's wrong ??
>> 
>> My module's using port_read_request hook.
>> 
>> Thank you
>> Ricardo
>> 
> 
> Show us the debug session?
> 
> Cheers
> 
> Tom
> 
> 
> 

-- 
View this message in context: http://www.nabble.com/How-do-I-debug-a-module---tp24630579p24641875.html
Sent from the Apache HTTP Server - Module Writers mailing list archive at Nabble.com.


Mime
View raw message