"Repeating lines" GDB behaviour in custom apache module

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

I've recently started working at developing apache modules, and while finding it interesting, have recently run into a rather annoying issue. I appear to get unusual GDB output, where the code repeats sections multiple times(despite there being no loop) and sometimes just making big skips, and most commands (print in particular) outright not working. Adding sample output to the end of this message.

I've only taken the jump from development in a windows environment using VC++ recently, and am far from an expert in configuring build environments, though I've read through the docs. During debug I run with -X, and everything, including apache is compiled with -g. I used apxs to compile and install the module itself with the following command.

sudo /usr/local/apache2/bin/apxs -c -i mod_ninja_access.c

I've read the chapter on module debugging in "The apache modules book", as well as a couple of articles, however have not found any mention of such an issue in them. I've also tried googling and checking the archives for similar issues but had no luck. I suspect this is some kind of configuration issue, and wondering if anyone else has encountered a similar issue or would be able to help?

I post here and not on a gdb mailing list as I've had no problems with other environments, so I'm assuming it may be specific to how I'm setting up my module?

Thanks for reading,
 Juhani Connolly



Sample output from gdb here:

This GDB was configured as "i386-redhat-linux-gnu"...Using host libthread_db library "/lib/i686/nosegneg/libthread_db.so.1".

(gdb) r -X
Starting program: /usr/local/apache2/bin/httpd -X
[Thread debugging using libthread_db enabled]
[New Thread -1208711424 (LWP 8068)]

Program received signal SIGINT, Interrupt.
[Switching to Thread -1208711424 (LWP 8068)]
0x00e3a402 in __kernel_vsyscall ()
(gdb) break mna_
mna_create_svr_conf  mna_hook_child_init  mna_hook_handler     mna_srv_conf
(gdb) break mna_
mna_create_svr_conf  mna_hook_child_init  mna_hook_handler     mna_srv_conf
(gdb) break mna_hook_handler
Breakpoint 1 at 0x15b44e: file mod_ninja_access.c, line 506.
(gdb) c
Continuing.

Breakpoint 1, mna_hook_handler (r=0x86513e8) at mod_ninja_access.c:506
warning: Source file is more recent than executable.
506             if (!strcmp(r->handler, "ninja_access"))
(gdb) n
505     {
(gdb) n
506             if (!strcmp(r->handler, "ninja_access"))
(gdb) n
510             else if(!strcmp(r->handler, "ninja_js"))
(gdb) s
188 mna_srv_conf* svr = ap_get_module_config(r->server->module_config, &ninja_access_module);
(gdb) n
190 pathinfo = (char*)apr_pstrdup(r->pool, r->uri+strlen(svr->thisScript));
(gdb) n
188 mna_srv_conf* svr = ap_get_module_config(r->server->module_config, &ninja_access_module);
(gdb) p pathinfo
No symbol "pathinfo" in current context.
(gdb) n
190 pathinfo = (char*)apr_pstrdup(r->pool, r->uri+strlen(svr->thisScript));
(gdb) n
191             if(pathinfo == NULL)
(gdb) p pathinfo
No symbol "pathinfo" in current context.
(gdb) n
190 pathinfo = (char*)apr_pstrdup(r->pool, r->uri+strlen(svr->thisScript));
(gdb) n
191             if(pathinfo == NULL)
(gdb) n
342 ap_log_error(APLOG_MARK, APLOG_WARNING, rv, r->server, "[ninja_access] Couldn't open js file %s", svr->jsFile);
(gdb) n
516     }



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx
  "   from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx
For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx


[Index of Archives]     [Open SSH Users]     [Linux ACPI]     [Linux Kernel]     [Linux Laptop]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Squid]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux