From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4521 invoked by alias); 18 Apr 2009 03:33:04 -0000 Received: (qmail 4513 invoked by uid 22791); 18 Apr 2009 03:33:02 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_00,RDNS_DYNAMIC X-Spam-Check-By: sourceware.org Received: from oh-67-76-158-149.sta.embarqhsd.net (HELO pobox.globalherald.net) (67.76.158.149) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 18 Apr 2009 03:32:58 +0000 Received: from localhost.localdomain (unknown [192.168.2.210]) by pobox.globalherald.net (Postfix) with ESMTP id 99B441FD099 for ; Fri, 17 Apr 2009 00:36:14 -0400 (EDT) Message-ID: <49E949EC.5020700@globalherald.net> Date: Sat, 18 Apr 2009 05:19:00 -0000 From: Joshua Kramer User-Agent: Thunderbird 2.0.0.21 (X11/20090302) MIME-Version: 1.0 To: gdb@sourceware.org Subject: GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid) Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gdb-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00147.txt.bz2 Hello Everyone, I'm having some really bizarre problems debugging Apache Qpid under CentOS 5.2, and I'm wondering if anyone can shed some light on this. The application is compiled with -ggdb and no optimization (the -O2 specified in the makefile was removed). GDB (as supplied by the OS) is exhibiting odd behavior. First, I keep getting the error about the source files being newer than the executable, even though: 1. I have manually deleted all object files and executables, then ran make, and 2. I verified that the executable is 30 minutes newer than any source file. Next, it appears that some code does not get compiled. If I set a breakpoint on line 335 of a certain file, it does not stop until line 339. Also, some variables do not get declared. In the code example shown below, the seContext variable is never declared - that is, if I set the breakpoint on lines directly after I assign something to that variable, when gdb stops and I enter the command 'print seContext', gdb replies that there is no seContext in this scope. Are these things a result of unseen compiler optimizations? Any help is greatly appreciated. Thanks! -Joshua Kramer (gdb) list /home/josh/dev/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp:325 320 321 void SessionAdapter::QueueHandlerImpl::declare(const string& name, const string& alternateExchange, 322 bool passive, bool durable, bool exclusive, 323 bool autoDelete, const qpid::framing::FieldTable& arguments) 324 { 325 AclModule* acl = getBroker().getAcl(); 326 327 std::string seContext; 328 //if (arguments.isSet("secontext")) 329 { (gdb) list /home/josh/dev/qpid/trunk/qpid/cpp/src/qpid/broker/SessionAdapter.cpp:343 338 params.insert(make_pair(acl::PROP_EXCLUSIVE, std::string(exclusive ? "true" : "false"))); 339 params.insert(make_pair(acl::PROP_AUTODELETE, std::string(autoDelete ? "true" : "false"))); 340 341 // JPK: Create some parameters from the arguments. 342 343 //if (arguments.isSet("secontext")) 344 { 345 seContext = arguments.getAsString("secontext"); 346 params.insert(make_pair(acl::PROP_SECONTEXT, seContext)); 347 } (gdb)