Return-Path: Delivered-To: apmail-httpd-modules-dev-archive@minotaur.apache.org Received: (qmail 81073 invoked from network); 13 Apr 2009 21:40:55 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 13 Apr 2009 21:40:55 -0000 Received: (qmail 70668 invoked by uid 500); 13 Apr 2009 21:40:54 -0000 Delivered-To: apmail-httpd-modules-dev-archive@httpd.apache.org Received: (qmail 70609 invoked by uid 500); 13 Apr 2009 21:40:54 -0000 Mailing-List: contact modules-dev-help@httpd.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: modules-dev@httpd.apache.org Delivered-To: mailing list modules-dev@httpd.apache.org Received: (qmail 70599 invoked by uid 99); 13 Apr 2009 21:40:54 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2009 21:40:54 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of sorinm@gmail.com designates 209.85.219.162 as permitted sender) Received: from [209.85.219.162] (HELO mail-ew0-f162.google.com) (209.85.219.162) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 13 Apr 2009 21:40:46 +0000 Received: by ewy6 with SMTP id 6so2419427ewy.24 for ; Mon, 13 Apr 2009 14:40:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:content-type :content-transfer-encoding; bh=PLbGSRfSCOlZ2RzX0TPpHg72Vbten1UeeAGVEGcgLuI=; b=kINP1pSC+O2i5uMSICQzGO+bVF98YlHszp597F8yghcLjghgqNY0YBu4l8TKSL3AK8 6xaYTpHXS5fGhCAXAUuRQ6n3ma54nWMrKjNIP+3Nx1yUjdAh4gnPnBfXYQKkttQprors nqyi/OUVdM7NhYF1SNKJtsO14jTn7F9R6e83c= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type:content-transfer-encoding; b=LT5euqebPVijkEYLxxnOJK3B41s+OuT1r/fN5iTuEjE5JMzbMBu9IWWe2DUg0PF/6l oFcG5X4sCJXv+g3ww/vRtakLRxkxrQ8WeVgjo2s23ADlnTek5OMmvgfPBZcFhI4cHQb4 6AtglpcMmJZwv6L4IHM7Vkq/UPlvFv0ZvnCgU= MIME-Version: 1.0 Received: by 10.210.127.13 with SMTP id z13mr2317850ebc.68.1239658826426; Mon, 13 Apr 2009 14:40:26 -0700 (PDT) In-Reply-To: References: Date: Mon, 13 Apr 2009 23:40:26 +0200 Message-ID: <20170a030904131440v79bea69dp90645dde285e2f51@mail.gmail.com> Subject: Re: Debuggin appears optimised but shouldn't be? From: Sorin Manolache To: modules-dev@httpd.apache.org Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable X-Virus-Checked: Checked by ClamAV on apache.org On Mon, Apr 13, 2009 at 13:46, Juhani Connolly wrote: > I'm currently trying to iron out some bugs in a module I'm working and ha= ve > spent a day trying to get a debug environment working properly for apache= . > > My ./configure for apache itself was the following: > OPTIM=3D-O0\ ./configure --prefix=3D/usr/local/apache-dbg/ > --enable-maintainer-mode --with-apr=3D/usr/local/ --with-apr-util=3D/usr/= local/ > --with-mpm=3Dworker --enable-dbd --enable-so --enable-cgi Your configuration seems ok. Mine is CFLAGS=3D"-ggdb3 -O0 -fno-inline" ./configure and the rest... and it works. Sorin > > The apr/apr-util were also compiled with OPTIM=3D-O0 and maintainer-mode = as > well as some stuff like AP-DBD mysql. > > My problem is that whan I run apache through the debugger it still seems > blatantly like I'm running optimised code as code jumps back and forth an= d > certain variable are not visible at all. > > I would appreciate if someone could advise me as to what the problem is a= nd > how to resolve it. > > > ************************************ > > Some information that may be relevant: > > My module compiles in the following way when using apxs: > >> make > > /usr/local//build-1/libtool --silent --mode=3Dcompile gcc -Wall > -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread = =A0-g > =A0-DLINUX=3D2 -D_REENTRANT -D_GNU_SOURCE -DAP_DEBUG =A0 -I/n/trunk/inclu= de/ > =A0-I/usr/local/apache-dbg//include -I. -I/usr/local//include/apr-1 > -prefer-pic -c mod_ninja_ads.c && touch mod_ninja_ads.slo > /usr/local//build-1/libtool --silent --mode=3Dlink gcc -Wall > -Wmissing-prototypes -Wstrict-prototypes -Wmissing-declarations -pthread = =A0-g > =A0 =A0 =A0 =A0-o mod_ninja_ads.la -rpath /usr/local/apache-dbg//modules = -module > -avoid-version =A0mod_ninja_ads.lo > > A sample of gdb output: > The fact that it keeps telling me my source files are newer than my > executable is certainly a cause of concern and I have no idea why this is > the case as checking the library it has a last modified moments before I = run > it. > > *************************************************************************= ********** > [root@stockx bin]# gdb ./httpd > GNU gdb Red Hat Linux (6.5-37.el5_2.2rh) > Copyright (C) 2006 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. =A0Type "show warranty" for deta= ils. > This GDB was configured as "x86_64-redhat-linux-gnu"...Using host > libthread_db library "/lib64/libthread_db.so.1". > > (gdb) break ninja_ads_create_svr_conf > Function "ninja_ads_create_svr_conf" not defined. > Make breakpoint pending on future shared library load? (y or [n]) y > Breakpoint 1 (ninja_ads_create_svr_conf) pending. > (gdb) r -X > Starting program: /usr/local/apache-dbg/bin/httpd -X > [Thread debugging using libthread_db enabled] > [New Thread 47407880549472 (LWP 23895)] > Breakpoint 2 at 0x2b1e02016b80: file mod_ninja_ads.c, line 58. > Pending breakpoint "ninja_ads_create_svr_conf" resolved > [Switching to Thread 47407880549472 (LWP 23895)] > > Breakpoint 2, ninja_ads_create_svr_conf (p=3D0xa92d138, s=3D0xa945c20) at > mod_ninja_ads.c:58 > warning: Source file is more recent than executable. > 58 =A0 =A0 =A0{ > (gdb) n > 59 =A0 =A0 =A0 =A0 =A0 =A0 =A0ninja_ads_srv_conf * svr =3D apr_pcalloc(p, > sizeof(ninja_ads_srv_conf)); > (gdb) > 61 =A0 =A0 =A0// =A0 =A0 =A0memset(svr->axadFiles, 0, sizeof(svr->axadFil= es)); > (gdb) > 59 =A0 =A0 =A0 =A0 =A0 =A0 =A0ninja_ads_srv_conf * svr =3D apr_pcalloc(p, > sizeof(ninja_ads_srv_conf)); > (gdb) p svr > No symbol "svr" in current context. > (gdb) n > 61 =A0 =A0 =A0// =A0 =A0 =A0memset(svr->axadFiles, 0, sizeof(svr->axadFil= es)); > (gdb) > 60 =A0 =A0 =A0 =A0 =A0 =A0 =A0svr->axadFileList =3D NULL; > (gdb) p svr > > ************************************************************************* > --=20 A: Because it reverses the logical flow of conversation. Q: Why is top-posting frowned upon? A: Top-posting. Q: What is the most annoying thing in e-mail?