[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
More problems with debugging C++ programs
From: |
Carlo Wood |
Subject: |
More problems with debugging C++ programs |
Date: |
Wed, 22 May 2002 03:30:03 +0200 |
User-agent: |
Mutt/1.2.5i |
At a breakpoint in this line:
294 instance_locked[instance] += 1;
295 locked_by[instance] = pthread_self();
296 locked_from[instance] = __builtin_return_address(0);
(gdb) p instance_locked[instance]
No symbol "instance" in current context.
Fortunately I happen to know that instance == 3, so I type
(gdb) p instance_locked[3]
Address of "instance_locked" is unknown.
Fortunately I know that this is "caused" by gdb not being
able to deal with namespaces very well... so I type:
(gdb) p 'libcw::debug::_private_::instance_locked'[3]
cannot subscript something of type `<data variable, no debug info>'
Ah, gdb ALSO doesn't know the type... so lets TELL it the type:
(gdb) p ((unsigned int*)&'libcw::debug::_private_::instance_locked')[3]
$4 = 1
This isn't the nicest way to debug though.
I wish someone would react to my first post here...
(with subject: Huge problems with debugging threaded C++ programs)
so we can make a start with fixing things like this.
--
Carlo Wood <address@hidden>
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- More problems with debugging C++ programs,
Carlo Wood <=