"Step into" also did just run through the application. But I reduced it now to the absolute minimum needed to reproduce the problem here:
namespace foo
{
class Base1
{
public:
virtual ~Base1() {}
};
};
class Base2
{
};
class TestDebugger : public foo::Base1 ,public virtual Base2
{
};
int main(int argc, char *argv[])
{
int hereBreakpoint = 1;
TestDebugger iAmTheBug;
return 0;
}
As soon as iAmTheBug is outcommented it will stop at breakpoints. If it's like in the code above it will just run through and quit the application.
I hope it's reproducable on other systems.
Your example works for me on w2k, but "info locals" in "Debugger(debug)" gives:
> info locals
hereBreakpoint = 4199414
iAmTheBug = {<foo::Base1> = {_vptr$Base1 = 0x401370}, <Base2> = <invalid address>, <No data fields>}
On linux it ends immediately, and if I use gdb from commandline, I can set the bp and stop there, but "info locals" leads to a segfault.
So it might be a gcc/gdb problem and not a C::B problem.
Right, this seems to be some kind of gcc/gdb bug.
This bug can be circumvented by removing the "virtual" keyword from the TestDebugger class' ancestors list
class TestDebugger : public foo::Base1 ,public Base2