This is the mail archive of the
gdb@sourceware.org
mailing list for the GDB project.
no symbol in current context problem
- From: "Peng Yu" <pengyu dot ut at gmail dot com>
- To: gdb at sourceware dot org
- Date: Mon, 15 Sep 2008 11:54:51 -0500
- Subject: no symbol in current context problem
Hi,
I have the following program. When I step in to test's constructor, I
would be able to print the variable three. It says
(gdb) n
7 T three = 3;
(gdb) n
8 std::cout << three << std::endl;
(gdb) p three
No symbol "three" in current context.
I know that this is a bug has been reported before. But I'm wondering
if it is already fixed in the newest version of gdb.
Thanks,
Peng
#include <iostream>
template <typename T>
class test {
public:
test(const T &a) : _a(a) {
T three = 3;
std::cout << three << std::endl;
}
private:
T _a;
};
int main() {
test<double> p(10);
}