M
Marc-Andre Michel
Hi,
With the following c-like code:
void test3(void) {
string* s = NULL;
cout << s.length();
}
void test2(void) {
test3();
}
void test1(void) {
test2();
}
int main(int argc, char**argv) {
test1();
}
an exception will be thrown out of the main thread. If I analyzse the
core dump with a debugger, the call stack will show me the following
call order:
test3
test2
test1
main
indicating that the exception comes from test3().
But now if a similar code is executed from a class:
class C {
public:
void test1() {
test2();
}
void test2() {
test3();
}
void test3() {
string* s = NULL;
cout << s.length();
}
};
int main(int argc, char**argv) {
C c;
c.test1();
}
the call stack will only show:
c::test1
main
Does anybody know why ? Is it a compiler issue (I'm using ms-visual
c++ 6) ?
Is there a way to get the complete call stack ?
many thanks
Marc-Andre
With the following c-like code:
void test3(void) {
string* s = NULL;
cout << s.length();
}
void test2(void) {
test3();
}
void test1(void) {
test2();
}
int main(int argc, char**argv) {
test1();
}
an exception will be thrown out of the main thread. If I analyzse the
core dump with a debugger, the call stack will show me the following
call order:
test3
test2
test1
main
indicating that the exception comes from test3().
But now if a similar code is executed from a class:
class C {
public:
void test1() {
test2();
}
void test2() {
test3();
}
void test3() {
string* s = NULL;
cout << s.length();
}
};
int main(int argc, char**argv) {
C c;
c.test1();
}
the call stack will only show:
c::test1
main
Does anybody know why ? Is it a compiler issue (I'm using ms-visual
c++ 6) ?
Is there a way to get the complete call stack ?
many thanks
Marc-Andre