This is the mail archive of the gdb-prs@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug gdb/21714] New: static member derived class print loop


https://sourceware.org/bugzilla/show_bug.cgi?id=21714

            Bug ID: 21714
           Summary: static member derived class print loop
           Product: gdb
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P2
         Component: gdb
          Assignee: unassigned at sourceware dot org
          Reporter: marc-andre.hebert at tmx dot com
  Target Milestone: ---

While trying to debug some of our source code, I stumbled upon a crash. 

It seems very similar in description to bugs 9167 and 10687 but it is still
failing in 8.0 (also confirmed under 7.11.1).

When using mi2 gdb does a segfault. With usual command line the print loops.

Here is a sample code:
class MyClass
{
public:
        int mValue;
        MyClass(int Value=0) : mValue(Value) {}

        static MyClass StaticMember;
};

class MyClass2 : public MyClass
{
public:
        double mValue;
        MyClass2(double Value=0.0) : mValue(Value) {}

        static MyClass2 StaticMember2;
};

MyClass  MyClass::StaticMember(100);
MyClass2 MyClass2::StaticMember2(100);

int main(int argc, char** charv)
{
        MyClass2 i;

        return -1;
}
------------------------------
(gdb) print i
$1 = {<MyClass> = {mValue = 0, static StaticMember = {mValue = 100, static
StaticMember = <same as static member of an already seen type>}}, mValue = 0,
static StaticMember2 = {<MyClass> = {mValue = 0, static StaticMember = {
        mValue = 100, static StaticMember = <same as static member of an
already seen type>}}, mValue = 100, static StaticMember2 = {<MyClass> = {mValue
= 0, static StaticMember = {mValue = 100, 
          static StaticMember = <same as static member of an already seen
type>}}, mValue = 100, static StaticMember2 = {<MyClass> = {mValue = 0, static
StaticMember = {.....

-- 
You are receiving this mail because:
You are on the CC list for the bug.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]