* GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid)
@ 2009-04-18 5:19 Joshua Kramer
2009-04-18 7:56 ` Paul Pluzhnikov
2009-04-18 12:43 ` Jan Kratochvil
0 siblings, 2 replies; 3+ messages in thread
From: Joshua Kramer @ 2009-04-18 5:19 UTC (permalink / raw)
To: gdb
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)
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid)
2009-04-18 5:19 GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid) Joshua Kramer
@ 2009-04-18 7:56 ` Paul Pluzhnikov
2009-04-18 12:43 ` Jan Kratochvil
1 sibling, 0 replies; 3+ messages in thread
From: Paul Pluzhnikov @ 2009-04-18 7:56 UTC (permalink / raw)
To: Joshua Kramer; +Cc: gdb
On Fri, Apr 17, 2009 at 8:33 PM, Joshua Kramer <josh@globalherald.net> wrote:
> 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.
The most likely cause is a "pilot error".
Are you debugging the binary you just rebuilt?
How do you invoke GDB?
All the symptoms you've listed are consistent with you debugging
some *other* optimized binary.
> 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)
>
>
--
Paul Pluzhnikov
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid)
2009-04-18 5:19 GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid) Joshua Kramer
2009-04-18 7:56 ` Paul Pluzhnikov
@ 2009-04-18 12:43 ` Jan Kratochvil
1 sibling, 0 replies; 3+ messages in thread
From: Jan Kratochvil @ 2009-04-18 12:43 UTC (permalink / raw)
To: Joshua Kramer; +Cc: gdb
Hi Joshua,
On Sat, 18 Apr 2009 05:33:00 +0200, Joshua Kramer wrote:
> I'm having some really bizarre problems debugging Apache Qpid under
> CentOS 5.2,
as CentOS-5.3 is available and GDB is rebased from 6.5 to 6.8 (+many other
patches) could you first that one? Building FSF GDB HEAD may also be worth
a try:
http://www.gnu.org/software/gdb/current/
cvs -d :pserver:anoncvs@sourceware.org:/cvs/src co gdb
Still according to your description I would double-check the compilation
command if some -O2 could not crept in.
Regards,
Jan
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2009-04-18 7:56 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-04-18 5:19 GDB Hopelessly broken (CentOS 5.2, debugging Apache QPid) Joshua Kramer
2009-04-18 7:56 ` Paul Pluzhnikov
2009-04-18 12:43 ` Jan Kratochvil
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox