Hello,
I’m having a problem getting Neutrino’s gcc/gdb/pdebug combination to
properly observe
breakpoints in member functions that are defined in the class definition.
For example,
#include
class Foo {
public:
void func(void) {
cout << “hello world” << endl;
}
};
void main() {
Foo *p = new Foo();
p->func();
delete p;
}
If I compile with ‘qcc -V gcc_ntox86 -lang-c++ -g -o foo foo.cpp’ and then
‘gdb ./foo’, I’m unable
to set a breakpoint on Foo::func or trace into Foo::func. For example,
(gdb) break Foo::func
Internal: static symbol `Foo’ found in foo.cpp psymtab but not in symtab
If I stop the program in ‘main’ and try to trace into Foo::func with ‘step’
it runs over as if I’d
used ‘next’.
If I change the source to instead define Foo::func outside the class
definition it works.
This is disappointing since the exact same gcc 2.95.2/gdb 4.17 combination
does not
have this problem under Solaris,FreeBSD,Linux,etc.
Am I missing something here (some compile option?) or do the GNU tools
simply behave
differently under Neutrino than under typical versions of unix?
I just tried ‘-gstabs’ and it works as expected, great!
Thanks for the help !!
“Colin Burgess” <cburgess@qnx.com> wrote in message
news:96ukdu$k2l$1@nntp.qnx.com…
Try debugging using -gstabs or -gdwarf-2 - these work much better for
C++.
Dave Morrow <> dem@interaccess.com> > wrote:
Hello,
I’m having a problem getting Neutrino’s gcc/gdb/pdebug combination to
properly observe
breakpoints in member functions that are defined in the class
definition.
For example,
–
cburgess@qnx.com
Try debugging using -gstabs or -gdwarf-2 - these work much better for
C++.
Dave Morrow <dem@interaccess.com> wrote:
Hello,
I’m having a problem getting Neutrino’s gcc/gdb/pdebug combination to
properly observe
breakpoints in member functions that are defined in the class definition.
For example,
#include <iostream
class Foo {
public:
void func(void) {
cout << “hello world” << endl;
}
};
void main() {
Foo *p = new Foo();
p->func();
delete p;
}
If I compile with ‘qcc -V gcc_ntox86 -lang-c++ -g -o foo foo.cpp’ and then
‘gdb ./foo’, I’m unable
to set a breakpoint on Foo::func or trace into Foo::func. For example,
(gdb) break Foo::func
Internal: static symbol `Foo’ found in foo.cpp psymtab but not in symtab
If I stop the program in ‘main’ and try to trace into Foo::func with ‘step’
it runs over as if I’d
used ‘next’.
If I change the source to instead define Foo::func outside the class
definition it works.
This is disappointing since the exact same gcc 2.95.2/gdb 4.17 combination
does not
have this problem under Solaris,FreeBSD,Linux,etc.
Am I missing something here (some compile option?) or do the GNU tools
simply behave
differently under Neutrino than under typical versions of unix?
–
cburgess@qnx.com