From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaas@neosoft.com To: gdb-patches@cygnus.com Subject: [PATCH] Overload test failure patch Date: Wed, 17 Mar 1999 15:15:00 -0000 Message-id: <19990317171753.A9675@localhost.neosoft.com> X-SW-Source: 1999-03/msg00061.html Hi. I believe one test in the 'overload' tests fails because of a potential problem in the test program, not gdb. The failure I see is when gdb prints out the values of instance 'foo_instance1' of class 'Foo'. This instance is called with the constructor function taking an integer as a parameter. The character pointer parameter 'ccpfoo' is never initialized to anything, so when gdb executes 'print foo_instance1' it prints out {ifoo = '111', ccpfoo = 0xXXXXXX "{stuff}"} instead of {ifoo = '111', ccpfoo = 0x0} as the test expects. My patch modifies the constructor function to explicitly set the pointer to null in this case, thus making the test pass. I'm not a C++ programmer by a long shot, so this patch may be compensating for an issue regarding the compiler - egcs-1.1.2, i586 - but I really, really doubt that. Use the patch as you see fit. Art Haas ============================================== --- gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc.orig Mon Jan 4 09:35:05 1999 +++ gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc Wed Mar 17 16:51:11 1999 @@ -73,7 +73,7 @@ return 0; } -foo::foo (int i) { ifoo = i;} +foo::foo (int i) { ifoo = i; ccpfoo = NULL;} foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; } foo::foo (foo& afoo) { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;} foo::~foo () {} From mboxrd@z Thu Jan 1 00:00:00 1970 From: ahaas@neosoft.com To: gdb-patches@cygnus.com Subject: [PATCH] Overload test failure patch Date: Thu, 01 Apr 1999 00:00:00 -0000 Message-ID: <19990317171753.A9675@localhost.neosoft.com> X-SW-Source: 1999-q1/msg00115.html Message-ID: <19990401000000.smY3_ChyE5cELGqRZHnLkzxiU6SgpNJ7zXa_Niw316Y@z> Hi. I believe one test in the 'overload' tests fails because of a potential problem in the test program, not gdb. The failure I see is when gdb prints out the values of instance 'foo_instance1' of class 'Foo'. This instance is called with the constructor function taking an integer as a parameter. The character pointer parameter 'ccpfoo' is never initialized to anything, so when gdb executes 'print foo_instance1' it prints out {ifoo = '111', ccpfoo = 0xXXXXXX "{stuff}"} instead of {ifoo = '111', ccpfoo = 0x0} as the test expects. My patch modifies the constructor function to explicitly set the pointer to null in this case, thus making the test pass. I'm not a C++ programmer by a long shot, so this patch may be compensating for an issue regarding the compiler - egcs-1.1.2, i586 - but I really, really doubt that. Use the patch as you see fit. Art Haas ============================================== --- gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc.orig Mon Jan 4 09:35:05 1999 +++ gdb-4.17.86/gdb/testsuite/gdb.c++/overload.cc Wed Mar 17 16:51:11 1999 @@ -73,7 +73,7 @@ return 0; } -foo::foo (int i) { ifoo = i;} +foo::foo (int i) { ifoo = i; ccpfoo = NULL;} foo::foo (int i, const char *ccp) { ifoo = i; ccpfoo = ccp; } foo::foo (foo& afoo) { ifoo = afoo.ifoo; ccpfoo = afoo.ccpfoo;} foo::~foo () {}