help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gdb crashes with multiple inheritence


From: deb . mohanty
Subject: gdb crashes with multiple inheritence
Date: 17 Jan 2006 21:37:41 -0800
User-agent: G2/0.2

GDB crashes when I'm trying to print a function.

Here is the code snippet. When I'm trying to print "d.foo()"  in main
function from GDB, it crashes. I'm using GNU gdb 4.18. Is there anyway
to prevent this crash (without making changes to the code)?

#include <iostream>
using namespace std;

class Base1
{
  public:
  void bar()
  {
    cout << "I'm in Base1::bar " << endl;
  }
};

class Base2
{
  public:
  void foo()
  {
    baz();
  }
  virtual void baz() = 0;
};

class Derived:
  public Base1, public Base2
{
public:
  virtual void baz()
  {
    cout << "I'm in Derived::baz " << endl;
  }
}
;


int main()
{
  Derived d;
  d.foo(); // Put breakpoint here
  return 0;
}



reply via email to

[Prev in Thread] Current Thread [Next in Thread]