Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: ahaas@neosoft.com
To: gdb-patches@cygnus.com
Subject: [PATCH] Overload test failure patch
Date: Thu, 01 Apr 1999 00:00:00 -0000	[thread overview]
Message-ID: <19990317171753.A9675@localhost.neosoft.com> (raw)
Message-ID: <19990401000000.smY3_ChyE5cELGqRZHnLkzxiU6SgpNJ7zXa_Niw316Y@z> (raw)

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 ()                       {}


             reply	other threads:[~1999-04-01  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
1999-03-17 15:15 ahaas [this message]
1999-04-01  0:00 ` ahaas

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=19990317171753.A9675@localhost.neosoft.com \
    --to=ahaas@neosoft.com \
    --cc=gdb-patches@cygnus.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox